Package adams.gui.goe
Class AbstractAdvancedScriptEditorWithTemplates
- java.lang.Object
-
- java.beans.PropertyEditorSupport
-
- adams.gui.goe.AbstractPropertyEditorSupport
-
- adams.gui.goe.AbstractAdvancedScriptEditor
-
- adams.gui.goe.AbstractAdvancedScriptEditorWithTemplates
-
- All Implemented Interfaces:
HelpProvider
,CustomStringRepresentationHandler
,InlineEditorSupport
,PropertyEditor
- Direct Known Subclasses:
GroovyScriptEditor
,XSLTScriptEditor
public abstract class AbstractAdvancedScriptEditorWithTemplates extends AbstractAdvancedScriptEditor
Ancestor for script editors that support text templates.- Version:
- $Revision: 9417 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description static String
FILENAME
the name of the props file.protected static Properties
m_Properties
the general properties.-
Fields inherited from class adams.gui.goe.AbstractAdvancedScriptEditor
m_TextStatement
-
Fields inherited from class adams.gui.goe.AbstractPropertyEditorSupport
APPROVE_OPTION, CANCEL_OPTION, EMPTY, m_ChosenOption, m_CustomEditor, m_WindowAdapter, NULL
-
-
Constructor Summary
Constructors Constructor Description AbstractAdvancedScriptEditorWithTemplates()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addAdditionalMenuItems(JPopupMenu menu)
Hook-method to add further menu items to the menu of the "..." button.protected abstract String
getKey()
Returns the key in the props file to retrieve.static Properties
getProperties()
Returns the properties that define the editor.protected String[]
getTemplates()
Returns the templates to display.protected String
loadTemplate(String name)
Loads the template.-
Methods inherited from class adams.gui.goe.AbstractAdvancedScriptEditor
createCustomEditor, createPopupMenu, fromCustomStringRepresentation, getDefaultSize, getInlineValue, getJavaInitializationString, initForDisplay, isInlineEditingAvailable, isInlineValueValid, paintValue, setInlineValue, toCustomStringRepresentation
-
Methods inherited from class adams.gui.goe.AbstractPropertyEditorSupport
addWindowAdapter, cleanUp, closeDialog, createPopup, createTipText, createWindowAdapter, getChosenOption, getCustomEditor, getHelpDescription, getHelpIcon, getHelpTitle, getHelpURL, getParentDialog, getParentFrame, initialize, isPaintable, resetChosenOption, setValue, supportsCustomEditor
-
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getSource, getTags, getValue, removePropertyChangeListener, setAsText, setSource
-
-
-
-
Field Detail
-
FILENAME
public static final String FILENAME
the name of the props file.- See Also:
- Constant Field Values
-
m_Properties
protected static Properties m_Properties
the general properties.
-
-
Method Detail
-
getKey
protected abstract String getKey()
Returns the key in the props file to retrieve.- Returns:
- the key
-
getTemplates
protected String[] getTemplates()
Returns the templates to display.- Returns:
- the template file names
-
loadTemplate
protected String loadTemplate(String name)
Loads the template.- Parameters:
name
- the resource name- Returns:
- the template content, null in case of error
-
addAdditionalMenuItems
protected void addAdditionalMenuItems(JPopupMenu menu)
Hook-method to add further menu items to the menu of the "..." button.
Adds the templates, if any to the menu.- Overrides:
addAdditionalMenuItems
in classAbstractAdvancedScriptEditor
- Parameters:
menu
- the popup menu for the button
-
getProperties
public static Properties getProperties()
Returns the properties that define the editor.- Returns:
- the properties
-
-