class NumberEditor extends AbstractBasicEditorProvider implements java.beans.PropertyChangeListener
This uses a JSpinner to change the value.
| Modifier and Type | Field and Description |
|---|---|
protected javax.swing.JComponent |
editor
The editor, either the spinner or the field.
|
protected javax.swing.JFormattedTextField |
field
Field used to display and set the property.
|
protected SwingNumberProperty |
propertySwing
The property holding the number.
|
protected javax.swing.JSpinner |
spinner
Spinner used to display and set the property.
|
| Constructor and Description |
|---|
NumberEditor(SwingNumberProperty propertySwing,
java.util.Locale l,
boolean autoSave)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
javax.swing.JComponent |
getEditor()
Get an component for editing .
|
void |
goodBye()
Called when the editor provider is no longer used.
|
void |
propertyChange(java.beans.PropertyChangeEvent evt)
This method gets called when a bound propertySwing is changed.
|
void |
reset()
Reset the value in the editor to the basic value.
|
void |
save()
Set the basic value from the editor.
|
getDescription, getLabel, getLabelText, getLabelTextWithPunctuation, getTitleText, getToolTipText, isValidValue@Nullable protected final javax.swing.JSpinner spinner
@Nullable protected final javax.swing.JFormattedTextField field
@NotNull protected final javax.swing.JComponent editor
@NotNull protected final SwingNumberProperty propertySwing
public NumberEditor(@NotNull SwingNumberProperty propertySwing, java.util.Locale l, boolean autoSave)
propertySwing - property to handlel - current localeautoSave - save changes immediately?@NotNull public javax.swing.JComponent getEditor()
getEditor in interface EditorProviderpublic void reset()
reset in interface EditorProviderpublic void save()
save in interface EditorProviderpublic void goodBye()
goodBye in interface EditorProviderpublic void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange in interface java.beans.PropertyChangeListenerevt - A PropertyChangeEvent object describing the event source
and the propertySwing that has changed.