edu.rice.cs.drjava.ui
Class ExecuteExternalDialog

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by edu.rice.cs.util.swing.SwingFrame
                          extended by edu.rice.cs.drjava.ui.ExecuteExternalDialog
All Implemented Interfaces:
OptionConstants, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class ExecuteExternalDialog
extends SwingFrame
implements OptionConstants

See Also:
Serialized Form

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
 
Nested classes/interfaces inherited from interface edu.rice.cs.drjava.config.OptionConstants
OptionConstants.AccessLevelChoices, OptionConstants.COMPILER_PREFERENCE_CONTROL, OptionConstants.ConcJUnitCheckChoices, OptionConstants.DefaultFont, OptionConstants.DeleteLLClassFileChoices, OptionConstants.DynamicJavaAccessControlChoices, OptionConstants.FileExtRegistrationChoices, OptionConstants.HeapSizeChoices, OptionConstants.LookAndFeels, OptionConstants.PlasticThemes, OptionConstants.to, OptionConstants.VersionNotificationChoices
 
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 edu.rice.cs.drjava.config.OptionConstants
accessLevelChoices, ADVANCED_LEVEL, ALLOW_PRIVATE_ACCESS, ALWAYS_COMPILE_BEFORE_JAVADOC, ALWAYS_COMPILE_BEFORE_JUNIT, ALWAYS_SAVE_BEFORE_COMPILE, ALWAYS_SAVE_BEFORE_DEBUG, ALWAYS_SAVE_BEFORE_JAVADOC, ALWAYS_SAVE_BEFORE_RUN, apiJavadocChoices, apiJavadocDeprecated, apiJavadocVersionChoices, apiJavadocVersionDeprecated, AUTO_CLOSE_COMMENTS, AUTO_STEP_RATE, BACKUP_FILES, BOOKMARK_COLOR, BROWSER_FILE, BROWSER_HISTORY_MAX_SIZE, BROWSER_STRING, CLIPBOARD_HISTORY_SIZE, COMPILER_ERROR_COLOR, CONCJUNIT_CHECKS_ENABLED, concJUnitCheckChoices, CUSTOM_DRJAVA_JAR_VERSION_SUFFIX, DEBUG_AUTO_IMPORT, DEBUG_BREAKPOINT_COLOR, DEBUG_BREAKPOINT_DISABLED_COLOR, DEBUG_EXPRESSIONS_AND_METHODS_IN_WATCHES, DEBUG_MESSAGE_COLOR, DEBUG_PANEL_HEIGHT, DEBUG_SOURCEPATH, DEBUG_STEP_DRJAVA, DEBUG_STEP_EXCLUDE, DEBUG_STEP_INTERPRETER, DEBUG_STEP_JAVA, DEBUG_THREAD_COLOR, DEFAULT_COMPILER_PREFERENCE, DEFINITIONS_BACKGROUND_COLOR, DEFINITIONS_COMMENT_COLOR, DEFINITIONS_DOUBLE_QUOTED_COLOR, DEFINITIONS_KEYWORD_COLOR, DEFINITIONS_LINE_NUMBER_BACKGROUND_COLOR, DEFINITIONS_LINE_NUMBER_COLOR, DEFINITIONS_MATCH_COLOR, DEFINITIONS_NORMAL_COLOR, DEFINITIONS_NUMBER_COLOR, DEFINITIONS_SINGLE_QUOTED_COLOR, DEFINITIONS_TYPE_COLOR, DELETE_LL_CLASS_FILES, DELETE_LL_CLASS_FILES_CHOICES, DETACH_DEBUGGER, DETACH_TABBEDPANES, DIALOG_AUTOIMPORT_ENABLED, DIALOG_AUTOIMPORT_STATE, DIALOG_AUTOIMPORT_STORE_POSITION, DIALOG_CLIPBOARD_HISTORY_STATE, DIALOG_CLIPBOARD_HISTORY_STORE_POSITION, DIALOG_COMPLETE_JAVAAPI, DIALOG_COMPLETE_SCAN_CLASS_FILES, DIALOG_COMPLETE_WORD_STATE, DIALOG_COMPLETE_WORD_STORE_POSITION, DIALOG_DEBUGFRAME_STATE, DIALOG_DEBUGFRAME_STORE_POSITION, DIALOG_DRJAVA_ERROR_POPUP_ENABLED, DIALOG_DRJAVA_SURVEY_ENABLED, DIALOG_EDITEXTERNALPROCESS_STATE, DIALOG_EDITEXTERNALPROCESS_STORE_POSITION, DIALOG_EXTERNALPROCESS_STATE, DIALOG_EXTERNALPROCESS_STORE_POSITION, DIALOG_GOTOFILE_FULLY_QUALIFIED, DIALOG_GOTOFILE_STATE, DIALOG_GOTOFILE_STORE_POSITION, DIALOG_JAROPTIONS_STATE, DIALOG_JAROPTIONS_STORE_POSITION, DIALOG_LIGHTWEIGHT_PARSING_DELAY, DIALOG_OPENJAVADOC_STATE, DIALOG_OPENJAVADOC_STORE_POSITION, DIALOG_TABBEDPANES_STATE, DIALOG_TABBEDPANES_STORE_POSITION, DISPLAY_ALL_COMPILER_VERSIONS, DISPLAY_RIGHT_MARGIN, DJ_FILE_EXTENSION, DOC_LIST_WIDTH, DRJAVA_ERRORS_BUTTON_COLOR, DRJAVA_SURVEY_DAYS, DRJAVA_USE_FORCE_QUIT, DYNAMICJAVA_ACCESS_CONTROL, DYNAMICJAVA_ACCESS_CONTROL_CHOICES, DYNAMICJAVA_REQUIRE_SEMICOLON, DYNAMICJAVA_REQUIRE_VARIABLE_TYPE, ELEMENTARY_LEVEL, EXTERNAL_SAVED_CMDLINES, EXTERNAL_SAVED_COUNT, EXTERNAL_SAVED_ENCLOSING_DJAPP_FILES, EXTERNAL_SAVED_NAMES, EXTERNAL_SAVED_PREFIX, EXTERNAL_SAVED_WORKDIRS, EXTPROCESS_FILE_EXTENSION, EXTPROCESS_FILE_NAME_INSIDE_JAR, EXTRA_CLASSPATH, EXTRA_COMPILERS, FILE_EXT_REGISTRATION, FILE_EXT_REGISTRATION_CHOICES, FIND_ALL_DOCUMENTS, FIND_MATCH_CASE, FIND_NO_COMMENTS_STRINGS, FIND_NO_TEST_CASES, FIND_ONLY_SELECTION, FIND_REPLACE_FOCUS_IN_DEFPANE, FIND_RESULTS_COLOR1, FIND_RESULTS_COLOR2, FIND_RESULTS_COLOR3, FIND_RESULTS_COLOR4, FIND_RESULTS_COLOR5, FIND_RESULTS_COLOR6, FIND_RESULTS_COLOR7, FIND_RESULTS_COLOR8, FIND_RESULTS_COLORS, FIND_SEARCH_BACKWARDS, FIND_WHOLE_WORD, FIXED_INTERACTIONS_DIRECTORY, FOLLOW_FILE_DELAY, FOLLOW_FILE_LINES, FONT_DOCLIST, FONT_LINE_NUMBERS, FONT_MAIN, FONT_TOOLBAR, FORCE_TEST_SUFFIX, FULL_JAVA, FUNCTIONAL_JAVA_LEVEL, heapSizeChoices, HISTORY_MAX_SIZE, INDENT_LEVEL, INTERACTIONS_AUTO_IMPORT_CLASSES, INTERACTIONS_ERROR_COLOR, INTERACTIONS_EXIT_PROMPT, INTERACTIONS_RESET_PROMPT, INTERMEDIATE_LEVEL, JAVA_FILE_EXTENSION, JAVAC_LOCATION, JAVADOC_1_3_LINK, JAVADOC_1_3_TEXT, JAVADOC_1_4_LINK, JAVADOC_1_4_TEXT, JAVADOC_1_5_LINK, JAVADOC_1_5_TEXT, JAVADOC_1_6_LINK, JAVADOC_1_6_TEXT, JAVADOC_1_7_LINK, JAVADOC_1_7_TEXT, JAVADOC_ACCESS_LEVEL, JAVADOC_ADDITIONAL_LINKS, JAVADOC_API_REF_VERSION, JAVADOC_AUTO_TEXT, JAVADOC_CUSTOM_PARAMS, JAVADOC_DESTINATION, JAVADOC_FROM_ROOTS, JAVADOC_LINK_VERSION, JAVADOC_NONE_TEXT, JAVADOC_PROMPT_FOR_DESTINATION, JUNIT_LINK, JUNIT_LOCATION, JUNIT_LOCATION_ENABLED, KEY_ABOUT, KEY_AUTO_REFRESH_PROJECT, KEY_BACKWARD, KEY_BACKWARD_SELECT, KEY_BEGIN_DOCUMENT, KEY_BEGIN_DOCUMENT_SELECT, KEY_BEGIN_LINE, KEY_BEGIN_LINE_SELECT, KEY_BOOKMARKS_PANEL, KEY_BOOKMARKS_TOGGLE, KEY_BROWSE_BACK, KEY_BROWSE_FORWARD, KEY_CHECK_NEW_VERSION, KEY_CLEAN_PROJECT, KEY_CLEAR_CONSOLE, KEY_CLEAR_HISTORY, KEY_CLEAR_LINE, KEY_CLOSE_ALL_FILES, KEY_CLOSE_FILE, KEY_CLOSE_PROJECT, KEY_CLOSE_SYSTEM_IN, KEY_CLOSING_BRACE, KEY_COMMENT_LINES, KEY_COMPILE, KEY_COMPILE_ALL, KEY_COMPILE_PROJECT, KEY_COMPLETE_FILE, KEY_COPY, KEY_CUT, KEY_CUT_LINE, KEY_DEBUG_AUTOMATIC_TRACE, KEY_DEBUG_BREAKPOINT_PANEL, KEY_DEBUG_BREAKPOINT_TOGGLE, KEY_DEBUG_CLEAR_ALL_BREAKPOINTS, KEY_DEBUG_MODE_TOGGLE, KEY_DEBUG_RESUME, KEY_DEBUG_STEP_INTO, KEY_DEBUG_STEP_OUT, KEY_DEBUG_STEP_OVER, KEY_DELETE_NEXT, KEY_DELETE_PREVIOUS, KEY_DETACH_DEBUGGER, KEY_DETACH_TABBEDPANES, KEY_DOWN, KEY_DOWN_SELECT, KEY_DRJAVA_ERRORS, KEY_DRJAVA_SURVEY, KEY_END_DOCUMENT, KEY_END_DOCUMENT_SELECT, KEY_END_LINE, KEY_END_LINE_SELECT, KEY_EXEC_PROCESS, KEY_EXECUTE_HISTORY, KEY_EXPORT_OLD, KEY_FIND_NEXT, KEY_FIND_PREV, KEY_FIND_REPLACE, KEY_FOLLOW_FILE, KEY_FOR_UNIT_TESTS_ONLY, KEY_FORCE_QUIT, KEY_FORWARD, KEY_FORWARD_SELECT, KEY_GENERATE_CUSTOM_DRJAVA, KEY_GOTO_FILE, KEY_GOTO_FILE_UNDER_CURSOR, KEY_GOTO_LINE, KEY_HELP, KEY_JAR_PROJECT, KEY_JAVADOC_ALL, KEY_JAVADOC_CURRENT, KEY_JUNIT_PROJECT, KEY_LIFT_CURRENT_INTERACTION, KEY_LOAD_HISTORY_SCRIPT, KEY_NEW_CLASS_FILE, KEY_NEW_DRJAVA_INSTANCE, KEY_NEW_FILE, KEY_NEW_PROJECT, KEY_NEW_TEST, KEY_NEXT_DOCUMENT, KEY_NEXT_PANE, KEY_NEXT_WORD, KEY_NEXT_WORD_SELECT, KEY_OPEN_FILE, KEY_OPEN_FOLDER, KEY_OPEN_JAVADOC, KEY_OPEN_JAVADOC_UNDER_CURSOR, KEY_OPEN_PROJECT, KEY_OPENING_BRACE, KEY_PAGE_DOWN, KEY_PAGE_SETUP, KEY_PAGE_UP, KEY_PASTE, KEY_PASTE_FROM_HISTORY, KEY_PREFERENCES, KEY_PREVIOUS_DOCUMENT, KEY_PREVIOUS_PANE, KEY_PREVIOUS_WORD, KEY_PREVIOUS_WORD_SELECT, KEY_PRINT, KEY_PRINT_CONSOLE, KEY_PRINT_INTERACTIONS, KEY_PRINT_PREVIEW, KEY_PROJECT_PROPERTIES, KEY_QUICKSTART, KEY_QUIT, KEY_REDO, KEY_RENAME_FILE, KEY_RESET_INTERACTIONS, KEY_REVERT_FILE, KEY_RUN, KEY_RUN_APPLET, KEY_RUN_PROJECT, KEY_SAVE_ALL_FILES, KEY_SAVE_AS_PROJECT, KEY_SAVE_CONSOLE_COPY, KEY_SAVE_FILE, KEY_SAVE_FILE_AS, KEY_SAVE_FILE_COPY, KEY_SAVE_HISTORY, KEY_SAVE_INTERACTIONS_COPY, KEY_SAVE_PROJECT, KEY_SELECT_ALL, KEY_SHIFT_DELETE_NEXT, KEY_SHIFT_DELETE_PREVIOUS, KEY_TABBED_NEXT_REGION, KEY_TABBED_PREV_REGION, KEY_TEST, KEY_TEST_ALL, KEY_UNCOMMENT_LINES, KEY_UNDO, KEY_UP, KEY_UP_SELECT, KEY_VIEW_INTERACTIONS_CLASSPATH, LANGUAGE_LEVEL, LANGUAGE_LEVEL_EXTENSIONS, LAST_DIRECTORY, LAST_DRJAVA_SURVEY, LAST_DRJAVA_SURVEY_RESULT, LAST_INTERACTIONS_DIRECTORY, LAST_NEW_VERSION_NOTIFICATION, LIGHTWEIGHT_PARSING_ENABLED, LINEENUM_ENABLED, linkChoices, linkDeprecated, linkVersionChoices, linkVersionDeprecated, LOOK_AND_FEEL, MASK, MASTER_JVM_ARGS, MASTER_JVM_XMX, NEW_VERSION_ALLOWED, NEW_VERSION_NOTIFICATION, NEW_VERSION_NOTIFICATION_CHOICES, NEW_VERSION_NOTIFICATION_DAYS, OLD_DJ0_FILE_EXTENSION, OLD_DJ1_FILE_EXTENSION, OLD_DJ2_FILE_EXTENSION, OLD_PROJECT_FILE_EXTENSION, OPEN_FOLDER_RECURSIVE, PLASTIC_THEMES, PROJECT_FILE_EXTENSION, PROJECT_FILE_EXTENSION2, PROMPT_BEFORE_CLEAN, PROMPT_RENAME_LL_FILES, QUIT_PROMPT, RECENT_FILES, RECENT_FILES_MAX_SIZE, RECENT_PROJECTS, REMOTE_CONTROL_ENABLED, REMOTE_CONTROL_PORT, RESET_CLEAR_CONSOLE, RIGHT_MARGIN_COLOR, RIGHT_MARGIN_COLUMNS, RT_CONCJUNIT_LOCATION, RUN_WITH_ASSERT, SHOW_CODE_PREVIEW_POPUPS, SHOW_DEBUG_CONSOLE, SHOW_DEPRECATION_WARNINGS, SHOW_FALLTHROUGH_WARNINGS, SHOW_FINALLY_WARNINGS, SHOW_PATH_WARNINGS, SHOW_SERIAL_WARNINGS, SHOW_SOURCE_WHEN_SWITCHING, SHOW_UNCHECKED_WARNINGS, SLAVE_JVM_ARGS, SLAVE_JVM_XMX, SMART_RUN_FOR_APPLETS_AND_PROGRAMS, STICKY_INTERACTIONS_DIRECTORY, SYSTEM_ERR_COLOR, SYSTEM_IN_COLOR, SYSTEM_OUT_COLOR, TABS_HEIGHT, TEXT_ANTIALIAS, TEXT_FILE_EXTENSION, TOOLBAR_ENABLED, TOOLBAR_ICONS_ENABLED, TOOLBAR_TEXT_ENABLED, WARN_BREAKPOINT_OUT_OF_SYNC, WARN_CHANGE_DCP, WARN_CHANGE_INTERACTIONS, WARN_CHANGE_LAF, WARN_CHANGE_MISC, WARN_CHANGE_THEME, WARN_DEBUG_MODIFIED_FILE, WARN_IF_COMPIZ, WARN_PATH_CONTAINS_POUND, WINDOW_HEIGHT, WINDOW_STATE, WINDOW_STORE_POSITION, WINDOW_WIDTH, WINDOW_X, WINDOW_Y
 
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 javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
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.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
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

