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.CommandGroupListener
commandGroupListener
private java.beans.PropertyChangeListener
commandGroupPropertyChangeListener
private java.util.List<CommandGroup>
commandGroups
private BaseCommand.CommandActionPreview
commandPreviewListener
private java.beans.PropertyChangeListener
commandPropertyChangeListener
private boolean
isSingleSelectionMode
Indicates the selection mode for the toggle commands in the panel.private Command
selectedCommand
private WeakChangeSupport
weakChangeSupport
Stores 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 void
addChangeListener(javax.swing.event.ChangeListener l)
Adds the specified change listener to track changes to the underlying source.void
addCommandGroup(CommandGroup commandGroupModel)
Command
findFirstMatch(CommandGroup.CommandFilter commandFilter)
private void
fireStateChanged()
int
getCommandCount()
java.util.List<CommandGroup>
getCommandGroups()
BaseCommand.CommandActionPreview
getCommandPreviewListener()
Command
getSelectedCommand()
boolean
isSingleSelectionMode()
void
removeAllCommandGroups()
void
removeChangeListener(javax.swing.event.ChangeListener l)
Removes the specified change listener from tracking changes to the underlying source.void
removeCommandGroup(CommandGroup commandGroupModel)
void
setCommandPreviewListener(BaseCommand.CommandActionPreview commandPreviewListener)
void
setSingleSelectionMode(boolean isSingleSelectionMode)
Sets the selection mode for this model.private boolean
syncSelectedCommand()
-
-
-
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. Iftrue
is 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:ChangeAware
Adds the specified change listener to track changes to the underlying source.- Specified by:
addChangeListener
in 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:ChangeAware
Removes the specified change listener from tracking changes to the underlying source.- Specified by:
removeChangeListener
in interfaceChangeAware
- Parameters:
l
- Change listener to remove.- See Also:
ChangeAware.removeChangeListener(ChangeListener)
-
fireStateChanged
private void fireStateChanged()
-
-