borland Packages Class Hierarchy jbcl.view Package Index
java.lang.Object +----java.awt.Component +----java.awt.Choice +----borland.jbcl.view.ChoiceView +----borland.jbcl.control.ChoiceControl
Variables Constructors Properties Methods Event Listeners
Implements SingletonModelListener, SingletonModelView, KeyListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener
ChoiceView is a view element for developing composite components. It provides a user interface element that is a drop-down menu of choices. The current selection is visible.
To specify the choices that appear in the view, use the items property; items contains an array of Strings. The readOnly property determines whether the user can edit the items in the control.
ChoiceView requires a VectorModel data model and a VectorViewManager view manager.
public ChoiceView()
Creates a ChoiceView component with default property values.
public synchronized String[] getItems() public synchronized void setItems(java.lang.String[] items)
Stores an array of Strings, which represent the items in the choice list.
public SingletonModel getModel() public void setModel(borland.jbcl.model.SingletonModel p)
Specifies the model object required for access to a list of choices. ChoiceView requires a class that implements the SingletonModel interface.
public boolean isReadOnly() public void setReadOnly(boolean ro)
Specifies whether the user can change the items in the list of choices at run time. If true, the user can edit the items; if false, the user can't edit them.
public WritableSingletonModel getWriteModel()
A read-only property that returns the writable model object for this choice component. A writable model allows the items to be edited.
protected void processItemEvent(java.awt.event.ItemEvent e)
If writable, and the model is settable, sets the selected item for the write model.
Parameters:
Overrides: java.awt.Choice.processItemEvent(java.awt.ItemEvent)
public void select(java.lang.String s)
The item to select in the choice control, based on the string displayed.
If the ChoiceView is writable and the write model is settable, then the string is selected in the superclass, and the write model gets is set to the selected item. No item event is fired.
Parameters:
Overrides: java.awt.Choice.select(String)
protected void updateSelection()
If the model is non-null, calls select(model.toString()). If the model is null, calls select("").
public synchronized void addComponentListener(java.awt.event.ComponentListener ) public synchronized void removeComponentListener(java.awt.event.ComponentListener )
public synchronized void addFocusListener(java.awt.event.FocusListener ) public synchronized void removeFocusListener(java.awt.event.FocusListener )
public synchronized void addItemListener(java.awt.event.ItemListener ) public synchronized void removeItemListener(java.awt.event.ItemListener )
public synchronized void addKeyListener(java.awt.event.KeyListener ) public synchronized void removeKeyListener(java.awt.event.KeyListener )
public void addModelListener(borland.jbcl.model.SingletonModelListener listener) public void removeModelListener(borland.jbcl.model.SingletonModelListener listener)
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 )