Class BaseCommand<MCM extends BaseCommandMenuContentModel>
- java.lang.Object
-
- org.pushingpixels.radiance.component.api.common.model.BaseCommand<MCM>
-
- All Implemented Interfaces:
ChangeAware
,ContentModel
,PropertyChangeAware
- Direct Known Subclasses:
BasicRibbonBandUI.BandCollapseCommand
,ColorSelectorCommand
,Command
,RibbonApplicationMenuCommand
public abstract class BaseCommand<MCM extends BaseCommandMenuContentModel> extends java.lang.Object implements ContentModel, ChangeAware, PropertyChangeAware
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BaseCommand.BaseBuilder<T extends BaseCommand<MCM>,MCM extends BaseCommandMenuContentModel,B extends BaseCommand.BaseBuilder<T,MCM,B>>
static interface
BaseCommand.CommandActionPreview
static interface
BaseCommand.SecondaryLifecycle
-
Field Summary
Fields Modifier and Type Field Description private CommandAction
action
private BaseCommand.CommandActionPreview
actionPreview
private RichTooltip
actionRichTooltip
private java.lang.String
extraText
private RadianceIcon.Factory
iconFactory
private boolean
isActionEnabled
private boolean
isSecondaryEnabled
private boolean
isToggle
private boolean
isToggleSelected
private MCM
secondaryContentModel
private BaseCommand.SecondaryLifecycle
secondaryLifecycle
private RichTooltip
secondaryRichTooltip
private java.lang.Object
tag
private java.lang.String
text
private CommandToggleGroupModel
toggleGroupModel
private WeakChangeSupport
weakChangeSupport
Stores the listeners on this model.private WeakPropertyChangeSupport
weakPropertyChangeSupport
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseCommand()
-
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
addPropertyChangeListener(java.beans.PropertyChangeListener l)
protected void
checkConsistency()
private void
fireStateChanged()
CommandAction
getAction()
BaseCommand.CommandActionPreview
getActionPreview()
RichTooltip
getActionRichTooltip()
java.lang.String
getExtraText()
RadianceIcon.Factory
getIconFactory()
MCM
getSecondaryContentModel()
BaseCommand.SecondaryLifecycle
getSecondaryLifecycle()
RichTooltip
getSecondaryRichTooltip()
java.lang.Object
getTag()
java.lang.String
getText()
CommandToggleGroupModel
getToggleGroupModel()
boolean
hasSecondaryContent()
boolean
isActionEnabled()
boolean
isSecondaryEnabled()
boolean
isToggle()
boolean
isToggleSelected()
void
removeChangeListener(javax.swing.event.ChangeListener l)
Removes the specified change listener from tracking changes to the underlying source.void
removePropertyChangeListener(java.beans.PropertyChangeListener l)
void
setAction(CommandAction actionListener)
void
setActionEnabled(boolean actionEnabled)
void
setActionPreview(BaseCommand.CommandActionPreview actionPreview)
void
setActionRichTooltip(RichTooltip actionRichTooltip)
void
setExtraText(java.lang.String extraText)
void
setIconFactory(RadianceIcon.Factory iconFactory)
void
setSecondaryEnabled(boolean secondaryEnabled)
void
setSecondaryRichTooltip(RichTooltip secondaryRichTooltip)
void
setTag(java.lang.Object tag)
void
setText(java.lang.String text)
void
setToggleSelected(boolean isToggleSelected)
-
-
-
Field Detail
-
text
private java.lang.String text
-
extraText
private java.lang.String extraText
-
iconFactory
private RadianceIcon.Factory iconFactory
-
action
private CommandAction action
-
actionPreview
private BaseCommand.CommandActionPreview actionPreview
-
isActionEnabled
private boolean isActionEnabled
-
isToggle
private boolean isToggle
-
isToggleSelected
private boolean isToggleSelected
-
actionRichTooltip
private RichTooltip actionRichTooltip
-
secondaryContentModel
private MCM extends BaseCommandMenuContentModel secondaryContentModel
-
secondaryLifecycle
private BaseCommand.SecondaryLifecycle secondaryLifecycle
-
secondaryRichTooltip
private RichTooltip secondaryRichTooltip
-
isSecondaryEnabled
private boolean isSecondaryEnabled
-
toggleGroupModel
private CommandToggleGroupModel toggleGroupModel
-
tag
private java.lang.Object tag
-
weakChangeSupport
private final WeakChangeSupport weakChangeSupport
Stores the listeners on this model.
-
weakPropertyChangeSupport
private final WeakPropertyChangeSupport weakPropertyChangeSupport
-
-
Method Detail
-
checkConsistency
protected void checkConsistency()
-
getText
public java.lang.String getText()
-
setText
public void setText(java.lang.String text)
-
getIconFactory
public RadianceIcon.Factory getIconFactory()
-
setIconFactory
public void setIconFactory(RadianceIcon.Factory iconFactory)
-
getExtraText
public java.lang.String getExtraText()
-
setExtraText
public void setExtraText(java.lang.String extraText)
-
getAction
public CommandAction getAction()
-
setAction
public void setAction(CommandAction actionListener)
-
getActionRichTooltip
public RichTooltip getActionRichTooltip()
-
setActionRichTooltip
public void setActionRichTooltip(RichTooltip actionRichTooltip)
-
hasSecondaryContent
public boolean hasSecondaryContent()
-
getSecondaryContentModel
public MCM getSecondaryContentModel()
-
getSecondaryLifecycle
public BaseCommand.SecondaryLifecycle getSecondaryLifecycle()
-
getSecondaryRichTooltip
public RichTooltip getSecondaryRichTooltip()
-
setSecondaryRichTooltip
public void setSecondaryRichTooltip(RichTooltip secondaryRichTooltip)
-
isActionEnabled
public boolean isActionEnabled()
-
setActionEnabled
public void setActionEnabled(boolean actionEnabled)
-
isSecondaryEnabled
public boolean isSecondaryEnabled()
-
setSecondaryEnabled
public void setSecondaryEnabled(boolean secondaryEnabled)
-
isToggle
public boolean isToggle()
-
isToggleSelected
public boolean isToggleSelected()
-
setToggleSelected
public void setToggleSelected(boolean isToggleSelected)
-
getToggleGroupModel
public CommandToggleGroupModel getToggleGroupModel()
-
getActionPreview
public BaseCommand.CommandActionPreview getActionPreview()
-
setActionPreview
public void setActionPreview(BaseCommand.CommandActionPreview actionPreview)
-
getTag
public java.lang.Object getTag()
-
setTag
public void setTag(java.lang.Object tag)
-
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()
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
- Specified by:
addPropertyChangeListener
in interfacePropertyChangeAware
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
- Specified by:
removePropertyChangeListener
in interfacePropertyChangeAware
-
-