|
Draw2D v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.eclipse.draw2d.ButtonGroup
ButtonGroup - Holds a group of Clickable's models
and provides unique selection in them. There is
capability to add a default selection. Models who
want to belong to the group should just add themselves
to this group. By doing so they listen to this group
for changes.
Setting of the default selection results in its being selected any time setSelected(ButtonModel,false) is called. If no default selection is set, the last entry selected is not allowed to deselect.
| Constructor Summary | |
ButtonGroup()
Constructs a ButtonGroup with no default selection. |
|
| Method Summary | |
void |
add(ButtonModel model)
Adds the passed ButtonModel to the ButtonGroup. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds the passed listener. |
protected void |
firePropertyChange(Object oldValue,
Object newValue)
Fires a PropertyChangeEvent to all PropertyChangeListeners added to this ButtonGroup. |
ButtonModel |
getDefault()
Returns the ButtonModel which is selected by default for this ButtonGroup. |
List |
getElements()
Returns a List which contains all of the ButtonModels added to this ButtonGroup. |
ButtonModel |
getSelected()
Returns the ButtonModel for the currently selected button. |
boolean |
isSelected(ButtonModel model)
Determines if the given ButtonModel is selected or not. |
void |
remove(ButtonModel model)
Removes the given ButtonModel from this ButtonGroup. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes the passed PropertyChangeListener from this ButtonGroup. |
protected void |
selectNewModel(ButtonModel model)
Sets the passed ButtonModel to be the currently selected ButtonModel of this ButtonGroup. |
void |
setDefault(ButtonModel model)
Sets the default selection of this ButtonGroup. |
void |
setSelected(ButtonModel model)
Sets the button with the given ButtonModel to be selected. |
void |
setSelected(ButtonModel model,
boolean value)
Sets model to the passed state. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ButtonGroup()
| Method Detail |
public void add(ButtonModel model)
model - ButtonModel to be added to this group.remove(ButtonModel)public void addPropertyChangeListener(PropertyChangeListener listener)
listener - Listener to be added to this group.removePropertyChangeListener(PropertyChangeListener)
protected void firePropertyChange(Object oldValue,
Object newValue)
oldValue - Old selection value.newValue - New selection value.public ButtonModel getDefault()
public List getElements()
ButtonModels added to this ButtonGroup.public ButtonModel getSelected()
public boolean isSelected(ButtonModel model)
model - Model being tested for selected status.public void remove(ButtonModel model)
model - ButtonModel being removed.public void removePropertyChangeListener(PropertyChangeListener listener)
listener - PropertyChangeListener to be removed.protected void selectNewModel(ButtonModel model)
model - ButtonModel to be selected.public void setDefault(ButtonModel model)
model - ButtonModel which is to be the default selection.public void setSelected(ButtonModel model)
public void setSelected(ButtonModel model,
boolean value)
model - Model to be affected.value - A value of true: Causes the passed
ButtonModel to own selection
A value of false: If the passed model owned
selection, it will lose selection, and selection
will be give to the default ButonModel.
If the passed model was not selected, selection
will remain as it was.
If no default ButtonModel was set, selection
will remain as it was, as one ButtonModel
must own selection at all times.
|
Draw2D v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||