FRAME_WIDTH

private static final int FRAME_WIDTH
See Also:
Constant Field Values

FRAME_HEIGHT

private static final int FRAME_HEIGHT
See Also:
Constant Field Values

_runCommandButton

private JButton _runCommandButton
Run Command button.


_saveCommandButton

private JButton _saveCommandButton
Save Command button.


_insertCommandButton

private JButton _insertCommandButton
Insert Command button.


_cancelCommandButton

private JButton _cancelCommandButton
Cancel Command button.


_commandLine

private JTextPane _commandLine
Entered command line.


_commandLinePreviewLabel

private JLabel _commandLinePreviewLabel
Command line preview label.


_commandLinePreview

private JTextPane _commandLinePreview
Command line preview.


_commandLineDoc

private StyledDocument _commandLineDoc
Command line preview document.


_commandWorkDirLine

private JTextPane _commandWorkDirLine
Entered command line working directory.


_commandWorkDirLinePreview

private JTextPane _commandWorkDirLinePreview
Command line working directory preview.


_commandWorkDirLineDoc

private StyledDocument _commandWorkDirLineDoc
Command line working directory preview document.


_commandWorkDirBtn

private JButton _commandWorkDirBtn
Command working directory button.


_commandEnclosingFileLine

private JTextPane _commandEnclosingFileLine
Entered command line enclosing file.


