Package org.jppf.ui.options
Class FormattedNumberOption
java.lang.Object
org.jppf.ui.options.AbstractOptionProperties
org.jppf.ui.options.AbstractOptionElement
org.jppf.ui.options.AbstractOption
org.jppf.ui.options.FormattedNumberOption
- All Implemented Interfaces:
Serializable,Option,OptionElement,OptionProperties
Option class for numbers formatted using a pattern, as defined in class
DecimalFormat.- Author:
- Laurent Cohen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JLabelLabel associated with the formatted field.protected StringThe pattern that defines the field format.Fields inherited from class org.jppf.ui.options.AbstractOption
listeners, persistent, valueFields inherited from class org.jppf.ui.options.AbstractOptionElement
parent, rootFields inherited from class org.jppf.ui.options.AbstractOptionProperties
bordered, componentConstraints, detachable, eventsEnabled, finalizer, horizontalScrollbar, iconPath, initializer, label, layoutConstraints, mouseListener, name, scripts, scrollable, toolTipText, UIComponent, verticalScrollbar -
Constructor Summary
ConstructorsConstructorDescriptionConstructor provided as a convenience to facilitate the creation of option elements through reflexion.Initialize this text option with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected JFormattedTextFieldCreate the text field that holds the value of this password option.voidcreateUI()Create the UI components for this option.Get the pattern that defines the field format.getValue()Get the value of the edited number.voidsetEditable(boolean editable) Enable or disable this option.voidsetEnabled(boolean enabled) Enable or disable this option.voidsetPattern(String pattern) Set the pattern that defines the field format.protected voidAdd a listener to the underlying text document, to receive and propagate change events.voidSet the value of this option.Methods inherited from class org.jppf.ui.options.AbstractOption
addValueChangeListener, fireValueChanged, isPersistent, layoutComponents, layoutComponents, removeValueChangeListener, setPersistent, toStringMethods inherited from class org.jppf.ui.options.AbstractOptionElement
findAll, findAllWithName, findElement, findFirstWithName, findLastWithName, getChildForName, getParent, getPath, getRoot, getStringPath, setParentMethods inherited from class org.jppf.ui.options.AbstractOptionProperties
createScrollPane, getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getMouseListener, getName, getScripts, getToolTipText, getUIComponent, isBordered, isDetachable, isEventsEnabled, isHorizontalScrollbar, isScrollable, isVerticalScrollbar, setBordered, setComponentConstraints, setDetachable, setEventsEnabled, setFinalizer, setHorizontalScrollbar, setIconPath, setInitializer, setLabel, setLayoutConstraints, setMouseListener, setName, setScrollable, setToolTipText, setUIComponent, setVerticalScrollbarMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jppf.ui.options.OptionElement
findAllWithName, findElement, findFirstWithName, findLastWithName, getParent, getPath, getRoot, getStringPathMethods inherited from interface org.jppf.ui.options.OptionProperties
getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getMouseListener, getName, getScripts, getToolTipText, getUIComponent, isBordered, isDetachable, isEventsEnabled, isScrollable, setComponentConstraints, setEventsEnabled, setLayoutConstraints, setMouseListener
-
Field Details
-
fieldLabel
Label associated with the formatted field. -
pattern
The pattern that defines the field format.
-
-
Constructor Details
-
FormattedNumberOption
public FormattedNumberOption()Constructor provided as a convenience to facilitate the creation of option elements through reflexion. -
FormattedNumberOption
public FormattedNumberOption(String name, String label, String tooltip, Number value, String pattern) Initialize this text option with the specified parameters.- Parameters:
name- this component's name.label- the label displayed with the text field.tooltip- the tooltip associated with the text field.value- the initial value of this component.pattern- the pattern defining the format of the number used as value.- See Also:
-
-
Method Details
-
createUI
public void createUI()Create the UI components for this option.- Specified by:
createUIin classAbstractOptionProperties
-
createField
Create the text field that holds the value of this password option.- Returns:
- a
JPasswordFieldinstance. - See Also:
-
getValue
Get the value of the edited number.- Specified by:
getValuein interfaceOption- Overrides:
getValuein classAbstractOption- Returns:
- the value of the formatted text field as a
Number. - See Also:
-
setValue
Set the value of this option.- Overrides:
setValuein classAbstractOption- Parameters:
value- the value as anObjectinstance.- See Also:
-
setupValueChangeNotifications
protected void setupValueChangeNotifications()Add a listener to the underlying text document, to receive and propagate change events.- Specified by:
setupValueChangeNotificationsin classAbstractOption- See Also:
-
setEnabled
public void setEnabled(boolean enabled) Enable or disable this option.- Parameters:
enabled- true to enable this option, false to disable it.- See Also:
-
getPattern
Get the pattern that defines the field format.- Returns:
- the pattern as a string.
-
setPattern
Set the pattern that defines the field format.- Parameters:
pattern- the pattern as a string.
-
setEditable
public void setEditable(boolean editable) Enable or disable this option.- Specified by:
setEditablein interfaceOptionProperties- Overrides:
setEditablein classAbstractOptionProperties- Parameters:
editable- true to make this option editable, false otherwise.
-