Class RibbonRadioButtonGroupModel
- java.lang.Object
-
- org.pushingpixels.radiance.component.api.ribbon.synapse.model.RibbonRadioButtonGroupModel
-
public class RibbonRadioButtonGroupModel extends java.lang.Object
Group of ribbon radio buttons.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
allowsClearingSelection
Iffalse
, the selection cannot be cleared.private java.util.Map<RibbonRadioButtonContentModel,javax.swing.event.ChangeListener>
modelChangeListeners
Map of registered model change listeners.private java.util.Vector<RibbonRadioButtonContentModel>
radioButtonModels
Contains all group radio button content models.private RibbonRadioButtonContentModel
selection
The currently selected radio button content model.
-
Constructor Summary
Constructors Constructor Description RibbonRadioButtonGroupModel()
Creates a new radio button group.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(RibbonRadioButtonContentModel radioButtonContentModel)
Adds the specified content model to the group.void
clearSelection()
Clears the selection of this content model toggle group model.java.util.Collection<RibbonRadioButtonContentModel>
getRadioButtonModels()
Returns an unmodifiable collection with all the content models tracked by this model.RibbonRadioButtonContentModel
getSelected()
Returns the selected content model of this group model.boolean
isAllowsClearingSelection()
Returns the current value for clearing selection.void
remove(RibbonRadioButtonContentModel radioButtonContentModel)
Removes the specified content model from the group.void
removeAll()
void
setAllowsClearingSelection(boolean allowsClearingSelection)
Sets the new value for clearing selection.void
setSelected(RibbonRadioButtonContentModel radioButtonContentModel, boolean isSelected)
Changes the selected status of the specified content model.
-
-
-
Field Detail
-
radioButtonModels
private java.util.Vector<RibbonRadioButtonContentModel> radioButtonModels
Contains all group radio button content models.
-
modelChangeListeners
private java.util.Map<RibbonRadioButtonContentModel,javax.swing.event.ChangeListener> modelChangeListeners
Map of registered model change listeners.
-
selection
private RibbonRadioButtonContentModel selection
The currently selected radio button content model. Can benull
.
-
allowsClearingSelection
private boolean allowsClearingSelection
Iffalse
, the selection cannot be cleared. By default the radio button group allows clearing the selection inclearSelection()
orsetSelected(RibbonRadioButtonContentModel, boolean)
(passing the currently selected content model andfalse
).
-
-
Method Detail
-
getRadioButtonModels
public java.util.Collection<RibbonRadioButtonContentModel> getRadioButtonModels()
Returns an unmodifiable collection with all the content models tracked by this model.- Returns:
- An unmodifiable collection with all the content models tracked by this model.
-
setAllowsClearingSelection
public void setAllowsClearingSelection(boolean allowsClearingSelection)
Sets the new value for clearing selection. Iftrue
is passed, the selection can be cleared inclearSelection()
orsetSelected(RibbonRadioButtonContentModel, boolean)
(passing the currently selected content model andfalse
).- Parameters:
allowsClearingSelection
- The new value for clearing selection.
-
isAllowsClearingSelection
public boolean isAllowsClearingSelection()
Returns the current value for clearing selection.true
is returned when selection can be cleared inclearSelection()
orsetSelected(RibbonRadioButtonContentModel, boolean)
(passing the currently selected content model andfalse
).- Returns:
- The current value for clearing selection.
-
add
public void add(RibbonRadioButtonContentModel radioButtonContentModel)
Adds the specified content model to the group. If the content model is selected, and the group has a selected content model, the newly added content model is marked as unselected.- Parameters:
radioButtonContentModel
- The content model to be added.
-
remove
public void remove(RibbonRadioButtonContentModel radioButtonContentModel)
Removes the specified content model from the group.- Parameters:
radioButtonContentModel
- The content model to be removed
-
removeAll
public void removeAll()
-
setSelected
public void setSelected(RibbonRadioButtonContentModel radioButtonContentModel, boolean isSelected)
Changes the selected status of the specified content model.- Parameters:
radioButtonContentModel
- Content model.isSelected
- Selection indication.
-
getSelected
public RibbonRadioButtonContentModel getSelected()
Returns the selected content model of this group model.- Returns:
- The selected content model of this group model. The result can be
null
.
-
clearSelection
public void clearSelection()
Clears the selection of this content model toggle group model.
-
-