org.openbp.jaspira.option.widget
Class TextWidget

java.lang.Object
  extended by org.openbp.jaspira.option.OptionWidget
      extended by org.openbp.jaspira.option.widget.TextWidget
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.DocumentListener

public class TextWidget
extends OptionWidget
implements javax.swing.event.DocumentListener

This is a simple OptionWidget whitch shows a TextField and manages the input events.

Author:
Jens Ferchland

Field Summary
 
Fields inherited from class org.openbp.jaspira.option.OptionWidget
option
 
Constructor Summary
TextWidget(Option option, int numberOfCharacters)
          Constructor.
TextWidget(Option option, int numberOfCharacters, javax.swing.text.Document doc)
          Constructor.
 
Method Summary
 void changedUpdate(javax.swing.event.DocumentEvent e)
           
 java.lang.Object getValue()
          Returns the value of the option widget.
 javax.swing.JComponent getWidgetComponent()
          Gets the widget component that visualizes the option.
 void insertUpdate(javax.swing.event.DocumentEvent e)
           
 void removeUpdate(javax.swing.event.DocumentEvent e)
           
 void setValue(java.lang.Object o)
          Sets the value that will be displayed in the option widget.
 
Methods inherited from class org.openbp.jaspira.option.OptionWidget
createHeading, getDescriptionComponent, getOption, notifyOptionMgrOfOptionChange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextWidget

public TextWidget(Option option,
                  int numberOfCharacters)
Constructor.

Parameters:
option - Option the widget refers to
numberOfCharacters - Number of characters (columns) to display

TextWidget

public TextWidget(Option option,
                  int numberOfCharacters,
                  javax.swing.text.Document doc)
Constructor.

Parameters:
option - Option the widget refers to
numberOfCharacters - Number of characters (columns) to display
doc - Text document
Method Detail

changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent e)
Specified by:
changedUpdate in interface javax.swing.event.DocumentListener
See Also:
DocumentListener.changedUpdate(DocumentEvent)

insertUpdate

public void insertUpdate(javax.swing.event.DocumentEvent e)
Specified by:
insertUpdate in interface javax.swing.event.DocumentListener
See Also:
DocumentListener.insertUpdate(DocumentEvent)

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent e)
Specified by:
removeUpdate in interface javax.swing.event.DocumentListener
See Also:
DocumentListener.removeUpdate(DocumentEvent)

getValue

public java.lang.Object getValue()
Description copied from class: OptionWidget
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.

Specified by:
getValue in class OptionWidget

setValue

public void setValue(java.lang.Object o)
Description copied from class: OptionWidget
Sets the value that will be displayed in the option widget.

Specified by:
setValue in class OptionWidget

getWidgetComponent

public javax.swing.JComponent getWidgetComponent()
Description copied from class: OptionWidget
Gets the widget component that visualizes the option.

Specified by:
getWidgetComponent in class OptionWidget


Copyright © 2011. All Rights Reserved.