_commandEnclosingFileLinePreview

private JTextPane _commandEnclosingFileLinePreview
Command line enclosing file preview.


_commandEnclosingFileLineDoc

private StyledDocument _commandEnclosingFileLineDoc
Command line enclosing file preview document.


_commandEnclosingFileBtn

private JButton _commandEnclosingFileBtn
Command enclosing file button.


_lastCommandFocus

private JTextPane _lastCommandFocus
Last of the two text panes to have focus.


_varCommandLineCmdStyle

SimpleAttributeSet _varCommandLineCmdStyle
Style for variable the executable part.


_varErrorCommandLineCmdStyle

SimpleAttributeSet _varErrorCommandLineCmdStyle
Style for erroneous variable the command args part.


_commandLineCmdAS

SimpleAttributeSet _commandLineCmdAS
Style for normal text


_commandPanel

JPanel _commandPanel
Command line panel.


_documentListener

DocumentListener _documentListener
Command line document listener.


_workDirDocumentListener

DocumentListener _workDirDocumentListener
Command line work directory document listener.


_enclosingFileDocumentListener

DocumentListener _enclosingFileDocumentListener
Command line enclosing file document listener.


_dirChooser

protected DirectoryChooser _dirChooser
Directory chooser to open when clicking the "..." button.


_fileChooser

