|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pushingpixels.flamingo.api.common.CommandToggleButtonGroup
public class CommandToggleButtonGroup
Group of command toggle buttons. Unlike the ButtonGroup
, this class
operates on buttons and not on button models.
Field Summary | |
---|---|
protected boolean |
allowsClearingSelection
If false , the selection cannot be cleared. |
protected Vector<JCommandToggleButton> |
buttons
Contains all group buttons. |
protected Map<JCommandToggleButton,ChangeListener> |
modelChangeListeners
Map of registered model change listeners. |
static String |
SELECTED_PROPERTY
Name of the property change event fired when the group selection is changed. |
protected JCommandToggleButton |
selection
The currently selected button. |
Constructor Summary | |
---|---|
CommandToggleButtonGroup()
Creates a new button group. |
Method Summary | |
---|---|
void |
add(JCommandToggleButton b)
Adds the specified button to the group. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds the specified property change listener on this button group. |
void |
clearSelection()
Clears the selection of this button group. |
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Fires a property change event on all registered listeners. |
JCommandToggleButton |
getSelected()
Returns the selected button of this group. |
boolean |
isAllowsClearingSelection()
Returns the current value for clearing selection. |
void |
remove(JCommandToggleButton b)
Removes the specified button from the group. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes the specified property change listener from this button group. |
void |
setAllowsClearingSelection(boolean allowsClearingSelection)
Sets the new value for clearing selection. |
void |
setSelected(JCommandToggleButton button,
boolean isSelected)
Changes the selected status of the specified button. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Vector<JCommandToggleButton> buttons
protected Map<JCommandToggleButton,ChangeListener> modelChangeListeners
public static final String SELECTED_PROPERTY
protected JCommandToggleButton selection
null
.
protected boolean allowsClearingSelection
false
, the selection cannot be cleared. By default the
button group allows clearing the selection in clearSelection()
or setSelected(JCommandToggleButton, boolean)
(passing the
currently selected button and false
).
Constructor Detail |
---|
public CommandToggleButtonGroup()
Method Detail |
---|
public void setAllowsClearingSelection(boolean allowsClearingSelection)
true
is
passed, the selection can be cleared in clearSelection()
or
setSelected(JCommandToggleButton, boolean)
(passing the
currently selected button and false
).
allowsClearingSelection
- The new value for clearing selection.public boolean isAllowsClearingSelection()
true
is
returned when selection can be cleared in clearSelection()
or
setSelected(JCommandToggleButton, boolean)
(passing the
currently selected button and false
).
public void add(JCommandToggleButton b)
b
- The button to be added.public void remove(JCommandToggleButton b)
b
- The button to be removedpublic void setSelected(JCommandToggleButton button, boolean isSelected)
button
- Button.isSelected
- Selection indication.public JCommandToggleButton getSelected()
null
.public void clearSelection()
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- Listener to add.public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- Listener to remove.protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
propertyName
- Name of the changed property.oldValue
- Old property value.newValue
- New property value.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |