Package adams.gui.goe
Class StringEditor
-
- All Implemented Interfaces:
HelpProvider
,PropertyEditor
public class StringEditor extends AbstractBasicTypePropertyEditor
A custom editor for strings.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_Current
the current value.-
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 StringEditor()
Initializes the editor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getValue()
Gets the property value.protected Object
parse(String text)
Parses the string and returns an object of the correct class.void
setValue(Object value)
Set (or change) the object that is to be edited.-
Methods inherited from class adams.gui.goe.AbstractBasicTypePropertyEditor
createCustomEditor, getAsText, initForDisplay, isPaintable, paintValue, setAsText, toString
-
Methods inherited from class adams.gui.goe.AbstractPropertyEditorSupport
addWindowAdapter, cleanUp, closeDialog, createPopup, createTipText, createWindowAdapter, getChosenOption, getCustomEditor, getHelpDescription, getHelpIcon, getHelpTitle, getHelpURL, getParentDialog, getParentFrame, initialize, resetChosenOption, supportsCustomEditor
-
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getJavaInitializationString, getSource, getTags, removePropertyChangeListener, setSource
-
-
-
-
Field Detail
-
m_Current
protected String m_Current
the current value.
-
-
Method Detail
-
setValue
public void setValue(Object value)
Set (or change) the object that is to be edited. Primitive types such as "int" must be wrapped as the corresponding object type such as "java.lang.String".- Specified by:
setValue
in interfacePropertyEditor
- Overrides:
setValue
in classAbstractPropertyEditorSupport
- Parameters:
value
- The new target object to be edited. Note that this object should not be modified by the PropertyEditor, rather the PropertyEditor should create a new object to hold any modified value.
-
getValue
public Object getValue()
Gets the property value.- Specified by:
getValue
in interfacePropertyEditor
- Overrides:
getValue
in classPropertyEditorSupport
- Returns:
- The value of the property. Primitive types such as "int" will be wrapped as the corresponding object type such as "java.lang.String".
-
parse
protected Object parse(String text) throws IllegalArgumentException
Parses the string and returns an object of the correct class.- Specified by:
parse
in classAbstractBasicTypePropertyEditor
- Parameters:
text
- the string to parse- Returns:
- the generated object
- Throws:
IllegalArgumentException
- if parsing fails
-
-