borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.control
java.lang.Object +----java.awt.Component +----java.awt.Choice +----borland.jbcl.control.PickListItemEditor
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.
public PickListItemEditor()
public final boolean isCachePickList() public final void setCachePickList(boolean cache)
public Component getComponent()
public Object getValue()
public final void loadPickList(borland.jbcl.dataset.PickListDescriptor pickList)
public synchronized void addComponentListener(java.awt.event.ComponentListener l) public synchronized void removeComponentListener(java.awt.event.ComponentListener l)
public synchronized void addFocusListener(java.awt.event.FocusListener l) public synchronized void removeFocusListener(java.awt.event.FocusListener l)
public synchronized void addItemListener(java.awt.event.ItemListener l) public synchronized void removeItemListener(java.awt.event.ItemListener l)
public synchronized void addKeyListener(java.awt.event.KeyListener l) public synchronized void removeKeyListener(java.awt.event.KeyListener l)
public synchronized void addMouseListener(java.awt.event.MouseListener l) public synchronized void removeMouseListener(java.awt.event.MouseListener l)
public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener l) public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener l)