Package org.jppf.ui.options
Class AbstractOption
java.lang.Object
org.jppf.ui.options.AbstractOptionProperties
org.jppf.ui.options.AbstractOptionElement
org.jppf.ui.options.AbstractOption
- All Implemented Interfaces:
Serializable,Option,OptionElement,OptionProperties
- Direct Known Subclasses:
AbstractTreeTableOption,BooleanOption,ButtonOption,CodeEditorOption,ComboBoxOption,FileChooserOption,FillerOption,FormattedNumberOption,GraphOption,JavaOption,LabelOption,ListOption,PickListOption,PluggableViewOption,RadioButtonOption,SpinnerNumberOption,TextAreaOption,TextOption,ToolbarSeparatorOption
Default abstract implementation of the
Option interface.- Author:
- Laurent Cohen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<ValueChangeListener>List of listeners that are notified when the value of this option changes.protected booleanDetermines whether the value of this option should be saved in the user preferences.protected ObjectThe value of this option.Fields 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. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddValueChangeListener(ValueChangeListener listener) Add a value change listener to this option's list of listeners.voidNotify all registered listeners that the value of this option has changed.getValue()The value of this option.booleanDetermine whether the value of this option should be saved in the user preferences.protected JPanellayoutComponents(JComponent comp1, String constraint1, JComponent comp2, String constraint2) Layout 2 components according to the specified layout constraints.protected JPanellayoutComponents(JComponent comp1, JComponent comp2) Layout 2 components according to the specified layout constraints.voidremoveValueChangeListener(ValueChangeListener listener) Remove a value change listener from this option's list of listeners.voidsetPersistent(boolean persistent) Set whether the value of this option should be saved in the user preferences.protected abstract voidConcrete subclasses should implement this method to properly forward changes in the value edited by the underlying UI component/editor.voidSet the value of this option.toString()Get a string representation of this element.Methods 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, createUI, getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getMouseListener, getName, getScripts, getToolTipText, getUIComponent, isBordered, isDetachable, isEventsEnabled, isHorizontalScrollbar, isScrollable, isVerticalScrollbar, setBordered, setComponentConstraints, setDetachable, setEditable, 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, setEditable, setEnabled, setEventsEnabled, setLayoutConstraints, setMouseListener
-
Field Details
-
value
The value of this option. -
listeners
List of listeners that are notified when the value of this option changes. -
persistent
protected boolean persistentDetermines whether the value of this option should be saved in the user preferences.
-
-
Constructor Details
-
AbstractOption
public AbstractOption()Constructor provided as a convenience to facilitate the creation of option elements through reflexion.
-
-
Method Details
-
getValue
The value of this option. -
setValue
Set the value of this option.- Parameters:
value- the value as anObjectinstance.
-
addValueChangeListener
Add a value change listener to this option's list of listeners.- Parameters:
listener- the listener to add to the list.
-
removeValueChangeListener
Remove a value change listener from this option's list of listeners.- Parameters:
listener- the listener to remove from the list.
-
fireValueChanged
public void fireValueChanged()Notify all registered listeners that the value of this option has changed. -
setupValueChangeNotifications
protected abstract void setupValueChangeNotifications()Concrete subclasses should implement this method to properly forward changes in the value edited by the underlying UI component/editor. -
layoutComponents
Layout 2 components according to the specified layout constraints.- Parameters:
comp1- the first component to layout.comp2- the second component to layout.- Returns:
- a
JPanelinstance, enclosing the 2 components plus the filler.
-
layoutComponents
protected JPanel layoutComponents(JComponent comp1, String constraint1, JComponent comp2, String constraint2) Layout 2 components according to the specified layout constraints.- Parameters:
comp1- the first component to layout.constraint1- the layout constraint for the 1st component.comp2- the second component to layout.constraint2- the layout constraint for the 2nd component.- Returns:
- a
JPanelinstance, enclosing the 2 components plus the filler.
-
isPersistent
public boolean isPersistent()Determine whether the value of this option should be saved in the user preferences.- Specified by:
isPersistentin interfaceOption- Returns:
- true if the value should be saved, false otherwise.
-
setPersistent
public void setPersistent(boolean persistent) Set whether the value of this option should be saved in the user preferences.- Parameters:
persistent- true if the value should be saved, false otherwise.
-
toString
Description copied from class:AbstractOptionElementGet a string representation of this element.- Overrides:
toStringin classAbstractOptionElement- Returns:
- a string providing information about this option element.
- See Also:
-