|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
edu.rice.cs.util.swing.SwingFrame
edu.rice.cs.drjava.ui.ExecuteExternalDialog
public class ExecuteExternalDialog
| Nested Class Summary | |
|---|---|
static class |
ExecuteExternalDialog.FrameState
Class to save the frame state, i.e. |
| Nested classes/interfaces inherited from class javax.swing.JFrame |
|---|
JFrame.AccessibleJFrame |
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
Frame.AccessibleAWTFrame |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
private JButton |
_cancelCommandButton
Cancel Command button. |
private CompletionMonitor |
_cm
Completion monitor to tell the calling dialog that we're done. |
private JButton |
_commandEnclosingFileBtn
Command enclosing file button. |
private JTextPane |
_commandEnclosingFileLine
Entered command line enclosing file. |
private StyledDocument |
_commandEnclosingFileLineDoc
Command line enclosing file preview document. |
private JTextPane |
_commandEnclosingFileLinePreview
Command line enclosing file preview. |
private JTextPane |
_commandLine
Entered command line. |
(package private) SimpleAttributeSet |
_commandLineCmdAS
Style for normal text |
private StyledDocument |
_commandLineDoc
Command line preview document. |
private JTextPane |
_commandLinePreview
Command line preview. |
private JLabel |
_commandLinePreviewLabel
Command line preview label. |
(package private) JPanel |
_commandPanel
Command line panel. |
private JButton |
_commandWorkDirBtn
Command working directory button. |
private JTextPane |
_commandWorkDirLine
Entered command line working directory. |
private StyledDocument |
_commandWorkDirLineDoc
Command line working directory preview document. |
private JTextPane |
_commandWorkDirLinePreview
Command line working directory preview. |
protected DirectoryChooser |
_dirChooser
Directory chooser to open when clicking the "..." button. |
(package private) DocumentListener |
_documentListener
Command line document listener. |
protected int |
_editIndex
Index of the saved external process being edited if _editMode is true. |
protected boolean |
_editMode
Edit mode if true. |
(package private) DocumentListener |
_enclosingFileDocumentListener
Command line enclosing file document listener. |
protected FileChooser |
_fileChooser
File chooser to open when clicking the "..." button. |
private JButton |
_insertCommandButton
Insert Command button. |
protected InsertVariableDialog |
_insertVarDialog
Dialog to insert variables. |
protected CompletionMonitor |
_insertVarDialogMonitor
Completion monitor to simulate modal behavior. |
private JTextPane |
_lastCommandFocus
Last of the two text panes to have focus. |
protected ExecuteExternalDialog.FrameState |
_lastState
Last frame state. |
protected MainFrame |
_mainFrame
Main frame. |
protected PropertyMaps |
_props
PropertyMaps used for substitution when replacing variables. |
private JButton |
_runCommandButton
Run Command button. |
private JButton |
_saveCommandButton
Save Command button. |
(package private) SimpleAttributeSet |
_varCommandLineCmdStyle
Style for variable the executable part. |
(package private) SimpleAttributeSet |
_varErrorCommandLineCmdStyle
Style for erroneous variable the command args part. |
(package private) DocumentListener |
_workDirDocumentListener
Command line work directory document listener. |
protected Runnable1<WindowEvent> |
CANCEL
Runnable that calls _cancel. |
private static int |
FRAME_HEIGHT
|
private static int |
FRAME_WIDTH
|
static String |
STALE_TOOLTIP
|
| Fields inherited from class javax.swing.JFrame |
|---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Frame |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ExecuteExternalDialog(MainFrame mf)
Create a dialog with the "Run" button. |
|
ExecuteExternalDialog(MainFrame mf,
boolean editMode,
int editIndex,
CompletionMonitor cm)
Create a dialog. |
|
| Method Summary | |
|---|---|
private void |
_cancel()
Method that handels the Cancel button |
private void |
_insertVariableCommand()
Insert a variable into the command line. |
private void |
_runCommand()
Execute the command line. |
private void |
_saveCommand()
Save the command line to the menu. |
private boolean |
_saveSettings()
Save the settings for this dialog. |
static int |
addToMenu(String name,
String cmdline,
String workdir,
String enclosingFile)
Add new process to menu. |
protected void |
chooseDir(JTextPane pane)
Opens the file chooser to select a directory, putting the result in the file field. |
protected void |
chooseFile(JTextPane pane)
Opens the file chooser to select a file, putting the result in the file field. |
protected void |
colorVariables(JTextPane pane,
PropertyMaps props,
DocumentListener dl,
SimpleAttributeSet normal,
SimpleAttributeSet variable,
SimpleAttributeSet error)
Color properties as variables. |
static void |
editInMenu(int editIndex,
String name,
String cmdline,
String workdir,
String enclosingFile)
Edit existing process in menu. |
ExecuteExternalDialog.FrameState |
getFrameState()
Returns the last state of the frame, i.e. |
private void |
initComponents()
Build the dialog. |
private JPanel |
makeCommandPane()
|
ExternalProcessPanel |
runCommand(String name,
String cmdline,
String workdir,
String enclosingFile,
PropertyMaps pm)
Run a command and return an external process panel. |
static void |
saveToFile(int index,
File f)
Save process to file. |
void |
setFrameState(ExecuteExternalDialog.FrameState ds)
Sets state of the frame, i.e. |
void |
setFrameState(String s)
Sets state of the frame, i.e. |
void |
setVisible(boolean vis)
Toggle visibility of this frame. |
| Methods inherited from class edu.rice.cs.util.swing.SwingFrame |
|---|
duringInit, initDone |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
private static final int FRAME_WIDTH
private static final int FRAME_HEIGHT
private JButton _runCommandButton
private JButton _saveCommandButton
private JButton _insertCommandButton
private JButton _cancelCommandButton
private JTextPane _commandLine
private JLabel _commandLinePreviewLabel
private JTextPane _commandLinePreview
private StyledDocument _commandLineDoc
private JTextPane _commandWorkDirLine
private JTextPane _commandWorkDirLinePreview
private StyledDocument _commandWorkDirLineDoc
private JButton _commandWorkDirBtn
private JTextPane _commandEnclosingFileLine
private JTextPane _commandEnclosingFileLinePreview
private StyledDocument _commandEnclosingFileLineDoc
private JButton _commandEnclosingFileBtn
private JTextPane _lastCommandFocus
SimpleAttributeSet _varCommandLineCmdStyle
SimpleAttributeSet _varErrorCommandLineCmdStyle
SimpleAttributeSet _commandLineCmdAS
JPanel _commandPanel
DocumentListener _documentListener
DocumentListener _workDirDocumentListener
DocumentListener _enclosingFileDocumentListener
protected DirectoryChooser _dirChooser
protected FileChooser _fileChooser
protected InsertVariableDialog _insertVarDialog
protected CompletionMonitor _insertVarDialogMonitor
private CompletionMonitor _cm
protected MainFrame _mainFrame
protected ExecuteExternalDialog.FrameState _lastState
protected boolean _editMode
protected int _editIndex
protected PropertyMaps _props
public static final String STALE_TOOLTIP
protected final Runnable1<WindowEvent> CANCEL
| Constructor Detail |
|---|
public ExecuteExternalDialog(MainFrame mf,
boolean editMode,
int editIndex,
CompletionMonitor cm)
mf - the instance of mainframe to query into the projecteditMode - true if a saved external process is editededitIndex - index of the saved external processes to editcm - completion monitor telling the calling dialog that we are donepublic ExecuteExternalDialog(MainFrame mf)
mf - the instance of mainframe to query into the project| Method Detail |
|---|
public ExecuteExternalDialog.FrameState getFrameState()
public void setFrameState(ExecuteExternalDialog.FrameState ds)
ds - State to update to, or null to resetpublic void setFrameState(String s)
s - State to update to, or null to resetprivate void initComponents()
private JPanel makeCommandPane()
protected void colorVariables(JTextPane pane,
PropertyMaps props,
DocumentListener dl,
SimpleAttributeSet normal,
SimpleAttributeSet variable,
SimpleAttributeSet error)
pane - the pane that contains the textprops - the properties to colorprivate void _cancel()
public ExternalProcessPanel runCommand(String name,
String cmdline,
String workdir,
String enclosingFile,
PropertyMaps pm)
name - name of the processcmdline - the command line to execute, before evaluationworkdir - the work directory, before evaluationenclosingFile - the enclosing .djapp JAR file, or "" if not enclosedpm - PropertyMaps used for substitution when replacing variables
private void _runCommand()
private void _saveCommand()
public static int addToMenu(String name,
String cmdline,
String workdir,
String enclosingFile)
name - process namecmdline - command lineworkdir - work directoryenclosingFile - the enclosing .djapp JAR file, or "" if not enclosed
public static void editInMenu(int editIndex,
String name,
String cmdline,
String workdir,
String enclosingFile)
editIndex - the index of the process to editname - process namecmdline - command lineworkdir - work directoryenclosingFile - the enclosing .djapp JAR file, or "" if not enclosed
public static void saveToFile(int index,
File f)
index - index of the process to savef - fileprivate boolean _saveSettings()
private void _insertVariableCommand()
public void setVisible(boolean vis)
setVisible in class Windowprotected void chooseDir(JTextPane pane)
protected void chooseFile(JTextPane pane)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||