org.openbp.jaspira.option
Class OptionWidget

java.lang.Object
  extended by org.openbp.jaspira.option.OptionWidget
Direct Known Subclasses:
CheckBoxWidget, ColorWidget, DoubleWidget, GroupOption.GroupWidget, IntegerSlideWidget, IntegerWidget, MultiCheckBoxWidget, PasswordWidget, PathWidget, PropertyBrowserWidget, RadioWidget, SelectionWidget, TextWidget

public abstract class OptionWidget
extends java.lang.Object

A option widget is a visual representation of an option. It has a visual component that allows display and editing of the option value. If the user edits the option value, an option widget event will be sent.

Author:
Jens Ferchland

Field Summary
protected  Option option
          Option this widget refers to
 
Constructor Summary
OptionWidget(Option option)
          Constructor.
 
Method Summary
protected  javax.swing.JLabel createHeading()
          Creates a label that holds the option heading, if defined.
 javax.swing.JComponent getDescriptionComponent()
          Gets the description component of the option.
 Option getOption()
          Gets the option.
abstract  java.lang.Object getValue()
          Returns the value of the option widget.
abstract  javax.swing.JComponent getWidgetComponent()
          Gets the widget component that visualizes the option.
 void notifyOptionMgrOfOptionChange()
          Notifies the option manager of an option change.
abstract  void setValue(java.lang.Object o)
          Sets the value that will be displayed in the option widget.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

option

protected Option option
Option this widget refers to

Constructor Detail

OptionWidget

public OptionWidget(Option option)
Constructor.

Parameters:
option - Option this widget refers to
Method Detail

getOption

public Option getOption()
Gets the option.


getDescriptionComponent

public javax.swing.JComponent getDescriptionComponent()
Gets the description component of the option.

Returns:
The default is a JLabel holding the description of the option

notifyOptionMgrOfOptionChange

public void notifyOptionMgrOfOptionChange()
Notifies the option manager of an option change.


createHeading

protected javax.swing.JLabel createHeading()
Creates a label that holds the option heading, if defined.

Returns:
The new label component or null if there is no heading

getValue

public abstract java.lang.Object getValue()
Returns the value of the option widget. This value might be different from the actual option value as long as the option has not been comitted.


setValue

public abstract void setValue(java.lang.Object o)
Sets the value that will be displayed in the option widget.


getWidgetComponent

public abstract javax.swing.JComponent getWidgetComponent()
Gets the widget component that visualizes the option.



Copyright © 2011. All Rights Reserved.