|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.pietschy.command.Command
com.pietschy.command.ActionCommand
com.pietschy.command.delegate.DelegatingCommand
com.pietschy.command.delegate.DelegatingToggleCommand
public class DelegatingToggleCommand
DelegatingToggleCommands provided equivalent functionality to DelegatingCommand for
ToggleCommands.
Like DelegatingCommand, this class provides static convenience methods for creating
and binding a number of delegating commands at once. The following example creates and binds
a number of DelegatingToggleCommands
DelegatingToggleCommand.bindAll(container, "toggle-one", "toggle-two", "toggle-three");
DelegatingCommand,
DelegatingToggleGroup,
FocusTrackingDelegateMediator| Field Summary | |
|---|---|
static java.lang.String |
PROPERTY_SELECTED
|
| Fields inherited from class com.pietschy.command.ActionCommand |
|---|
PARAMETER_ACTION_EVENT, PARAMETER_INVOKER, PARAMETER_INVOKER_WINDOW, PARAMETER_MODIFIERS |
| Fields inherited from class com.pietschy.command.Command |
|---|
internalLog, PROPERTY_ENABLED, PROPERTY_VISIBLE |
| Constructor Summary | |
|---|---|
DelegatingToggleCommand(java.lang.String id)
Creates a new instance with the specified id. |
|
| Method Summary | |
|---|---|
static void |
bindAll(CommandContainer container,
java.lang.String firstId,
java.lang.String... otherIds)
Creates delegating commands for each of the specified id's and binds them to the specified container. |
static void |
bindAll(java.awt.Component component,
java.lang.String firstId,
java.lang.String... otherIds)
Creates delegating commands for each of the specified id's and binds them to the specified component. |
static void |
bindAll(java.lang.String firstId,
java.lang.String... otherIds)
Creates delegating commands for each of the specified id's and binds them to the global command container. |
protected void |
configureButtonStates(javax.swing.AbstractButton button)
Overrides the default Command.configureButtonStates() to include the configuration of
the buttons selected state. |
javax.swing.AbstractButton |
createButton(ButtonFactory factory,
java.lang.String faceContext)
Creates a toggle button for this command. |
javax.swing.AbstractButton |
createCheckBox()
Creates a checkbox for this command using the default button factory and the button face. |
javax.swing.AbstractButton |
createCheckBox(ButtonFactory factory)
Creates a checkbox for this command using the specifed button factory and the button face. |
javax.swing.AbstractButton |
createCheckBox(ButtonFactory factory,
java.lang.String faceContext)
Creates a checkbox for this command using the specified ButtonFactory and Face. |
javax.swing.AbstractButton |
createCheckBox(java.lang.String faceContext)
Creates a checkbox for this command using the default button factory and the specified face. |
javax.swing.JMenuItem |
createMenuItem(MenuFactory factory,
java.lang.String faceContext)
Creates a new JCheckBoxMenuItem that is bound to this command. |
ToggleCommand |
getDelegate()
Gets this command delegate. |
boolean |
isSelected()
Checks if the delegate is selected. |
void |
requestDefaultIn(javax.swing.RootPaneContainer container)
Warning this method throws an UnsupportedOperationException as toggle commands are
implmented using JToggleButtons and default buttons must be instances of JButton. |
void |
setDelegate(ActionCommandExecutor newDelegate)
Sets the delegate for this command to use. |
void |
setSelected(boolean selected)
Sets the selected state of this command. |
protected void |
setSelectedInternal(boolean selected)
|
protected void |
updateDelegate()
|
protected void |
updateState()
|
| Methods inherited from class com.pietschy.command.delegate.DelegatingCommand |
|---|
getDelegateMediator, handleExecute, nullIfEqualsThis, setDelegateMediator |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.pietschy.command.ActionCommandExecutor |
|---|
addPropertyChangeListener, addPropertyChangeListener, isEnabled, removePropertyChangeListener, removePropertyChangeListener |
| Methods inherited from interface com.pietschy.command.Identifiable |
|---|
getId |
| Field Detail |
|---|
public static final java.lang.String PROPERTY_SELECTED
| Constructor Detail |
|---|
public DelegatingToggleCommand(java.lang.String id)
id - the id of the delegate this command is to track.| Method Detail |
|---|
public static void bindAll(CommandContainer container,
java.lang.String firstId,
java.lang.String... otherIds)
container - the container to bind the delegates to.firstId - the first delegate id in standard var-args editor.otherIds - any additional ids.
public static void bindAll(java.awt.Component component,
java.lang.String firstId,
java.lang.String... otherIds)
component - the component to bind the delegates to.firstId - the first delegate id in standard var-args editor.otherIds - any additional ids.
public static void bindAll(java.lang.String firstId,
java.lang.String... otherIds)
firstId - the first delegate id in standard var-args editor.otherIds - any additional ids.protected void updateDelegate()
public void setDelegate(ActionCommandExecutor newDelegate)
setDelegate in class DelegatingCommandpublic ToggleCommand getDelegate()
getDelegate in class DelegatingCommandprotected void updateState()
updateState in class DelegatingCommandpublic void setSelected(boolean selected)
selected - true to select the command, false otherwise.protected void setSelectedInternal(boolean selected)
public boolean isSelected()
true if and only if the delegate
is non-null and selected.
true if the delegate is non-null and selected, false otherwise.protected void configureButtonStates(javax.swing.AbstractButton button)
Command.configureButtonStates() to include the configuration of
the buttons selected state.
configureButtonStates in class Commandbutton - the button to initialize.
public javax.swing.JMenuItem createMenuItem(MenuFactory factory,
java.lang.String faceContext)
JCheckBoxMenuItem that is bound to this command.
createMenuItem in class Commandfactory - the menu factory to use.faceContext - the face context to use.
JCheckBoxMenuItem for this command.
public javax.swing.AbstractButton createButton(ButtonFactory factory,
java.lang.String faceContext)
createButton in class Commandfactory - the button factory to use.faceContext - the face context to use.sing the specified ButtonFactory and Face.
JToggleButton for this command.public javax.swing.AbstractButton createCheckBox()
JCheckBox for this command.public javax.swing.AbstractButton createCheckBox(java.lang.String faceContext)
JCheckBox for this command.public javax.swing.AbstractButton createCheckBox(ButtonFactory factory)
JCheckBox for this command.
public javax.swing.AbstractButton createCheckBox(ButtonFactory factory,
java.lang.String faceContext)
ButtonFactory and Face.
JCheckBox for this command.public void requestDefaultIn(javax.swing.RootPaneContainer container)
UnsupportedOperationException as toggle commands are
implmented using JToggleButtons and default buttons must be instances of JButton.
requestDefaultIn in class ActionCommandcontainer - the root pane container to check.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||