protected FileChooser _fileChooser
File chooser to open when clicking the "..." button.


_insertVarDialog

protected InsertVariableDialog _insertVarDialog
Dialog to insert variables.


_insertVarDialogMonitor

protected CompletionMonitor _insertVarDialogMonitor
Completion monitor to simulate modal behavior.


_cm

private CompletionMonitor _cm
Completion monitor to tell the calling dialog that we're done. Only used if _editMode is true.


_mainFrame

protected MainFrame _mainFrame
Main frame.


_lastState

protected ExecuteExternalDialog.FrameState _lastState
Last frame state. It can be stored and restored.


_editMode

protected boolean _editMode
Edit mode if true.


_editIndex

protected int _editIndex
Index of the saved external process being edited if _editMode is true.


_props

protected PropertyMaps _props
PropertyMaps used for substitution when replacing variables.


STALE_TOOLTIP

public static final String STALE_TOOLTIP
See Also:
Constant Field Values

CANCEL

protected final Runnable1<WindowEvent> CANCEL
Runnable that calls _cancel.

Constructor Detail

ExecuteExternalDialog

public ExecuteExternalDialog(MainFrame mf,
                             boolean editMode,
                             int editIndex,
                             CompletionMonitor cm)
Create a dialog.

Parameters:
mf - the instance of mainframe to query into the project
editMode - true if a saved external process is edited
editIndex - index of the saved external processes to edit
cm - completion monitor telling the calling dialog that we are done

