borland Packages  Class Hierarchy  jbcl.view Package  Index 

ChoiceView component

java.lang.Object
   +----java.awt.Component
           +----java.awt.Choice
                   +----borland.jbcl.view.ChoiceView
                           +----borland.jbcl.control.ChoiceControl

About the ChoiceView component

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.


ChoiceView variables

Variables implemented in java.awt.Component

ChoiceView constructors

ChoiceView properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.awt.Choice

Properties implemented in java.awt.Component

Properties implemented in java.lang.Object

ChoiceView methods

Methods implemented in this class

Methods implemented in java.awt.Choice

Methods implemented in java.awt.Component

Methods implemented in java.lang.Object

ChoiceView event listeners


ChoiceView constructors

ChoiceView()

  public ChoiceView()

Creates a ChoiceView component with default property values.


ChoiceView properties

items

 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.

model

 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.

readOnly

 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.

writeModel

 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.


ChoiceView methods

processItemEvent(java.awt.event.ItemEvent)

  protected void processItemEvent(java.awt.event.ItemEvent e)

If writable, and the model is settable, sets the selected item for the write model.

Parameters:

e
The item event indicating the selected item.

Overrides: java.awt.Choice.processItemEvent(java.awt.ItemEvent)

select(java.lang.String)

  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:

s
The string to select.

Overrides: java.awt.Choice.select(String)

updateSelection()

  protected void updateSelection()

If the model is non-null, calls select(model.toString()). If the model is null, calls select("").


ChoiceView 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.

component

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

focus

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

item

 public synchronized void addItemListener(java.awt.event.ItemListener )
 public synchronized void removeItemListener(java.awt.event.ItemListener )

key

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

model

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

mouse

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

mouseMotion

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