ChangeAware, ContentModel, PropertyChangeAwareColorSelectorCommandpublic class Command extends java.lang.Object implements ContentModel, ChangeAware, PropertyChangeAware
Command.Builder to configure a new command, and Command.Builder.build() to build a command.
A command can be projected to screen (creating a visual representation of that command)
using CommandButtonPresentationModel and CommandButtonProjection. Use
project() for default presentation settings or
project(CommandButtonPresentationModel) to customize presentation settings. Then use
Projection.buildComponent() to get an instance of
JCommandButton that can be added to the component hierarchy.
Note that you can - and should - use the same Command instance and one or more
CommandButtonPresentationModels if you need to have multiple instances (or
projections) of the same command in your app UI. That way, changes in the command are propagated
and synced across all those projections.
| Modifier and Type | Class | Description |
|---|---|---|
static class |
Command.BaseBuilder<T extends Command,B extends Command.BaseBuilder<T,B>> |
|
static class |
Command.Builder |
|
static interface |
Command.CommandActionPreview |
| Modifier | Constructor | Description |
|---|---|---|
protected |
Command() |
| 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) |
|
static Command.Builder |
builder() |
|
CommandAction |
getAction() |
|
Command.CommandActionPreview |
getActionPreview() |
|
RichTooltip |
getActionRichTooltip() |
|
org.pushingpixels.neon.api.icon.ResizableIcon.Factory |
getDisabledIconFactory() |
|
java.lang.String |
getExtraText() |
|
org.pushingpixels.neon.api.icon.ResizableIcon.Factory |
getIconFactory() |
|
CommandMenuContentModel |
getSecondaryContentModel() |
|
RichTooltip |
getSecondaryRichTooltip() |
|
java.lang.String |
getText() |
|
CommandToggleGroupModel |
getToggleGroupModel() |
|
boolean |
isActionEnabled() |
|
boolean |
isSecondaryEnabled() |
|
boolean |
isToggle() |
|
boolean |
isToggleSelected() |
|
CommandButtonProjection<Command> |
project() |
|
CommandButtonProjection<Command> |
project(CommandButtonPresentationModel commandPresentation) |
|
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(Command.CommandActionPreview actionPreview) |
|
void |
setActionRichTooltip(RichTooltip actionRichTooltip) |
|
void |
setDisabledIconFactory(org.pushingpixels.neon.api.icon.ResizableIcon.Factory disabledIconFactory) |
|
void |
setExtraText(java.lang.String extraText) |
|
void |
setIconFactory(org.pushingpixels.neon.api.icon.ResizableIcon.Factory iconFactory) |
|
void |
setSecondaryEnabled(boolean secondaryEnabled) |
|
void |
setSecondaryRichTooltip(RichTooltip secondaryRichTooltip) |
|
void |
setText(java.lang.String text) |
|
void |
setToggleSelected(boolean isToggleSelected) |
public static Command.Builder builder()
public java.lang.String getText()
public void setText(java.lang.String text)
public org.pushingpixels.neon.api.icon.ResizableIcon.Factory getIconFactory()
public void setIconFactory(org.pushingpixels.neon.api.icon.ResizableIcon.Factory iconFactory)
public org.pushingpixels.neon.api.icon.ResizableIcon.Factory getDisabledIconFactory()
public void setDisabledIconFactory(org.pushingpixels.neon.api.icon.ResizableIcon.Factory disabledIconFactory)
public java.lang.String getExtraText()
public void setExtraText(java.lang.String extraText)
public CommandAction getAction()
public void setAction(CommandAction actionListener)
public RichTooltip getActionRichTooltip()
public void setActionRichTooltip(RichTooltip actionRichTooltip)
public CommandMenuContentModel getSecondaryContentModel()
public RichTooltip getSecondaryRichTooltip()
public void setSecondaryRichTooltip(RichTooltip secondaryRichTooltip)
public boolean isActionEnabled()
public void setActionEnabled(boolean actionEnabled)
public boolean isSecondaryEnabled()
public void setSecondaryEnabled(boolean secondaryEnabled)
public boolean isToggle()
public boolean isToggleSelected()
public void setToggleSelected(boolean isToggleSelected)
public CommandToggleGroupModel getToggleGroupModel()
public Command.CommandActionPreview getActionPreview()
public void setActionPreview(Command.CommandActionPreview actionPreview)
public void addChangeListener(javax.swing.event.ChangeListener l)
ChangeAwareaddChangeListener in interface ChangeAwarel - Change listener to add.ChangeAware.removeChangeListener(ChangeListener)public void removeChangeListener(javax.swing.event.ChangeListener l)
ChangeAwareremoveChangeListener in interface ChangeAwarel - Change listener to remove.ChangeAware.removeChangeListener(ChangeListener)public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
addPropertyChangeListener in interface PropertyChangeAwarepublic void removePropertyChangeListener(java.beans.PropertyChangeListener l)
removePropertyChangeListener in interface PropertyChangeAwarepublic CommandButtonProjection<Command> project()
public CommandButtonProjection<Command> project(CommandButtonPresentationModel commandPresentation)