ExecuteExternalDialog

public ExecuteExternalDialog(MainFrame mf)
Create a dialog with the "Run" button.

Parameters:
mf - the instance of mainframe to query into the project
Method Detail

getFrameState

public ExecuteExternalDialog.FrameState getFrameState()
Returns the last state of the frame, i.e. the location and dimension.

Returns:
frame state

setFrameState

public void setFrameState(ExecuteExternalDialog.FrameState ds)
Sets state of the frame, i.e. the location and dimension of the frame for the next use.

Parameters:
ds - State to update to, or null to reset

setFrameState

public void setFrameState(String s)
Sets state of the frame, i.e. the location and dimension of the frame for the next use.

Parameters:
s - State to update to, or null to reset

initComponents

private void initComponents()
Build the dialog.


makeCommandPane

private JPanel makeCommandPane()

colorVariables

protected void colorVariables(JTextPane pane,
                              PropertyMaps props,
                              DocumentListener dl,
                              SimpleAttributeSet normal,
                              SimpleAttributeSet variable,
                              SimpleAttributeSet error)
Color properties as variables.

Parameters:
pane - the pane that contains the text
props - the properties to color

_cancel

private void _cancel()
Method that handels the Cancel button


runCommand

public ExternalProcessPanel runCommand(String name,
                                       String cmdline,
                                       String workdir,
                                       String enclosingFile,
                                       PropertyMaps pm)
