jbcl.view Package
java.lang.Object +----java.awt.Component +----java.awt.Choice +----com.borland.jbcl.view.ChoiceView +----com.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 boolean isAutoAdd() public void setAutoAdd(boolean autoAdd)
Specifies whether items can automatically be added to the list of choices at run time. If true, items can be added; if false, items cannot be added.
public synchronized String[] getItems() public synchronized void setItems(String[] items)
Stores an array of Strings
, which represent the items
in the choice list.
public SingletonModel getModel() public void setModel(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(ItemEvent e)
If writable, and the model is settable, sets the selected item for the write model.
Parameters:
e
Overrides: java.awt.Choice.processItemEvent(java.awt.event.ItemEvent)
public void select(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:
s
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 addInputMethodListener(java.awt.event.InputMethodListener ) public synchronized void removeInputMethodListener(java.awt.event.InputMethodListener )
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(SingletonModelListener listener) public void removeModelListener(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 )
public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener ) public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )