jbcl.control Package
java.lang.Object +----com.borland.jbcl.control.PopupPickListItemEditor
Constructors Properties Methods Event Listeners
Implements ItemEditor, Serializable
The PopupPickListItemEditor
is a custom model-view
ItemEditor
that is specifically designed for use with DataSet
Column
components.
When this class is assigned as the ItemEditor
for a Column
that has a PickListDescriptor
bound to a data-aware control (for example,
a FieldControl
), the PopupPickListItemEditor
presents the user with a multi-column table (GridControl
) of values stored in a DataSet
from which to make a selection. When a selection is made, PopupPickListItemEditor
copies one or more column values from a row of the "picklist" DataSet
into columns of the DataSet
to which the PopupPickListItemEditor
is attached.
For example, a PickListDescriptor
is specified for the Customer_ID column of the Orders data set. It specifies that the "picklist" data set is the Customer data set, the display columns are the Last_Name and Social_Security_Number field, and that the Customer_ID and Phone_Number columns from the Customer data set should be copied into the Customer_ID and Contact_Phone columns of the Orders data set. When the user edits the control containing the Customer_ID column, a table of last names and social security numbers from the Customer data set is presented in a GridControl
, from which the user makes a selection. If the user selects a row, the Customer_ID and Phone_Number values for that customer is copied into the Customer_ID and Contact_Phone columns, respectively, of the Orders data set.
Users can select the currently highlighted row from the picklist dialog by either double-clicking the row, or pressing Enter. To cancel the edit without making a selection, click the close icon of the dialog box or press the Esc key.
The PopupPickListItemEditor
is available from the JBCL tab of the Component Palette. When working with this component in the JBuilder UI Designer, a PickListDescriptor
is automatically created that specifies the columns of a DataSet
to display, as well as the names of source and target columns for copying. Note that the columns displayed can be different in name and number from the columns transferred between data sets.
This component displays a multi-column popup list. If only a single-column popup is needed, set the itemEditor
property of the column to the PickListItemEditor
instead.
public PopupPickListItemEditor()Constructs a
PopupPickListItemEditor
object.
public final boolean isAllowSearch() public final void setAllowSearch(boolean allowSearch)Specifies whether or not an incremental search control should be provided at the top of the window.
public final boolean isAlwaysCenter() public final void setAlwaysCenter(boolean alwaysCenter)Specifies whether or not the picklist window should always be centered when displayed, or the most recent size and position should be maintained.
public Component getComponent()This method is implemented from an interface but not applicable to this component and therefore, it simply returns null.
public final boolean isDisplayOKCancel() public final void setDisplayOKCancel(boolean displayOKCancel)Specifies whether or not an OK/Cancel button bar should appear at the bottom of the popup window. This property defaults to false.
public final String getTitle() public final void setTitle(String windowTitle)Specifies an optional string to display in the title area of the window. By default, no title is displayed. To clear the title after setting one, pass an empty string to the
setTitle()
method.
public Object getValue()This method returns the value in the current column if the current column is one of the picklist target columns. Otherwise, this method returns the original value.
protected void loadPickList(PickListDescriptor pickList, Component component)Protected method that constructs a
DataSetView
containing only those columns specified in the pickListDisplayColumns
property of the PickListDescriptor
then creates a modal dialog box with a GridControl
displaying with these columns.
public void addKeyListener(KeyListener l) public void removeKeyListener(KeyListener l)
public final void addRowFilterListener(RowFilterListener listener) public final void removeRowFilterListener(RowFilterListener listener)