Class CommandPanelContentModel
- java.lang.Object
-
- org.pushingpixels.radiance.component.api.common.model.CommandPanelContentModel
-
- All Implemented Interfaces:
ChangeAware,ContentModel
public class CommandPanelContentModel extends java.lang.Object implements ContentModel, ChangeAware
-
-
Field Summary
Fields Modifier and Type Field Description private CommandGroup.CommandGroupListenercommandGroupListenerprivate java.beans.PropertyChangeListenercommandGroupPropertyChangeListenerprivate java.util.List<CommandGroup>commandGroupsprivate BaseCommand.CommandActionPreviewcommandPreviewListenerprivate java.beans.PropertyChangeListenercommandPropertyChangeListenerprivate booleanisSingleSelectionModeIndicates the selection mode for the toggle commands in the panel.private CommandselectedCommandprivate WeakChangeSupportweakChangeSupportStores the listeners on this model.
-
Constructor Summary
Constructors Constructor Description CommandPanelContentModel(java.util.List<CommandGroup> commands)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChangeListener(javax.swing.event.ChangeListener l)Adds the specified change listener to track changes to the underlying source.voidaddCommandGroup(CommandGroup commandGroupModel)CommandfindFirstMatch(CommandGroup.CommandFilter commandFilter)private voidfireStateChanged()intgetCommandCount()java.util.List<CommandGroup>getCommandGroups()BaseCommand.CommandActionPreviewgetCommandPreviewListener()CommandgetSelectedCommand()booleanisSingleSelectionMode()voidremoveAllCommandGroups()voidremoveChangeListener(javax.swing.event.ChangeListener l)Removes the specified change listener from tracking changes to the underlying source.voidremoveCommandGroup(CommandGroup commandGroupModel)voidsetCommandPreviewListener(BaseCommand.CommandActionPreview commandPreviewListener)voidsetSingleSelectionMode(boolean isSingleSelectionMode)Sets the selection mode for this model.private booleansyncSelectedCommand()
-
-
-
Field Detail
-
commandGroups
private java.util.List<CommandGroup> commandGroups
-
isSingleSelectionMode
private boolean isSingleSelectionMode
Indicates the selection mode for the toggle commands in the panel.
-
commandPreviewListener
private BaseCommand.CommandActionPreview commandPreviewListener
-
weakChangeSupport
private final WeakChangeSupport weakChangeSupport
Stores the listeners on this model.
-
commandGroupListener
private CommandGroup.CommandGroupListener commandGroupListener
-
commandGroupPropertyChangeListener
private java.beans.PropertyChangeListener commandGroupPropertyChangeListener
-
commandPropertyChangeListener
private java.beans.PropertyChangeListener commandPropertyChangeListener
-
selectedCommand
private Command selectedCommand
-
-
Constructor Detail
-
CommandPanelContentModel
public CommandPanelContentModel(java.util.List<CommandGroup> commands)
-
-
Method Detail
-
addCommandGroup
public void addCommandGroup(CommandGroup commandGroupModel)
-
removeCommandGroup
public void removeCommandGroup(CommandGroup commandGroupModel)
-
removeAllCommandGroups
public void removeAllCommandGroups()
-
getCommandGroups
public java.util.List<CommandGroup> getCommandGroups()
-
getCommandCount
public int getCommandCount()
-
findFirstMatch
public Command findFirstMatch(CommandGroup.CommandFilter commandFilter)
-
setSingleSelectionMode
public void setSingleSelectionMode(boolean isSingleSelectionMode)
Sets the selection mode for this model. Iftrueis passed as the parameter, all toggle commands in this model are set to belong to the same toggle group.- Parameters:
isSingleSelectionMode- Iftrue, all toggle commands in this model are set to belong to the same toggle group.
-
getSelectedCommand
public Command getSelectedCommand()
-
isSingleSelectionMode
public boolean isSingleSelectionMode()
-
setCommandPreviewListener
public void setCommandPreviewListener(BaseCommand.CommandActionPreview commandPreviewListener)
-
getCommandPreviewListener
public BaseCommand.CommandActionPreview getCommandPreviewListener()
-
syncSelectedCommand
private boolean syncSelectedCommand()
-
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener l)
Description copied from interface:ChangeAwareAdds the specified change listener to track changes to the underlying source.- Specified by:
addChangeListenerin interfaceChangeAware- Parameters:
l- Change listener to add.- See Also:
ChangeAware.removeChangeListener(ChangeListener)
-
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener l)
Description copied from interface:ChangeAwareRemoves the specified change listener from tracking changes to the underlying source.- Specified by:
removeChangeListenerin interfaceChangeAware- Parameters:
l- Change listener to remove.- See Also:
ChangeAware.removeChangeListener(ChangeListener)
-
fireStateChanged
private void fireStateChanged()
-
-