borland.jbcl Packages  borland.jbcl Class Hierarchy  borland.jbcl.control 

PickListItemEditor component

java.lang.Object
   +----java.awt.Component
           +----java.awt.Choice
                   +----borland.jbcl.control.PickListItemEditor

About the PickListItemEditor component

Variables  Constructors  Properties  Methods  Event Listeners

Implements ItemEditor, ItemSelectable, MenuContainer, ImageObserver, Serializable

The PickListItemEditor provides basic pick list editor functionality and can be used as the itemEditor property value of the Column component of a DataSet.

When specifying the PickListItemEditor, you must also set the pickList property of the Column. Currently the pickList property cannot be set in the JBuilder UI Designer, however, the code can be added manually in the jbinit() method as follows:


jbinit() {
....
countryColumn.setPickList(new PickListDescriptor(  
     countryDataSet,new String[]{"COUNTRY"},
     new String[]{"COUNTRY"},new String[]{"COUNTRY"},false ));
     customerDataSet.setColumns(new Column[] {countryColumn});
...
The PickListItemEditor control uses the Column component's pickList property (stored in the PickListDescriptor object) in a simple manner.

The PickListItemEditor uses the first column specified in the pickListColumns property of the PickListDescriptor; the remaining columns are ignored. Similary, only the first column specified in the pickListDisplayColumns property of the PickListDescriptor is used for display.

The destinationColumnsproperty of the PickListDescriptor is ignored and not used by the PickListItemEditor. The PickListItemEditor always sets the column that the editor is bound to.

The PickListItemEditor assumes that the pickListDataSet property is not edited after the editor is initialized. You can prevent repetitive loading of the pickListDataSet by setting the PickListItemEditor component's Cache property.

You can extend the PickListItemEditor by creating a more sophisticated pick list editor that improves on this component always setting just the column it is bound to. The ColumnVariant class's getDataSet() method has the destination DataSet which is positioned at the current row. Multiple values could be set through this DataSet. The implementation of ItemEditor.getValue() could return the value that was passed to ItemEditor.startEdit if it is not one of the PickListDescriptor.destinationColumns values.


PickListItemEditor variables

Variables implemented in java.awt.Component

PickListItemEditor constructors

PickListItemEditor properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.awt.Choice

Properties implemented in java.awt.Component

Properties implemented in java.lang.Object

PickListItemEditor methods

Methods implemented in this class

Methods implemented in java.awt.Choice

Methods implemented in java.awt.Component

Methods implemented in java.lang.Object

PickListItemEditor event listeners


PickListItemEditor constructors

PickListItemEditor()

  public PickListItemEditor()

PickListItemEditor properties

cachePickList

 public final boolean isCachePickList()
 public final void setCachePickList(boolean cache)

component

 public Component getComponent()

value

 public Object getValue()

PickListItemEditor methods

loadPickList(borland.jbcl.dataset.PickListDescriptor)

  public final void loadPickList(borland.jbcl.dataset.PickListDescriptor pickList)

PickListItemEditor event listeners

This component is a source for the following event sets. For information on the standard AWT event sets, see Standard Java events.

component

 public synchronized void addComponentListener(java.awt.event.ComponentListener l)
 public synchronized void removeComponentListener(java.awt.event.ComponentListener l)

focus

 public synchronized void addFocusListener(java.awt.event.FocusListener l)
 public synchronized void removeFocusListener(java.awt.event.FocusListener l)

item

 public synchronized void addItemListener(java.awt.event.ItemListener l)
 public synchronized void removeItemListener(java.awt.event.ItemListener l)

key

 public synchronized void addKeyListener(java.awt.event.KeyListener l)
 public synchronized void removeKeyListener(java.awt.event.KeyListener l)

mouse

 public synchronized void addMouseListener(java.awt.event.MouseListener l)
 public synchronized void removeMouseListener(java.awt.event.MouseListener l)

mouseMotion

 public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener l)
 public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener l)