Run a command and return an external process panel.

Parameters:
name - name of the process
cmdline - the command line to execute, before evaluation
workdir - the work directory, before evaluation
enclosingFile - the enclosing .djapp JAR file, or "" if not enclosed
pm - PropertyMaps used for substitution when replacing variables
Returns:
ExternalProcessPanel that displays the output of the process

_runCommand

private void _runCommand()
Execute the command line.


_saveCommand

private void _saveCommand()
Save the command line to the menu.


addToMenu

public static int addToMenu(String name,
                            String cmdline,
                            String workdir,
                            String enclosingFile)
Add new process to menu.

Parameters:
name - process name
cmdline - command line
workdir - work directory
enclosingFile - the enclosing .djapp JAR file, or "" if not enclosed
Returns:
number of processes in the menu

editInMenu

public static void editInMenu(int editIndex,
                              String name,
                              String cmdline,
                              String workdir,
                              String enclosingFile)
Edit existing process in menu.

Parameters:
editIndex - the index of the process to edit
name - process name
cmdline - command line
workdir - work directory
enclosingFile - the enclosing .djapp JAR file, or "" if not enclosed

saveToFile

public static void saveToFile(int index,
                              File f)
Save process to file.

Parameters:
index - index of the process to save
f - file

_saveSettings

private boolean _saveSettings()
Save the settings for this dialog.


_insertVariableCommand

private void _insertVariableCommand()
Insert a variable into the command line.


setVisible

public void setVisible(boolean vis)
Toggle visibility of this frame. Warning, it behaves like a modal dialog.

Overrides:
setVisible in class Window

chooseDir

protected void chooseDir(JTextPane pane)
Opens the file chooser to select a directory, putting the result in the file field.


chooseFile

protected void chooseFile(JTextPane pane)
Opens the file chooser to select a file, putting the result in the file field.