borland Packages Class Hierarchy dbswing Package
java.lang.Object +----java.awt.Component +----java.awt.Container +----javax.swing.JComponent +----javax.swing.JList +----com.borland.dbswing.JdbList
Variables Constructors Properties Methods Event Listeners
Implements DBDataBinder, AccessListener, ColumnAware, DataChangeListener, DataSetAware, NavigationListener, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, ListSelectionListener, Scrollable
The JdbList
is a data-aware extension to the JList
component.
JdbList
displays a list of choices from which a user may choose a single value. The selected value is written to a column of a DataSet
and retrieved using the standard Swing ListSelectionModel
methods. When JdbList
is bound to a DataSet
and DataSet Column
, the currently selected choice always reflects the value of the corresponding column in the current DataSet
row.
There are several ways to fill the list presented by JdbList
:
JdbList
's items
property with an array of String
s or Object
s to display a static list of choices.
JList
model methods to populate the list from a Vector
, Object
array, or any ListModel
implementation.
DataSet
by setting the picklist
property on JdbList
's columnName
Column
. The choices displayed by JdbList
are always kept in synchronization with changes in the source DataSet
. By specifying the picklist
property accordingly, it's possible to display a value from one column but save a value from a different column or even save the values from more than one column.
DBListDataBinder
and set its properties to connect it with JdbList
and to a JListModel
and JListSelectionModel
.
You should avoid setting both the column's picklist
property and JdbList
's items
property on the same list. If both properties are set in the UI Designer, the picklist
setting takes precedence at runtime. When the list is displayed, however, the most recently set property setting always takes precedence.
Note that because a list can display one column only at a time, if more than one column is specified as a display column in the picklist definition, only the first display column is displayed by JdbList
. For more information about picklists, refer to the DataExpress documentation and the PickListDescriptor
class.
Ordinarily, the selection in a data-aware JdbList
is the current value of the column it is bound to. If this value is not in its list, a JdbList
has no selected value by default, but you can modify this behavior by changing the value of the unknownDataValueMode
property.
JdbNavList
public JdbList()Constructs a
JdbList
component by calling the constructor of its superclass.
public JdbList(Object[] listData)Constructs a
JdbList
component by calling the constructor of its superclass that takes an array of Object
s as a parameter.
listData
Object
s that makes up the list displayed in the JdbList
.
public JdbList(Vector listData)Constructs a
JdbList
component by calling the constructor of its superclass that takes a Vector
as a parameter.
listData
Vector
that makes up the list displayed in the JdbList
.
public JdbList(ListModel dataModel)Constructs a
JdbList
component by calling the constructor of its superclass and passing to it a ListModel
.
dataModel
ListModel
that contains the data in the list displayed by JdbList
.
public String getColumnName() public void setColumnName(String columnName)Returns and sets the name of a
Column
in the
DataSet
from which the current list selection is read and to which the current list selection is written. Setting this property replaces the current ListModel
from which the list is built.
public DataSet getDataSet() public void setDataSet(DataSet dataSet)Returns and sets a
DataSet
from which the current list selection is read and to which the current list selection is written.
public synchronized String[] getItems() public synchronized void setItems(String[] items) public synchronized void setItems(Object[] items)Returns and sets the list of items to select from. Setting this property replaces the existing model from which the list is built.
public Dimension getPreferredSize()Returns the preferred size of the
JdbList
.
public int getUnknownDataValueMode() public void setUnknownDataValueMode(int mode)Returns and sets the policy for synchronizing a list selection with its
DataSet
value when the value can't be found in the list. The possible values are these:
DataSet
is cleared.
The default value is DEFAULT.
protected void commonInit()Used to initialize
JdbList
with the same defaults, regardless of the constructor used. A newly instantiated JdbList
differs from a JList
in that it always has SINGLE_SELECTION mode as its selectionMode
.
public void addAncestorListener(javax.swing.event.AncestorListener ) public void removeAncestorListener(javax.swing.event.AncestorListener )
public synchronized void addComponentListener(java.awt.event.ComponentListener ) public synchronized void removeComponentListener(java.awt.event.ComponentListener )
public synchronized void addContainerListener(java.awt.event.ContainerListener ) public synchronized void removeContainerListener(java.awt.event.ContainerListener )
public synchronized void addFocusListener(java.awt.event.FocusListener ) public synchronized void removeFocusListener(java.awt.event.FocusListener )
public synchronized void addInputMethodListener(java.awt.event.InputMethodListener ) public synchronized void removeInputMethodListener(java.awt.event.InputMethodListener )
public synchronized void addKeyListener(java.awt.event.KeyListener ) public synchronized void removeKeyListener(java.awt.event.KeyListener )
public void addListSelectionListener(javax.swing.event.ListSelectionListener ) public void removeListSelectionListener(javax.swing.event.ListSelectionListener )
public synchronized void addMouseListener(java.awt.event.MouseListener ) public synchronized void removeMouseListener(java.awt.event.MouseListener )
public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener ) public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )
public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener ) public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )
public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener ) public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener )