Package hec.script
Class AbstractScriptEditor
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
rma.swing.RmaJFrame
hec.script.AbstractScriptEditor
- All Implemented Interfaces:
hec.event.ConfigChangeListener,ScriptConstants,ClipboardOwner,ComponentListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants,rma.lang.Modifiable
public abstract class AbstractScriptEditor
extends rma.swing.RmaJFrame
implements ScriptConstants, hec.event.ConfigChangeListener, ClipboardOwner
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classTitle: General CWMS Projectclassinner class for folder nodesclassTextArea class that will set it's background to light gray when disabled.classinner class for the Tree ModelclassNested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrameNested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrameNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected rma.swing.RmaJTextFieldprotected rma.swing.RmaJColorButtonprotected JButtonprotected JPanelprotected JMenuItemprotected JMenuItemprotected JMenuItemprotected rma.swing.RmaJTextAreaprotected rma.swing.RmaJCheckBoxprotected rma.swing.RmaJCheckBoxprotected rma.swing.RmaJCheckBoxprotected JButtonprotected JButtonprotected booleanprotected JMenuItemprotected booleanprotected JMenuprotected rma.swing.RmaJTextFieldprotected rma.swing.FindDialogprotected JMenuItemprotected JMenuItemprotected JPopupMenuprotected rma.swing.RmaJComboBoxprotected JLabelprotected JSplitPaneprotected rma.swing.RmaJComboBoxprotected static Vectorprotected JMenuItemprotected rma.swing.RmaJTextFieldprotected rma.swing.RmaJTextFieldprotected EventListenerListprotected LineNumberPanelprotected rma.swing.RmaJTextFieldprotected Stringprotected rma.swing.RmaJTextFieldprotected JPanelprotected JMenuItemprotected JPopupMenuprotected rma.swing.ButtonCmdPanelprotected booleanprotected JMenuItemprotected rma.swing.RmaJTextFieldprotected booleanprotected JMenuItemprotected JButtonprotected JMenuItemprotected booleanprotected rma.swing.RmaJTextFieldprotected AbstractScriptEditor.ScriptTextAreaprotected intprotected rma.swing.RmaJTextFieldprotected JButtonprotected JMenuItemprotected rma.swing.ButtonCmdPanelprotected TreeSelectionListenerprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected JTreeFields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabledFields 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_CURSORFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface hec.script.ScriptConstants
ALL_MODULES, ALL_WORKSPACES, BASE, CACHE_DIR_PROP, CLIENT_MODULE, CURRENT_MODULES, CURRENT_WORKSPACE, DSS_IMPORT, JAVA_IMPORT, ROOT, SCRIPT_ZIPFILE, SCRIPTS_CONF, SCRIPTS_DIR, STD_IMPORT, SYSTEM, USERFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddScriptableObjects(AbstractScriptEditor.FolderNode parentNode, ScriptableObject so) recusively add scriptable objectsvoidaddScriptEventListener(hec.event.ScriptEventListener listener) protected voidbuildDialog(Frame parent) protected voidbuild the menus for this dialogprotected ScriptbuildScript(int[] headLines) voidclear out the right panelsprotected voidcalled when the window closes.voidconfigFileChanged(hec.event.ConfigFileChangeEvent event) a config file changed.protected booleanprotected Vectorprotected JTreeprotected voidprotected voiddeleteScript(boolean confirm) protected voiddisplayFolderPopup(MouseEvent e, String name) display the popup for a folderprotected voiddisplayNodePopup(MouseEvent e, String name) display the popup menu for script nodesprotected voideditScript(TreePath path) edit the currently highlighted scriptprotected voidexpandTree(boolean expand) protected abstract voidprotected voidvoidfinalize()protected voidprotected voidprotected voidprotected voidfireScriptEvent(ScriptIdentifier sid, int eventType) voidprotected abstract StringgetFileName(String name) protected TreeNodeprotected Stringreturn the path to the last folder in the selected pathprotected StringgetModulePath(TreePath tpath) return the path to the last folder in the TreePath pathprotected StringgetScriptId(TreePath tpath) return the Id that can be used to identify the object that the script belongs toprotected voidgetScriptIds(String pathStr, DefaultMutableTreeNode folderNode) protected voidgetScriptIds(TreePath path) protected abstract ScriptManagerprotected ScriptIdentifierDataprotected ScriptIdentifierreturns the selected ScriptIdentifierprotected ScriptIdentifierreturn the ScriptIdentifier to the last folder in the TreePath pathprotected static Colorabstract voidimport a scriptprotected booleanisScriptableNode(String nodeName) protected booleanprotected voidlaunchExternalEditor(TreePath path) protected voidloadScript(TreePath path) protected abstract booleanlockScriptFile(boolean lock, String path) voidlostOwnership(Clipboard clipboard, Transferable contents) protected voidprotected booleanclear form for new scriptprotected voidvoidprotected voidvoidvoidremoveScriptEventListener(hec.event.ScriptEventListener listener) protected voidremoveScriptsFromGroup(ScriptGroup group2Delete) remove the group setting from all the scriptsbooleanprotected abstract voidsaveBackgroundColor(String color) protected abstract voidprotected abstract voidsaveForegroundColor(String color) protected voidprotected voidprotected abstract voidprotected abstract voidsaveTabSize(int tabsize) protected voidprotected voidprotected voidprotected abstract voidselectScript(TreePath path) allow the user to select a scriptprotected voidsetEditPanelEnabled(boolean b) protected booleansetEditScript(boolean edit) protected voidsetMenusState(boolean isFolder) voidsetModified(boolean modified) voidset the tree to display the ScriptIdentifier nodevoidsetSelectedNode(String nodeName, String underNodeName) set the tree to display the String nodeprotected voidvoidsetVisible(boolean b) protected voidvoidprotected voidtreePathSelected(TreePath path, TreePath oldPath, boolean enable) protected voidMethods inherited from class rma.swing.RmaJFrame
clearForm, clickButton, clickButton, clickCheckBox, clickRadioButton, componentHidden, componentMoved, componentResized, componentShown, createRootPane, enterKeyPressed, escapeKeyPressed, getDefaultIconImage, getOpenWindows, getTimeZone, getTopWindow, getUnitDisplaySystem, getUnitSystem, getWindow, invokeFormManagementMethod, isEditable, isIgnoringModifiedEvents, isModified, isSystemClosable, registerEnterKey, registerEscapeKey, setComponentsEditable, setComponentsEditable, setDefaultIconImage, setDefaultSize, setDisplayScale, setEditable, setIgnoreModifiedEvents, setLocation, setSystemClosable, setTimeZone, setUnitSystem, stayOpen, updateDisplayScale, updateTimeZone, updateTimeZone, updateUnitSystem, validateComponents, validateComponentsMethods inherited from class javax.swing.JFrame
addImpl, 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, updateMethods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecoratedMethods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, show, toBack, toFrontMethods 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, transferFocusDownCycle, validate, validateTreeMethods 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, 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, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
_iconList
-
NO_ICON
- See Also:
-
FONT_PROP
- See Also:
-
BACKGROUND_PROP
- See Also:
-
FOREGROUND_PROP
- See Also:
-
SIZE_PROP
- See Also:
-
LOCATION_PROP
- See Also:
-
TABSIZE_PROP
- See Also:
-
_lnPanel
-
tree
-
_scriptNameText
protected rma.swing.RmaJTextField _scriptNameText -
_fileNameText
protected rma.swing.RmaJTextField _fileNameText -
_argumentText
protected rma.swing.RmaJTextField _argumentText -
_descriptionText
protected rma.swing.RmaJTextArea _descriptionText -
_scriptText
-
_hSplitter
-
_displayScript
protected rma.swing.RmaJCheckBox _displayScript -
_displayScriptInMenu
protected rma.swing.RmaJCheckBox _displayScriptInMenu -
_displayScriptInSelector
protected rma.swing.RmaJCheckBox _displayScriptInSelector -
_labelDisplayText
protected rma.swing.RmaJTextField _labelDisplayText -
_browseButton
-
_nodePopup
-
_folderPopup
-
_fileMenu
-
_newMenuItem
-
_editMenuItem
-
_importMenuItem
-
_saveMenuItem
-
_saveAsMenuItem
-
_deleteMenuItem
-
_testMenuItem
-
_cutScriptMenuItem
-
_copyScriptMenuItem
-
_pasteScriptMenuItem
-
_findMenuItem
-
_findNextMenuItem
-
_treeSelectListener
-
_statusLine
protected rma.swing.RmaJTextField _statusLine -
_modifiedField
protected rma.swing.RmaJTextField _modifiedField -
_lockedField
protected rma.swing.RmaJTextField _lockedField -
_insertField
protected rma.swing.RmaJTextField _insertField -
_positionField
protected rma.swing.RmaJTextField _positionField -
_iconCombo
protected rma.swing.RmaJComboBox _iconCombo -
_buttonPanel
-
_testPanel
protected rma.swing.ButtonCmdPanel _testPanel -
_okPanel
protected rma.swing.ButtonCmdPanel _okPanel -
_editButton
-
_editExternalButton
-
_saveButton
-
_testButton
-
_findDlg
protected rma.swing.FindDialog _findDlg -
_editingExistingScript
protected boolean _editingExistingScript -
_editScript
protected boolean _editScript -
_resetingPath
protected boolean _resetingPath -
_lockedPath
-
_scriptModified
protected boolean _scriptModified -
_splitterLocation
protected int _splitterLocation -
_overrodeScriptFile
protected boolean _overrodeScriptFile -
_listenerList
-
_namePanel
-
_bgColorBtn
protected rma.swing.RmaJColorButton _bgColorBtn -
_groupCombo
protected rma.swing.RmaJComboBox _groupCombo -
_groupLabel
-
-
Constructor Details
-
AbstractScriptEditor
constructor
-
-
Method Details
-
createJTree
-
buildDialog
-
redrawLineNumbers
protected void redrawLineNumbers() -
getSelectionMarginColor
-
flushScriptManager
public void flushScriptManager() -
buildMenus
protected void buildMenus()build the menus for this dialog -
removeScriptsFromGroup
remove the group setting from all the scripts- Parameters:
group2Delete-
-
showWhiteSpaceAction
protected void showWhiteSpaceAction() -
editScript
edit the currently highlighted script -
launchExternalEditor
-
launchAndWait
-
newScript
protected boolean newScript()clear form for new script -
getLastFolderNode
-
getSelectedScriptIdentifier
returns the selected ScriptIdentifier- Returns:
- the selected ScriptIdentifier
-
getSelectedScriptIdentifier
return the ScriptIdentifier to the last folder in the TreePath path -
getModulePath
return the path to the last folder in the selected path -
getModulePath
return the path to the last folder in the TreePath path -
getScriptId
return the Id that can be used to identify the object that the script belongs to -
saveScript
protected void saveScript() -
saveScriptAs
protected void saveScriptAs() -
buildScript
-
deleteScript
protected void deleteScript(boolean confirm) -
closeFrame
protected void closeFrame()called when the window closes. -
fillFolderNodes
protected abstract void fillFolderNodes() -
addScriptableObjects
protected void addScriptableObjects(AbstractScriptEditor.FolderNode parentNode, ScriptableObject so) recusively add scriptable objects -
updateFileName
protected void updateFileName() -
getFileName
-
clearForm
public void clearForm()clear out the right panels- Overrides:
clearFormin classrma.swing.RmaJFrame
-
getScriptIds
-
getScriptIds
-
fillGroupCombo
protected void fillGroupCombo() -
loadScript
-
setSelectedNode
set the tree to display the String node -
setSelectedNode
set the tree to display the ScriptIdentifier node -
setVisible
public void setVisible(boolean b) - Overrides:
setVisiblein classrma.swing.RmaJFrame
-
finalize
-
getScriptManager
-
isScriptableNode
-
setEditPanelEnabled
protected void setEditPanelEnabled(boolean b) -
treePathSelected
-
setEditScript
protected boolean setEditScript(boolean edit) -
lockScriptFile
-
expandTree
protected void expandTree(boolean expand) -
configFileChanged
public void configFileChanged(hec.event.ConfigFileChangeEvent event) a config file changed.- Specified by:
configFileChangedin interfacehec.event.ConfigChangeListener
-
refreshTree
public void refreshTree() -
cutTreeNode
protected void cutTreeNode() -
copyTreeNode
protected boolean copyTreeNode() -
pasteTreeNode
protected void pasteTreeNode() -
msgOut
-
getScriptToPaste
-
displayFolderPopup
display the popup for a folder -
displayNodePopup
display the popup menu for script nodes -
importScript
public abstract void importScript()import a script -
setMenusState
protected void setMenusState(boolean isFolder) -
selectScript
allow the user to select a script -
selectForeground
protected void selectForeground() -
selectBackground
protected void selectBackground() -
selectFont
protected void selectFont() -
setTabSize
protected void setTabSize() -
saveForegroundColor
-
saveBackgroundColor
-
saveFont
-
saveTabSize
protected abstract void saveTabSize(int tabsize) -
saveSizeAndLocation
protected abstract void saveSizeAndLocation() -
printScript
public void printScript() -
testScript
public void testScript() -
runScript
-
setModified
public void setModified(boolean modified) - Specified by:
setModifiedin interfacerma.lang.Modifiable- Overrides:
setModifiedin classrma.swing.RmaJFrame
-
createImageList
-
fireScriptAdded
-
fireScriptDeleted
-
fireScriptChanged
-
fireScriptEvent
-
addScriptEventListener
public void addScriptEventListener(hec.event.ScriptEventListener listener) -
removeScriptEventListener
public void removeScriptEventListener(hec.event.ScriptEventListener listener) -
lostOwnership
- Specified by:
lostOwnershipin interfaceClipboardOwner
-