com.isti.util.propertyeditor
Class StringPropertyEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by com.isti.util.propertyeditor.AbstractPropertyEditor
          extended by com.isti.util.propertyeditor.StringPropertyEditor
All Implemented Interfaces:
java.beans.PropertyEditor
Direct Known Subclasses:
NonEditablePropertyEditor

public class StringPropertyEditor
extends AbstractPropertyEditor

A PropertyEditor for a string.


Field Summary
protected  javax.swing.JTextField textField
          The GUI component of this editor.
 
Constructor Summary
StringPropertyEditor()
          Create the PropertyEditor for a string.
StringPropertyEditor(javax.swing.JTextField textField)
          Create the PropertyEditor for a string.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
          Adds an ActionListener to the button.
 java.lang.String getAsText()
          Returns value as a String.
 java.awt.Component getCustomEditor()
          Returns the editor GUI.
 java.lang.Object getValue()
          Returns value.
 void removeActionListener(java.awt.event.ActionListener l)
          Removes an ActionListener from the button.
 void setAsText(java.lang.String text)
          Sets value as text.
 void setValue(java.lang.Object someObj)
          Sets value.
 boolean supportsCustomEditor()
          Determines whether the propertyeditor can provide a custom editor.
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getJavaInitializationString, getSource, getTags, isPaintable, paintValue, removePropertyChangeListener, setSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

textField

protected final javax.swing.JTextField textField
The GUI component of this editor.

Constructor Detail

StringPropertyEditor

public StringPropertyEditor()
Create the PropertyEditor for a string.


StringPropertyEditor

public StringPropertyEditor(javax.swing.JTextField textField)
Create the PropertyEditor for a string.

Parameters:
textField - the text field.
Method Detail

supportsCustomEditor

public boolean supportsCustomEditor()
Determines whether the propertyeditor can provide a custom editor.

Specified by:
supportsCustomEditor in interface java.beans.PropertyEditor
Overrides:
supportsCustomEditor in class java.beans.PropertyEditorSupport
Returns:
true

getCustomEditor

public java.awt.Component getCustomEditor()
Returns the editor GUI.

Specified by:
getCustomEditor in interface java.beans.PropertyEditor
Overrides:
getCustomEditor in class java.beans.PropertyEditorSupport
Returns:
component for editor.

setValue

public void setValue(java.lang.Object someObj)
Sets value.

Specified by:
setValue in interface java.beans.PropertyEditor
Overrides:
setValue in class java.beans.PropertyEditorSupport
Parameters:
someObj - value

setAsText

public void setAsText(java.lang.String text)
Sets value as text.

Specified by:
setAsText in interface java.beans.PropertyEditor
Overrides:
setAsText in class java.beans.PropertyEditorSupport
Parameters:
text - value

getValue

public java.lang.Object getValue()
Returns value.

Specified by:
getValue in interface java.beans.PropertyEditor
Overrides:
getValue in class java.beans.PropertyEditorSupport
Returns:
the value

getAsText

public java.lang.String getAsText()
Returns value as a String.

Specified by:
getAsText in interface java.beans.PropertyEditor
Overrides:
getAsText in class java.beans.PropertyEditorSupport
Returns:
the value as a string

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Adds an ActionListener to the button.

Specified by:
addActionListener in class AbstractPropertyEditor
Parameters:
l - the ActionListener to be added

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
Removes an ActionListener from the button. If the listener is the currently set Action for the button, then the Action is set to null.

Specified by:
removeActionListener in class AbstractPropertyEditor
Parameters:
l - the listener to be removed