|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.beans.PropertyEditorSupport
public class PropertyEditorSupport
PropertyEditorSupport helps with PropertyEditors, implementing base functionality that they usually must have but which is a pain to implement. You may extend from this class or use it as a standalone.
This class does not do any painting or actual editing. For that, you must use or extend it. See the PropertyEditor class for better descriptions of what the various methods do.
Constructor Summary | |
---|---|
PropertyEditorSupport()
Call this constructor when you are deriving from PropertyEditorSupport. |
|
PropertyEditorSupport(Object source)
Call this constructor when you are using PropertyEditorSupport as a helper object. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
Adds a property change listener to this property editor. |
void |
firePropertyChange()
Notifies people that we've changed, although we don't tell them just how. |
String |
getAsText()
Gets the value as text. |
Component |
getCustomEditor()
Returns a custom component to edit the value. |
String |
getJavaInitializationString()
Gets the Java initialization String for the current value of the Object. |
Object |
getSource()
Returns the bean that is used as the source of events. |
String[] |
getTags()
Returns a list of possible choices for the value. |
Object |
getValue()
Gets the current value of the property. |
boolean |
isPaintable()
Gets whether this object is paintable or not. |
void |
paintValue(Graphics g,
Rectangle r)
Paints this object. |
void |
removePropertyChangeListener(PropertyChangeListener l)
Removes a property change listener from this property editor. |
void |
setAsText(String s)
Sets the value as text. |
void |
setSource(Object source)
Sets the bean that is used as the source of events when property changes occur. |
void |
setValue(Object newValue)
Sets the current value of the property and a property change event is fired to all registered PropertyChangeListener instances. |
boolean |
supportsCustomEditor()
Finds out whether this property editor supports a custom component to edit its value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyEditorSupport()
public PropertyEditorSupport(Object source)
source
is null
,
for compatibility reasons with J2SDK 1.5.0 .
source
- The source to use when firing
property change events.Method Detail |
---|
public void setValue(Object newValue)
setValue
in interface PropertyEditor
newValue
- The new value for the property.public Object getValue()
getValue
in interface PropertyEditor
public boolean isPaintable()
isPaintable
in interface PropertyEditor
false
public void paintValue(Graphics g, Rectangle r)
paintValue
in interface PropertyEditor
g
- the Graphics context to paint onr
- the rectangle you have reserved to work inpublic String getJavaInitializationString()
Implementation Note: This class returns the string "@$#^" to make sure the code will be broken, so that you will know to override it when you create your own property editor.
getJavaInitializationString
in interface PropertyEditor
public String getAsText()
getAsText
in interface PropertyEditor
public void setAsText(String s) throws IllegalArgumentException
setAsText
in interface PropertyEditor
s
- the text to convert to a new value.
IllegalArgumentException
- if the text is
malformed.public String[] getTags()
getTags
in interface PropertyEditor
null
public Component getCustomEditor()
getCustomEditor
in interface PropertyEditor
null
in this class.public boolean supportsCustomEditor()
supportsCustomEditor
in interface PropertyEditor
false
in this class.public void addPropertyChangeListener(PropertyChangeListener l)
addPropertyChangeListener
in interface PropertyEditor
l
- the listener to add.public void removePropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener
in interface PropertyEditor
l
- the listener to remove.public void firePropertyChange()
public Object getSource()
public void setSource(Object source)
PropertyEditor
.
source
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |