borland Packages Class Hierarchy jbcl.control Package Index
java.lang.Object +----java.awt.Component +----java.awt.Container +----com.sun.java.swing.JComponent +----com.sun.java.swing.JScrollPane +----borland.jbcl.view.ListView +----borland.jbcl.control.ListControl
Variables Constructors Properties Methods Event Listeners
Implements AccessListener, ColumnAware, DataChangeListener, DataSetAware, NavigationListener, VectorModel, VectorSubfocusListener, BlackBox, VectorView, Accessible, ScrollPaneConstants, ImageObserver, MenuContainer, Serializable, EventListener
The ListControl component maintains a list of objects.
If ListControl is connected to a column in a data set through the dataSet and columnName properties, it displays the values in the specified column of the data set. In this case ListControl is a data-aware control.
If ListControl is not being used as a data-aware control, the data items displayed come from the items property.
You can add and remove items in the list using the addItem(), removeItem(), and removeAllItems() methods. Use the count property to determine the number of items in the list. The get() method retrieves the data item specified with the argument, and the set() method sets the specified data item to the specified Object.
The value of the multiSelect property determines whether one or more items can be selected at a time. If multiSelect is true, the use can select a range of items by Shift+clicking items, or the user can select a noncontiguous set of items by Ctrl+clicking items.
The topIndex property determines which item in the list appears at the top of the list.
When one or more items in the list control is selected, events such as modelContentChanged and selectionChanged occur. The code that you write in response to one or more of these events determines what happens with the selected data items.
ListControl extends ListView, which provides many of the visual attributes and behaviors of ListControl. For example, ListView's alignment property determines how items are aligned with the control. See ListView for a desciption of these properties and methods.
ListControl is a composite component that instantiates a default data model (VectorModel) and view manager (VectorViewManager). It also implements the WritableVectorModel interface, and therefore can provide its items to another component that uses a vector data model.
Note:
The methods remove() and removeAll() have been deprecated in ListControl. Use the removeItem() and removeAllItems() instead.
For an example that uses a ListControl, see the project file Cardlayout.jpr located in the jbuilder\samples\borland\samples\jbcl\cardlayout directory of your JBuilder installation. This sample uses a CardLayout panel that is controlled by a ChoiceControl, ListControl, and TabsetControl.
protected boolean addNotifyCalled
protected boolean autoInsert
protected String columnName
protected DataSet dataSet
protected boolean dsNavigating
protected boolean multiSelect
protected boolean navigateDataSet
protected String textureName
protected int topIndex
protected boolean userSetNavigate
public ListControl()
Constructs a ListControl with all properties set to their default values.
public boolean isAutoInsert() public void setAutoInsert(boolean auto)
Determines whether to automatically add an item to the list control when a data item is added to the model. If auto is true, the data item is automatically added; if false, it isn't.
public String getColumnName() public void setColumnName(java.lang.String newColumnName)
The columnName property specifies a column name in the dataSet object to fill the list contents.
public int getCount()
Read-only property that returns the number of items in the list.
public DataSet getDataSet() public void setDataSet(borland.jbcl.dataset.DataSet newDataSet)
When connecting a ListControl to a DataSet component, the dataSet property specifies a borland.jbcl.dataset.DataSet object to fill the list contents.
public synchronized String[] getItems() public synchronized void setItems(java.lang.String[] newItems)
Specifies the list of items for the ListControl. If your component requires only a simple list that is stored in the component, with no complex functionality or database connectivity, use setItems() to specify an array of String objects for your list.
public void setModel(borland.jbcl.model.VectorModel model)
Checks to prevent a recursive model assignment, then calls the same setter in the superclass: jbcl.view.ListView.setModel().
The model property defines the VectorModel that this list is displaying data from. If the current model is an instance of WritableVectorModel, an external user can get access to it using getWriteModel().
public boolean isMultiSelect() public void setMultiSelect(boolean select)
Specifies whether the user can select more than one item in the list. If true , more than one item can be selected; if false , only one item can be selected.
public boolean isNavigateWithDataSet() public void setNavigateWithDataSet(boolean navigate)
Specifies whether the ListControl changes focus when the DataSet object specified in its dataSet property navigates. When true, the DataSet object navigates (and all controls bound to it change focus) when the ListControl changes focus. By default, navigateWithCursor is true.
public String getTextureName() public void setTextureName(java.lang.String path)Determines the name of the Image file that is tiled on the background of the control to give the appearance of texture. Specify the file name and directory using the path parameter.
public void setTopIndex(int index)
Determines the item that appears at the top of the list control. By setting the topIndex value to the index of a specific item within the list control, you can ensure that item appears at the top of the list control. Setting topIndex has an effect only if there so many items within the control that the user must scroll to see them all. The first item in the list has an index value of 0.
public boolean isVariableSize()
Stores whether the list control data items are stored in a writeable vector model and the model is variable-size. To find the latter, calls jbcl.model.WritableVectorModel.variableSize().
public void addItem(int aheadOf, java.lang.Object object)Inserts an item into the list.
Parameters:
public void addItem(java.lang.Object object)Appends an item to the list.
Parameters:
public void addNotify()
Creates the ListControl component's peer. Also, if the dataSet property is set, and that cursor's autoOpen property is set to true, opens the cursor.
Overrides: java.awt.ScrollPane.addNotify()
public boolean canSet(int index, boolean startEdit)Determine whether the specified item can be modified.
Parameters:
public void enableModelEvents(boolean enable)Enables model events.
Parameters:
public void removeAllItems()Removes all items in the list.
public void removeItem(int index)Removes the specified item from the list.
Parameters:
public void set(int index, java.lang.Object object)Sets the specified item in the list to a new value.
Parameters:
public void setItems(borland.jbcl.dataset.DataSet dataSet, java.lang.String columnName)
Sets the contents of a Column in a dataSet to the list's contents (strings).
Parameters:
public void touched(int index)
public void addActionListener(java.awt.event.ActionListener l) public void removeActionListener(java.awt.event.ActionListener l)
public void addAncestorListener(com.sun.java.swing.event.AncestorListener ) public void removeAncestorListener(com.sun.java.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 void removeContainerListener(java.awt.event.ContainerListener )
public void addCustomItemListener(borland.jbcl.view.CustomItemListener l) public void removeCustomItemListener(borland.jbcl.view.CustomItemListener l)
public void addFocusListener(java.awt.event.FocusListener l) public void removeFocusListener(java.awt.event.FocusListener l)
public void addKeyListener(java.awt.event.KeyListener l) public void removeKeyListener(java.awt.event.KeyListener l)
public void addModelListener(borland.jbcl.model.VectorModelListener listener) public void removeModelListener(borland.jbcl.model.VectorModelListener listener)
public void addMouseListener(java.awt.event.MouseListener l) public void removeMouseListener(java.awt.event.MouseListener l)
public void addMouseMotionListener(java.awt.event.MouseMotionListener l) public void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener ) public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )
public void addSelectionListener(borland.jbcl.model.VectorSelectionListener listener) public void removeSelectionListener(borland.jbcl.model.VectorSelectionListener listener)
public void addSubfocusListener(borland.jbcl.model.VectorSubfocusListener listener) public void removeSubfocusListener(borland.jbcl.model.VectorSubfocusListener listener)
public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener ) public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener )