public class EmptyStringToNullEditor extends Object implements PropertyEditor
EmptyStringToNullEditor is a wrapper for building
PropertyEditors that handle setAsText("") like
setAsText(null).
Wrap the original editor with the EmptyStringToNullEditor
PropertyEditor wrappedEditor = new EmptyStringToNullEditor(originalEditor);When somebody calls
setAsText("") on the wrappedEditor,
then it calls setAsText(null) on the originalEditor. All
other values and all other methods are delegated to the originalEditor.| Constructor and Description |
|---|
EmptyStringToNullEditor(PropertyEditor propertyEditor) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener) |
String |
getAsText() |
Component |
getCustomEditor() |
String |
getJavaInitializationString() |
String[] |
getTags() |
Object |
getValue() |
boolean |
isPaintable() |
void |
paintValue(Graphics gfx,
Rectangle box) |
void |
removePropertyChangeListener(PropertyChangeListener listener) |
void |
setAsText(String text) |
void |
setValue(Object value) |
boolean |
supportsCustomEditor() |
public EmptyStringToNullEditor(PropertyEditor propertyEditor)
public void setValue(Object value)
setValue in interface PropertyEditorpublic Object getValue()
getValue in interface PropertyEditorpublic boolean isPaintable()
isPaintable in interface PropertyEditorpublic void paintValue(Graphics gfx, Rectangle box)
paintValue in interface PropertyEditorpublic String getJavaInitializationString()
getJavaInitializationString in interface PropertyEditorpublic String getAsText()
getAsText in interface PropertyEditorpublic void setAsText(String text) throws IllegalArgumentException
setAsText in interface PropertyEditorIllegalArgumentExceptionpublic String[] getTags()
getTags in interface PropertyEditorpublic Component getCustomEditor()
getCustomEditor in interface PropertyEditorpublic boolean supportsCustomEditor()
supportsCustomEditor in interface PropertyEditorpublic void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener in interface PropertyEditorpublic void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener in interface PropertyEditorCopyright © 2012-2013. All Rights Reserved.