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:
ConfigChangeListener,ScriptConstants,ClipboardOwner,ComponentListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants,Modifiable
public abstract class AbstractScriptEditor
extends RmaJFrame
implements ScriptConstants, 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 RmaJTextFieldprotected RmaJColorButtonprotected JButtonprotected JPanelprotected JMenuItemprotected JMenuItemprotected JMenuItemprotected RmaJTextAreaprotected RmaJCheckBoxprotected RmaJCheckBoxprotected RmaJCheckBoxprotected JButtonprotected JButtonprotected booleanprotected JMenuItemprotected booleanprotected JMenuprotected RmaJTextFieldprotected FindDialogprotected JMenuItemprotected JMenuItemprotected JPopupMenuprotected RmaJComboBoxprotected JLabelprotected JSplitPaneprotected RmaJComboBoxprotected static Vectorprotected JMenuItemprotected RmaJTextFieldprotected RmaJTextFieldprotected EventListenerListprotected LineNumberPanelprotected RmaJTextFieldprotected Stringprotected RmaJTextFieldprotected JPanelprotected JMenuItemprotected JPopupMenuprotected ButtonCmdPanelprotected booleanprotected JMenuItemprotected RmaJTextFieldprotected booleanprotected JMenuItemprotected JButtonprotected JMenuItemprotected booleanprotected RmaJTextFieldprotected AbstractScriptEditor.ScriptTextAreaprotected intprotected RmaJTextFieldprotected JButtonprotected JMenuItemprotected 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(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.voida 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(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
-
_fileNameText
-
_argumentText
-
_descriptionText
-
_scriptText
-
_hSplitter
-
_displayScript
-
_displayScriptInMenu
-
_displayScriptInSelector
-
_labelDisplayText
-
_browseButton
-
_nodePopup
-
_folderPopup
-
_fileMenu
-
_newMenuItem
-
_editMenuItem
-
_importMenuItem
-
_saveMenuItem
-
_saveAsMenuItem
-
_deleteMenuItem
-
_testMenuItem
-
_cutScriptMenuItem
-
_copyScriptMenuItem
-
_pasteScriptMenuItem
-
_findMenuItem
-
_findNextMenuItem
-
_treeSelectListener
-
_statusLine
-
_modifiedField
-
_lockedField
-
_insertField
-
_positionField
-
_iconCombo
-
_buttonPanel
-
_testPanel
-
_okPanel
-
_editButton
-
_editExternalButton
-
_saveButton
-
_testButton
-
_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
-
_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 -
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 classRmaJFrame
-
finalize
-
getScriptManager
-
isScriptableNode
-
setEditPanelEnabled
protected void setEditPanelEnabled(boolean b) -
treePathSelected
-
setEditScript
protected boolean setEditScript(boolean edit) -
lockScriptFile
-
expandTree
protected void expandTree(boolean expand) -
configFileChanged
a config file changed.- Specified by:
configFileChangedin interfaceConfigChangeListener
-
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 interfaceModifiable- Overrides:
setModifiedin classRmaJFrame
-
createImageList
-
fireScriptAdded
-
fireScriptDeleted
-
fireScriptChanged
-
fireScriptEvent
-
addScriptEventListener
-
removeScriptEventListener
-
lostOwnership
- Specified by:
lostOwnershipin interfaceClipboardOwner
-