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

ListControl component

java.lang.Object
   +----java.awt.Component
           +----java.awt.Container
                   +----java.awt.ScrollPane
                           +----borland.jbcl.view.ListView
                                   +----borland.jbcl.control.ListControl

About the ListControl component

Variables  Constructors  Properties  Methods  Event Listeners

Implements AccessListener, DataChangeListener, NavigationListener, VectorModel, VectorSubfocusListener, WritableVectorModel, BlackBox, VectorView, MenuContainer, ImageObserver, Serializable, EventListener

The ListControl component maintains a list of objects. It is designed to work as a replacement for awt.List, but has properties that allow it to display items from a DataSet.

You can add and remove items in the list using the addItem() and remove() methods. Use the count property to determine the number of items in the list. If your component requires only a simple list that is stored in the component, set the items property and specify an array of String objects.

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.


ListControl variables

Variables implemented in java.awt.Component

Variables implemented in java.awt.ScrollPane

ListControl constructors

ListControl properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in borland.jbcl.view.ListView

Properties implemented in java.awt.Component

Properties implemented in java.awt.Container

Properties implemented in java.awt.ScrollPane

Properties implemented in java.lang.Object

ListControl methods

Methods implemented in this class

Methods implemented in borland.jbcl.view.ListView

Methods implemented in java.awt.Component

Methods implemented in java.awt.Container

Methods implemented in java.awt.ScrollPane

Methods implemented in java.lang.Object

ListControl event listeners


ListControl constructors

ListControl()

  public ListControl()
Constructs a ListControl with all properties set to their default values.


ListControl properties

autoInsert

 public boolean isAutoInsert()
 public void setAutoInsert(boolean auto)
Whether to automatically add an item to the list control when a data item is added to the model.

columnName

 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.

count

 public int getCount()
Read-only property that returns the number of items in the list.

dataSet

 public DataSet getDataSet()
 public void setDataSet(borland.jbcl.dataset.DataSet newDataSet)
When connecting a ListControl to a data set component, the dataSet property specifies a borland.jbcl.dataset.DataSet object to fill the list contents.

items

 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.

model

 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().

multiSelect

 public boolean isMultiSelect()
 public void setMultiSelect(boolean select)
Specifies whether the user can select more than one item in the list.

navigateWithDataSet

 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.

variableSize

 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().


ListControl methods

addNotify()

  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()

setItems(borland.jbcl.dataset.DataSet, java.lang.String)

  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:

dataSet
The dataSet to use.
columnName
The column in the specified dataSet.


ListControl event listeners

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

action

 public void addActionListener(java.awt.event.ActionListener l)
 public void removeActionListener(java.awt.event.ActionListener l)

component

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

container

 public synchronized void addContainerListener(java.awt.event.ContainerListener l)
 public void removeContainerListener(java.awt.event.ContainerListener l)

focus

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

key

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

model

 public void addModelListener(borland.jbcl.model.VectorModelListener listener)
 public void removeModelListener(borland.jbcl.model.VectorModelListener listener)

mouse

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

mouseMotion

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

selection

 public void addSelectionListener(borland.jbcl.model.VectorSelectionListener listener)
 public void removeSelectionListener(borland.jbcl.model.VectorSelectionListener listener)

subfocus

 public void addSubfocusListener(borland.jbcl.model.VectorSubfocusListener listener)
 public void removeSubfocusListener(borland.jbcl.model.VectorSubfocusListener listener)