public abstract class PropertyEditorSupport<T> extends PropertyEditorSupport implements PropertyEditor<T>
Constructor and Description |
---|
PropertyEditorSupport(Class<T> type)
Creates PropertyEditorSupport instance.
|
PropertyEditorSupport(Class<T> type,
Object source)
Creates PropertyEditorSupport instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener) |
void |
addPropertyChangeListener(PropertyChangeListener<T> listener)
Adds a listener for the value change.
|
void |
firePropertyChange(T oldValue,
T newValue) |
String |
getAsText()
Gets the property value as text.
|
protected Class<T> |
getType() |
T |
getValue()
Gets the property value.
|
void |
removePropertyChangeListener(PropertyChangeListener listener) |
void |
removePropertyChangeListener(PropertyChangeListener<T> listener)
Removes a listener for the value change.
|
abstract void |
setAsText(String text)
Set the property value by parsing a given String.
|
void |
setValue(Object value)
Set (or change) the object that is to be edited.
|
firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, isPaintable, paintValue, setSource, supportsCustomEditor
public PropertyEditorSupport(Class<T> type)
public void addPropertyChangeListener(PropertyChangeListener<T> listener)
PropertyEditor
PropertyChangeEvent
on all registered PropertyChangeListener
s,
specifying the null
value for the property name
and itself as the source.listener
- the PropertyChangeListener
to addpublic void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface PropertyEditor
addPropertyChangeListener
in class PropertyEditorSupport
public String getAsText()
PropertyEditor
getAsText
in interface PropertyEditor
getAsText
in class PropertyEditorSupport
Returns null if the value can't be expressed as an editable string.
If a non-null value is returned, then the PropertyEditor should be prepared to parse that string back in setAsText().
public T getValue()
PropertyEditor
getValue
in interface PropertyEditor
getValue
in class PropertyEditorSupport
public void removePropertyChangeListener(PropertyChangeListener<T> listener)
PropertyEditor
listener
- the PropertyChangeListener
to removepublic void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in interface PropertyEditor
removePropertyChangeListener
in class PropertyEditorSupport
public void setValue(Object value)
PropertyEditor
setValue
in interface PropertyEditor
setValue
in class PropertyEditorSupport
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.public abstract void setAsText(String text) throws IllegalArgumentException
PropertyEditor
setAsText
in interface PropertyEditor
setAsText
in class PropertyEditorSupport
text
- The string to be parsed.IllegalArgumentException
Copyright © 2014 JBoss by Red Hat. All rights reserved.