borland.jbcl Packages  borland.jbcl Class Hierarchy  borland.jbcl.view 

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, SingletonView, ItemSelectable, MenuContainer, ImageObserver, Serializable, EventListener

ChoiceView is a view element for developing new composite components. It provides a user interface element that is a drop-down menu of choices. The current choice (the selected item) displays as the title of the component.

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.
Parameters:
items - The String array representing the items.

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 VectorModel object.

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.

viewManager

 public SingletonViewManager getViewManager()
 public void setViewManager(borland.jbcl.model.SingletonViewManager vvm)
Specifies the view manager object handling item painter and item editor selection for this choice component.

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(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 nonnull, 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 l)
 public synchronized void removeComponentListener(java.awt.event.ComponentListener l)

focus

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

item

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

key

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

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 l)
 public synchronized void removeMouseListener(java.awt.event.MouseListener l)

mouseMotion

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