Package adams.gui.goe
Class VariableNameValuePairEditor
- java.lang.Object
-
- java.beans.PropertyEditorSupport
-
- adams.gui.goe.AbstractPropertyEditorSupport
-
- adams.gui.goe.BaseObjectEditor
-
- adams.gui.goe.VariableNameValuePairEditor
-
- All Implemented Interfaces:
HelpProvider,CustomStringRepresentationHandler,InlineEditorSupport,InlineEditorSupportWithFavorites,MultiSelectionEditor,PropertyEditor
public class VariableNameValuePairEditor extends BaseObjectEditor implements MultiSelectionEditor
Editor specifically designed for entering variable name/value pairs.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected Colorm_DefaultBackgroundthe default background color of the panel.protected ParameterPanelm_PanelPairthe panel with name/value.protected JTextComponentm_TextNameThe text field with the key.-
Fields inherited from class adams.gui.goe.BaseObjectEditor
m_ButtonHelp, m_TextValue
-
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 VariableNameValuePairEditor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidacceptInput()Accepts the input and closes the dialog.protected JComponentcreateCustomEditor()Gets the custom editor component.protected StringcurrentValue()ObjectfromCustomStringRepresentation(String str)Returns an object created from the custom string representation.Object[]getSelectedObjects(Container parent)Returns the selected objects.protected StringgetStringToPaint()Returns the string to paint.protected voidindicateValidity()Updates the color of the border, indicating with RED if the input is invalid.protected voidinitForDisplay()Initializes the display of the value.StringtoCustomStringRepresentation(Object obj)Returns a custom string representation of the object.-
Methods inherited from class adams.gui.goe.BaseObjectEditor
discardInput, getHelpDescription, getInlineFavoritesClass, getInlineValue, getJavaInitializationString, isInlineEditingAvailable, isInlineFavoritesEnabled, isInlineValueValid, isUnchanged, isValid, paintValue, parse, setInlineValue
-
Methods inherited from class adams.gui.goe.AbstractPropertyEditorSupport
addWindowAdapter, cleanUp, closeDialog, createPopup, createTipText, createWindowAdapter, getChosenOption, getCustomEditor, 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
-
m_TextName
protected JTextComponent m_TextName
The text field with the key.
-
m_PanelPair
protected ParameterPanel m_PanelPair
the panel with name/value.
-
m_DefaultBackground
protected Color m_DefaultBackground
the default background color of the panel.
-
-
Method Detail
-
currentValue
protected String currentValue()
-
acceptInput
protected void acceptInput()
Accepts the input and closes the dialog.- Overrides:
acceptInputin classBaseObjectEditor
-
createCustomEditor
protected JComponent createCustomEditor()
Gets the custom editor component.- Overrides:
createCustomEditorin classBaseObjectEditor- Returns:
- the editor
-
indicateValidity
protected void indicateValidity()
Updates the color of the border, indicating with RED if the input is invalid.
-
initForDisplay
protected void initForDisplay()
Initializes the display of the value.- Overrides:
initForDisplayin classBaseObjectEditor
-
getStringToPaint
protected String getStringToPaint()
Returns the string to paint.- Overrides:
getStringToPaintin classBaseObjectEditor- Returns:
- the string
- See Also:
BaseObjectEditor.paintValue(Graphics, Rectangle)
-
toCustomStringRepresentation
public String toCustomStringRepresentation(Object obj)
Returns a custom string representation of the object.- Specified by:
toCustomStringRepresentationin interfaceCustomStringRepresentationHandler- Overrides:
toCustomStringRepresentationin classBaseObjectEditor- Parameters:
obj- the object to turn into a string- Returns:
- the string representation
-
fromCustomStringRepresentation
public Object fromCustomStringRepresentation(String str)
Returns an object created from the custom string representation.- Specified by:
fromCustomStringRepresentationin interfaceCustomStringRepresentationHandler- Overrides:
fromCustomStringRepresentationin classBaseObjectEditor- Parameters:
str- the string to turn into an object- Returns:
- the object
-
getSelectedObjects
public Object[] getSelectedObjects(Container parent)
Returns the selected objects.- Specified by:
getSelectedObjectsin interfaceMultiSelectionEditor- Overrides:
getSelectedObjectsin classBaseObjectEditor- Parameters:
parent- the parent container- Returns:
- the objects
-
-