com.partnersoft.gui
Class PicklistField

java.lang.Object
  extended by com.partnersoft.gui.PicklistField
All Implemented Interfaces:
GUIField

public class PicklistField
extends java.lang.Object
implements GUIField

A Field implemented with a JComboBox.

Author:
Paul Reavis Copyright 2004 Partner Software, Inc.

Constructor Summary
PicklistField()
           
PicklistField(java.util.Collection options)
           
PicklistField(javax.swing.ComboBoxModel model)
           
 
Method Summary
 void doAction()
          Subclasses should override this to take action whenever an action should occur (generally when the user hits return in the field).
 javax.swing.JComponent getGUI()
          Returns the GUI component for this field.
 javax.swing.JComboBox getJComboBox()
           
 int getSelectedIndex()
           
 java.lang.Object getValue()
          Returns the current value for this field.
 void setModel(javax.swing.ComboBoxModel newModel)
           
 void setOptions(java.util.ArrayList newOptions)
           
 void setOptions(java.util.Collection newOptions)
           
 void setOptions(java.lang.String... newOptions)
           
 void setSelectedIndex(int newIndex)
           
 void setValue(java.lang.Object newItem)
          Sets the current value for this field.
 void valueChanged(java.lang.Object newValue)
          Subclasses should override this to take action whenever the selection set changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PicklistField

public PicklistField()

PicklistField

public PicklistField(javax.swing.ComboBoxModel model)

PicklistField

public PicklistField(java.util.Collection options)
Method Detail

setModel

public void setModel(javax.swing.ComboBoxModel newModel)

getSelectedIndex

public int getSelectedIndex()

setSelectedIndex

public void setSelectedIndex(int newIndex)

getValue

public java.lang.Object getValue()
Description copied from interface: GUIField
Returns the current value for this field.

Specified by:
getValue in interface GUIField

setValue

public void setValue(java.lang.Object newItem)
Description copied from interface: GUIField
Sets the current value for this field.

Specified by:
setValue in interface GUIField

setOptions

public void setOptions(java.util.Collection newOptions)

setOptions

public void setOptions(java.util.ArrayList newOptions)

setOptions

public void setOptions(java.lang.String... newOptions)

getJComboBox

public javax.swing.JComboBox getJComboBox()

getGUI

public javax.swing.JComponent getGUI()
Description copied from interface: GUIField
Returns the GUI component for this field.

Specified by:
getGUI in interface GUIField

valueChanged

public void valueChanged(java.lang.Object newValue)
Subclasses should override this to take action whenever the selection set changes.

Specified by:
valueChanged in interface GUIField

doAction

public void doAction()
Subclasses should override this to take action whenever an action should occur (generally when the user hits return in the field).

Specified by:
doAction in interface GUIField