Class Commands
- java.lang.Object
-
- ca.cgjennings.apps.arkham.commands.Commands
-
public class Commands extends java.lang.ObjectStandard command actions supported by Strange Eons.- Since:
- 3.0
- Author:
- Chris Jennings
-
-
Field Summary
Fields Modifier and Type Field Description static AbstractCommandABOUTDisplays the About dialog.static DelegatedCommandALIGN_BOTTOMAligns the selected objects to the bottom edge of the most recently selected object.static DelegatedCommandALIGN_CENTERAligns the selected objects to the horizontal centre of the most recently selected object.static DelegatedCommandALIGN_LEFTAligns the selected objects to the left edge of the most recently selected object.static DelegatedCommandALIGN_MIDDLEAligns the selected objects to the vertical middle of the most recently selected object.static DelegatedCommandALIGN_RIGHTAligns the selected objects to the right edge of the most recently selected object.static DelegatedCommandALIGN_TOPAligns the selected objects to the top edge of the most recently selected object.static DelegatedCommandCENTER_CONTENTCenters all content on a deck page.static DelegatedCommandCLEARClears all content from editors that support this command.static AbstractCommandCLOSECloses the active editor.static AbstractCommandCLOSE_ALLCloses all open editors.static AbstractCommandCLOSE_PROJECTCloses the open project, if any.static AbstractCommandCODE_ABBREVIATIONSDisplays the source code abbreviation table editor.static DelegatedCommandCOMMENT_OUTComments out the selected lines in a code editor.static DelegatedCommandCOMPLETE_CODEOpens the code completion popup in the current code editor, if available.static AbstractCommandCONFIGURE_UPDATESOpens a dialog box that allows the user to configure update notifications.static DelegatedCommandCOPYADelegatedCommandfor the clipboard copy operation.static DelegatedCommandCOPY_STYLECopy the style information for the current selection into the global style clipboard.static DelegatedCommandCUTADelegatedCommandfor the clipboard cut operation.static DelegatedCommandDEBUG_FILEDebugs the script in the active code editor.static DelegatedCommandDISTRIBUTE_HORZDistributes the selected objects evenly across the horizontal axis.static DelegatedCommandDISTRIBUTE_VERTDistributes the selected objects evenly across the vertical axis.static DelegatedCommandEDIT_PAGE_ITEMEdits the selected an item in a deck; if the selection has more than one object in it, only the last-selected item is considered.static DelegatedCommandEDIT_STYLEOpens the style editor for the selected page items in a deck.static AbstractCommandEXITExits the application after giving the user a chance to save open files with unsaved changes.static DelegatedCommandEXPANSION_CHOOSEOpens anExpansionSelectionDialogfor the active game component editor.static DelegatedCommandEXPANSION_COPYCopies the expansion symbol on the current component.static DelegatedCommandEXPANSION_NEWCreates a new expansion symbol.static DelegatedCommandEXPANSION_PASTEPastes the last-copies expansion symbol onto the current component.static DelegatedCommandEXPORTExports content from editors that support this command.static AbstractCommandFILE_BUG_REPORTFiles a bug report with no specific message or exception information.static DelegatedCommandFINDActivates a search tool in an editor that supports this command.static AbstractCommandFIND_IN_PROJECTActivates the find in project field, making it visible if necessary.static DelegatedCommandFLIP_HORZMirrors the deck selection horizontally.static DelegatedCommandFLIP_VERTMirrors the deck selection vertically.static DelegatedCommandFORMAT_CODEFormats (pretty prints) the current editor content, if a suitable formatter is available.static DelegatedCommandGROUPGroups together the selected objects.static DelegatedCommandHELPCommand that displays context-sensitive help.static java.lang.StringHELP_CONTEXT_PROPERTYA client property that names a Web page that shows help for that part of the interface.static AbstractCommandHELP_DEV_JAVA_APIOpens the Java API documentation for browsing.static AbstractCommandHELP_DEV_JS_APIOpens the JS API documentation for browsing.static AbstractCommandHELP_DEV_MANUALOpens the Developer Manual for browsing.static AbstractCommandHELP_TRANSLATOR_MANUALOpens the Translation Manual for browsing.static AbstractCommandHELP_USER_MANUALOpens the User Manual for browsing.static DelegatedCommandLOCKLocks the selected deck items.static AbstractCommandMAKE_BUNDLEMakes the bundle associated with the open editor file (or project view selection).static AbstractCommandMARKUP_ABBREVIATIONSDisplays the markup abbreviation table editor.static DelegatedCommandMARKUP_ALIGNMENTOpens a dialog that allows the user to modify the paragraph attributes of a block of markup text.static DelegatedCommandMARKUP_BOLDInserts or removes bold tags around the selected text.static DelegatedCommandMARKUP_HEADINGInserts or removes heading tags around the selected text.static DelegatedCommandMARKUP_INSERT_CHARACTERSOpens a dialog that allows the user to select an symbol or character to be inserted into the markup target.static DelegatedCommandMARKUP_INSERT_COLOUROpens a dialog that allows the user to modify the paragraph attributes of a block of markup text.static DelegatedCommandMARKUP_INSERT_FONTOpens a dialog that allows the user to modify the font attributes of a block of markup text.static DelegatedCommandMARKUP_INSERT_IMAGEOpens a dialog that allows the user to select an image, a tag for which will be inserted into the markup target.static DelegatedCommandMARKUP_ITALICInserts or removes italic tags around the selected text.static DelegatedCommandMARKUP_STRIKETHROUGHInserts or removes strikethrough tags around the selected text.static DelegatedCommandMARKUP_SUBHEADINGInserts or removes subheading tags around the selected text.static DelegatedCommandMARKUP_SUBSCRIPTInserts or removes subscript tags around the selected text.static DelegatedCommandMARKUP_SUPERSCRIPTInserts or removes superscript tags around the selected text.static DelegatedCommandMARKUP_UNDERLINEInserts or removes underline tags around the selected text.static DelegatedCommandMOVE_LINES_DOWNMoves the selected lines down in a code editor.static DelegatedCommandMOVE_LINES_UPMoves the selected lines up in a code editor.static AbstractCommandNEW_GAME_COMPONENTDisplays a dialog that allows the user to create a new game component.static AbstractCommandNEW_PROJECTDisplays a dialog that allows the user to create a new project.static AbstractCommandOPENDisplays a dialog that allows the user to open game components.static AbstractCommandOPEN_PROJECTDisplays a dialog that allows the user to open a project.static DelegatedCommandPASTEADelegatedCommandfor the clipboard paste operation.static DelegatedCommandPASTE_STYLEApply the current global style clipboard style settings to the deck selection.static AbstractCommandPLUGIN_CATALOGOpens the plug-in catalog.static AbstractCommandPLUGIN_MANAGEROpens the plug-in manager.static AbstractCommandPREFERENCESShows the Preferences dialog using the default location and category.static DelegatedCommandPRINTPrints content from editors that support this command.static DelegatedCommandREMOVE_TRAILING_SPACESRemoves trailing spaces from the ends of source lines.static DelegatedCommandRUN_FILERuns the script in the active code editor.static DelegatedCommandSAVESaves the current document in editors that support this command.static AbstractCommandSAVE_ALLSaves every open editor that supports theSAVEcommand and has unsaved changes.static DelegatedCommandSAVE_ASSaves the current document under a new name in editors that support this command.static DelegatedCommandSELECT_ALLADelegatedCommandfor selecting all content in a component that supports selection.static DelegatedCommandSELECT_INVERSEInverts the current selection.static DelegatedCommandSELECT_RESTORERestores the previous selection in a deck.static DelegatedCommandSORTSorts selected lines in a code editor.static DelegatedCommandSPIN_OFFAdds a clone of the current document to the application.static AbstractCommandTEST_BUNDLETests the bundle associated with the open editor file (or project view selection).static DelegatedCommandTO_BACKMoves the selected objects behind other objects in a deck.static DelegatedCommandTO_FRONTMoves the selected objects in front of other objects in a deck.static DelegatedCommandTURN_180Turns the deck selection 180 degrees.static DelegatedCommandTURN_LEFTTurns the deck selection left.static DelegatedCommandTURN_RIGHTTurns the deck selection right.static DelegatedCommandUNGROUPBreaks up the selected group into separate objects.static DelegatedCommandUNLOCKLocks the selected deck items.static DelegatedCommandUNLOCK_ALLUnlocks all locked deck items.static AbstractToggleCommandVIEW_CONTEXT_BARToggles visibility of the context bar.static AbstractToggleCommandVIEW_DECK_GRIDToggles visibility of snapping grid in decks.static AbstractToggleCommandVIEW_DECK_HANDLESToggles visibility of drag handles in decks.static AbstractToggleCommandVIEW_DECK_MARGINToggles visibility of page margins in decks.static AbstractToggleCommandVIEW_EDGE_BOXESToggles visibility of card outline on game component previews, which helps when debugging component layouts.static AbstractToggleCommandVIEW_INK_SAVEREnables and disables Ink Saver mode.static AbstractToggleCommandVIEW_PORTRAIT_BOXESToggles visibility of region boxes on game component previews, which helps when debugging component layouts.static AbstractToggleCommandVIEW_REGION_BOXESToggles visibility of region boxes on game component previews, which helps when debugging component layouts.static AbstractToggleCommandVIEW_SOURCE_NAVIGATORToggles visibility of the source code navigator.static AbstractToggleCommandVIEW_UNSAFE_BOXESToggles visibility of bleed margin box on game component previews, which helps when debugging component layouts.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.swing.JMenuItemfindCommand(javax.swing.JMenuBar menu, AbstractCommand command)Returns the item in a menu bar that will execute the specified command, ornullif the menu does not contain such an item.static javax.swing.JMenuItemfindCommand(javax.swing.JMenu menu, AbstractCommand command)Returns the item in a menu that will execute the specified command, ornullif the menu does not contain such an item.static javax.swing.JMenuItemfindCommand(javax.swing.JPopupMenu menu, AbstractCommand command)Returns the item in a popup menu that will execute the specified command, ornullif the menu does not contain such an item.static CommandablefindCommandable(AbstractCommand command)Returns a command handler that is currently able to handle this command by following a default search strategy.static voidregisterCommandable(Commandable commandable)Registers a new command handler to be consulted when trying to execute aDelegatedCommand.static voidunregisterCommandable(Commandable commandable)Unregisters a previously registered command handler.
-
-
-
Field Detail
-
NEW_GAME_COMPONENT
public static final AbstractCommand NEW_GAME_COMPONENT
Displays a dialog that allows the user to create a new game component.
-
NEW_PROJECT
public static final AbstractCommand NEW_PROJECT
Displays a dialog that allows the user to create a new project.
-
OPEN
public static final AbstractCommand OPEN
Displays a dialog that allows the user to open game components.
-
OPEN_PROJECT
public static final AbstractCommand OPEN_PROJECT
Displays a dialog that allows the user to open a project.
-
CLOSE
public static final AbstractCommand CLOSE
Closes the active editor. If the editor has unsaved changes, the user will be given the option to save the file or cancel the command.
-
CLOSE_ALL
public static final AbstractCommand CLOSE_ALL
Closes all open editors. If any editor has unsaved changes, the user will be given the option to save the file or cancel the command.
-
CLOSE_PROJECT
public static final AbstractCommand CLOSE_PROJECT
Closes the open project, if any.
-
SAVE
public static final DelegatedCommand SAVE
Saves the current document in editors that support this command.
-
SAVE_AS
public static final DelegatedCommand SAVE_AS
Saves the current document under a new name in editors that support this command.
-
SAVE_ALL
public static final AbstractCommand SAVE_ALL
Saves every open editor that supports theSAVEcommand and has unsaved changes.
-
EXPORT
public static final DelegatedCommand EXPORT
Exports content from editors that support this command.
-
PRINT
public static final DelegatedCommand PRINT
Prints content from editors that support this command.
-
EXIT
public static final AbstractCommand EXIT
Exits the application after giving the user a chance to save open files with unsaved changes.
-
SPIN_OFF
public static final DelegatedCommand SPIN_OFF
Adds a clone of the current document to the application.
-
CLEAR
public static final DelegatedCommand CLEAR
Clears all content from editors that support this command.
-
CUT
public static final DelegatedCommand CUT
ADelegatedCommandfor the clipboard cut operation. The default action will attempt to perform a cut in the active component, or your editor can handle the command itself.
-
COPY
public static final DelegatedCommand COPY
ADelegatedCommandfor the clipboard copy operation. The default action will attempt to perform a copy in the active component, or your editor can handle the command itself.
-
PASTE
public static final DelegatedCommand PASTE
ADelegatedCommandfor the clipboard paste operation. The default action will attempt to perform a paste in the active component, or your editor can handle the command itself.
-
SELECT_ALL
public static final DelegatedCommand SELECT_ALL
ADelegatedCommandfor selecting all content in a component that supports selection. The default action will attempt to perform a select all in the active component, (such as a text field or a list that supports multiple selection) or your editor can handle the command itself.
-
FIND
public static final DelegatedCommand FIND
Activates a search tool in an editor that supports this command.
-
FIND_IN_PROJECT
public static final AbstractCommand FIND_IN_PROJECT
Activates the find in project field, making it visible if necessary.
-
PREFERENCES
public static final AbstractCommand PREFERENCES
Shows the Preferences dialog using the default location and category.
-
VIEW_INK_SAVER
public static final AbstractToggleCommand VIEW_INK_SAVER
Enables and disables Ink Saver mode.
-
VIEW_CONTEXT_BAR
public static final AbstractToggleCommand VIEW_CONTEXT_BAR
Toggles visibility of the context bar.
-
VIEW_DECK_HANDLES
public static final AbstractToggleCommand VIEW_DECK_HANDLES
Toggles visibility of drag handles in decks.
-
VIEW_DECK_GRID
public static final AbstractToggleCommand VIEW_DECK_GRID
Toggles visibility of snapping grid in decks.
-
VIEW_DECK_MARGIN
public static final AbstractToggleCommand VIEW_DECK_MARGIN
Toggles visibility of page margins in decks.
-
VIEW_SOURCE_NAVIGATOR
public static final AbstractToggleCommand VIEW_SOURCE_NAVIGATOR
Toggles visibility of the source code navigator.
-
VIEW_REGION_BOXES
public static final AbstractToggleCommand VIEW_REGION_BOXES
Toggles visibility of region boxes on game component previews, which helps when debugging component layouts.
-
VIEW_PORTRAIT_BOXES
public static final AbstractToggleCommand VIEW_PORTRAIT_BOXES
Toggles visibility of region boxes on game component previews, which helps when debugging component layouts.
-
VIEW_UNSAFE_BOXES
public static final AbstractToggleCommand VIEW_UNSAFE_BOXES
Toggles visibility of bleed margin box on game component previews, which helps when debugging component layouts.
-
VIEW_EDGE_BOXES
public static final AbstractToggleCommand VIEW_EDGE_BOXES
Toggles visibility of card outline on game component previews, which helps when debugging component layouts.
-
EXPANSION_NEW
public static final DelegatedCommand EXPANSION_NEW
Creates a new expansion symbol.
-
EXPANSION_COPY
public static final DelegatedCommand EXPANSION_COPY
Copies the expansion symbol on the current component.
-
EXPANSION_PASTE
public static final DelegatedCommand EXPANSION_PASTE
Pastes the last-copies expansion symbol onto the current component.
-
EXPANSION_CHOOSE
public static final DelegatedCommand EXPANSION_CHOOSE
Opens anExpansionSelectionDialogfor the active game component editor.
-
MARKUP_ALIGNMENT
public static final DelegatedCommand MARKUP_ALIGNMENT
Opens a dialog that allows the user to modify the paragraph attributes of a block of markup text.
-
MARKUP_INSERT_COLOUR
public static final DelegatedCommand MARKUP_INSERT_COLOUR
Opens a dialog that allows the user to modify the paragraph attributes of a block of markup text.
-
MARKUP_INSERT_FONT
public static final DelegatedCommand MARKUP_INSERT_FONT
Opens a dialog that allows the user to modify the font attributes of a block of markup text.
-
MARKUP_BOLD
public static final DelegatedCommand MARKUP_BOLD
Inserts or removes bold tags around the selected text.
-
MARKUP_ITALIC
public static final DelegatedCommand MARKUP_ITALIC
Inserts or removes italic tags around the selected text.
-
MARKUP_UNDERLINE
public static final DelegatedCommand MARKUP_UNDERLINE
Inserts or removes underline tags around the selected text.
-
MARKUP_STRIKETHROUGH
public static final DelegatedCommand MARKUP_STRIKETHROUGH
Inserts or removes strikethrough tags around the selected text.
-
MARKUP_SUPERSCRIPT
public static final DelegatedCommand MARKUP_SUPERSCRIPT
Inserts or removes superscript tags around the selected text.
-
MARKUP_SUBSCRIPT
public static final DelegatedCommand MARKUP_SUBSCRIPT
Inserts or removes subscript tags around the selected text.
-
MARKUP_HEADING
public static final DelegatedCommand MARKUP_HEADING
Inserts or removes heading tags around the selected text.
-
MARKUP_SUBHEADING
public static final DelegatedCommand MARKUP_SUBHEADING
Inserts or removes subheading tags around the selected text.
-
MARKUP_INSERT_IMAGE
public static final DelegatedCommand MARKUP_INSERT_IMAGE
Opens a dialog that allows the user to select an image, a tag for which will be inserted into the markup target.
-
MARKUP_INSERT_CHARACTERS
public static final DelegatedCommand MARKUP_INSERT_CHARACTERS
Opens a dialog that allows the user to select an symbol or character to be inserted into the markup target.
-
MARKUP_ABBREVIATIONS
public static final AbstractCommand MARKUP_ABBREVIATIONS
Displays the markup abbreviation table editor.
-
TO_FRONT
public static final DelegatedCommand TO_FRONT
Moves the selected objects in front of other objects in a deck.
-
TO_BACK
public static final DelegatedCommand TO_BACK
Moves the selected objects behind other objects in a deck.
-
GROUP
public static final DelegatedCommand GROUP
Groups together the selected objects.
-
UNGROUP
public static final DelegatedCommand UNGROUP
Breaks up the selected group into separate objects.
-
ALIGN_LEFT
public static final DelegatedCommand ALIGN_LEFT
Aligns the selected objects to the left edge of the most recently selected object.
-
ALIGN_CENTER
public static final DelegatedCommand ALIGN_CENTER
Aligns the selected objects to the horizontal centre of the most recently selected object.
-
ALIGN_RIGHT
public static final DelegatedCommand ALIGN_RIGHT
Aligns the selected objects to the right edge of the most recently selected object.
-
ALIGN_TOP
public static final DelegatedCommand ALIGN_TOP
Aligns the selected objects to the top edge of the most recently selected object.
-
ALIGN_MIDDLE
public static final DelegatedCommand ALIGN_MIDDLE
Aligns the selected objects to the vertical middle of the most recently selected object.
-
ALIGN_BOTTOM
public static final DelegatedCommand ALIGN_BOTTOM
Aligns the selected objects to the bottom edge of the most recently selected object.
-
DISTRIBUTE_HORZ
public static final DelegatedCommand DISTRIBUTE_HORZ
Distributes the selected objects evenly across the horizontal axis.
-
DISTRIBUTE_VERT
public static final DelegatedCommand DISTRIBUTE_VERT
Distributes the selected objects evenly across the vertical axis.
-
TURN_LEFT
public static final DelegatedCommand TURN_LEFT
Turns the deck selection left.
-
TURN_RIGHT
public static final DelegatedCommand TURN_RIGHT
Turns the deck selection right.
-
TURN_180
public static final DelegatedCommand TURN_180
Turns the deck selection 180 degrees.
-
FLIP_HORZ
public static final DelegatedCommand FLIP_HORZ
Mirrors the deck selection horizontally.
-
FLIP_VERT
public static final DelegatedCommand FLIP_VERT
Mirrors the deck selection vertically.
-
CENTER_CONTENT
public static final DelegatedCommand CENTER_CONTENT
Centers all content on a deck page.
-
LOCK
public static final DelegatedCommand LOCK
Locks the selected deck items.
-
UNLOCK
public static final DelegatedCommand UNLOCK
Locks the selected deck items.
-
UNLOCK_ALL
public static final DelegatedCommand UNLOCK_ALL
Unlocks all locked deck items.
-
EDIT_PAGE_ITEM
public static final DelegatedCommand EDIT_PAGE_ITEM
Edits the selected an item in a deck; if the selection has more than one object in it, only the last-selected item is considered.
-
EDIT_STYLE
public static final DelegatedCommand EDIT_STYLE
Opens the style editor for the selected page items in a deck.
-
COPY_STYLE
public static final DelegatedCommand COPY_STYLE
Copy the style information for the current selection into the global style clipboard.
-
PASTE_STYLE
public static final DelegatedCommand PASTE_STYLE
Apply the current global style clipboard style settings to the deck selection.
-
SELECT_INVERSE
public static final DelegatedCommand SELECT_INVERSE
Inverts the current selection.
-
SELECT_RESTORE
public static final DelegatedCommand SELECT_RESTORE
Restores the previous selection in a deck.
-
RUN_FILE
public static final DelegatedCommand RUN_FILE
Runs the script in the active code editor.
-
DEBUG_FILE
public static final DelegatedCommand DEBUG_FILE
Debugs the script in the active code editor.
-
TEST_BUNDLE
public static final AbstractCommand TEST_BUNDLE
Tests the bundle associated with the open editor file (or project view selection).
-
MAKE_BUNDLE
public static final AbstractCommand MAKE_BUNDLE
Makes the bundle associated with the open editor file (or project view selection).
-
MOVE_LINES_UP
public static final DelegatedCommand MOVE_LINES_UP
Moves the selected lines up in a code editor.
-
MOVE_LINES_DOWN
public static final DelegatedCommand MOVE_LINES_DOWN
Moves the selected lines down in a code editor.
-
COMMENT_OUT
public static final DelegatedCommand COMMENT_OUT
Comments out the selected lines in a code editor.
-
REMOVE_TRAILING_SPACES
public static final DelegatedCommand REMOVE_TRAILING_SPACES
Removes trailing spaces from the ends of source lines.
-
SORT
public static final DelegatedCommand SORT
Sorts selected lines in a code editor.
-
COMPLETE_CODE
public static final DelegatedCommand COMPLETE_CODE
Opens the code completion popup in the current code editor, if available.
-
FORMAT_CODE
public static final DelegatedCommand FORMAT_CODE
Formats (pretty prints) the current editor content, if a suitable formatter is available.
-
CODE_ABBREVIATIONS
public static final AbstractCommand CODE_ABBREVIATIONS
Displays the source code abbreviation table editor.
-
CONFIGURE_UPDATES
public static final AbstractCommand CONFIGURE_UPDATES
Opens a dialog box that allows the user to configure update notifications.
-
PLUGIN_CATALOG
public static final AbstractCommand PLUGIN_CATALOG
Opens the plug-in catalog.
-
PLUGIN_MANAGER
public static final AbstractCommand PLUGIN_MANAGER
Opens the plug-in manager.
-
HELP
public static final DelegatedCommand HELP
Command that displays context-sensitive help. The command searches the component tree of the control with focus. It looks for either a component of typeJHelpButtonor else a component with the client propertyHELP_CONTEXT_PROPERTYset. If either of these is found, the help page that they describe is displayed. If no suitable page is found, then the User Manual will be displayed instead.The action command of the action event used to fire the command can be the name of a help page to open, either the title of a Wiki article or a URL. In this case, that page is opened directly instead of searching the component tree.
-
HELP_CONTEXT_PROPERTY
public static final java.lang.String HELP_CONTEXT_PROPERTY
A client property that names a Web page that shows help for that part of the interface. The property value should be aString. The value can either be the name of a page in the Wiki or else the URL of a Web page.- See Also:
HELP, Constant Field Values
-
HELP_USER_MANUAL
public static final AbstractCommand HELP_USER_MANUAL
Opens the User Manual for browsing.
-
HELP_DEV_MANUAL
public static final AbstractCommand HELP_DEV_MANUAL
Opens the Developer Manual for browsing.
-
HELP_TRANSLATOR_MANUAL
public static final AbstractCommand HELP_TRANSLATOR_MANUAL
Opens the Translation Manual for browsing.
-
HELP_DEV_JS_API
public static final AbstractCommand HELP_DEV_JS_API
Opens the JS API documentation for browsing.
-
HELP_DEV_JAVA_API
public static final AbstractCommand HELP_DEV_JAVA_API
Opens the Java API documentation for browsing.
-
FILE_BUG_REPORT
public static final AbstractCommand FILE_BUG_REPORT
Files a bug report with no specific message or exception information.
-
ABOUT
public static final AbstractCommand ABOUT
Displays the About dialog.- See Also:
StrangeEonsAppWindow.showAboutDialog()
-
-
Method Detail
-
findCommandable
public static Commandable findCommandable(AbstractCommand command)
Returns a command handler that is currently able to handle this command by following a default search strategy. The exact strategy used to find a relevantCommandablemay change in future versions, but it is guaranteed that:- any registered handlers will be consulted first (in order of registration)
- the active editor (if any) will be consulted after any registered handlers
- the main application window will be consulted last
nullis returned instead.Note that if you wish to create a command that is delegated to a
Commandablethat can be discovered through this method, it is sufficient to subclassDelegatedCommand.- Parameters:
command- the command to find a handler for; typically this is an instance ofDelegatedCommand- Returns:
- a command handler that can currently handle the command, or
nullif none can be found - Throws:
java.lang.NullPointerException- if the command isnull
-
registerCommandable
public static void registerCommandable(Commandable commandable)
Registers a new command handler to be consulted when trying to execute aDelegatedCommand.- Parameters:
commandable- the command handler to consult- Throws:
java.lang.NullPointerException- if the commandable isnull- See Also:
findCommandable(ca.cgjennings.apps.arkham.commands.AbstractCommand),unregisterCommandable(ca.cgjennings.apps.arkham.commands.Commandable)
-
unregisterCommandable
public static void unregisterCommandable(Commandable commandable)
Unregisters a previously registered command handler.- Parameters:
commandable- the commandable to unregister- See Also:
registerCommandable(ca.cgjennings.apps.arkham.commands.Commandable)
-
findCommand
public static javax.swing.JMenuItem findCommand(javax.swing.JPopupMenu menu, AbstractCommand command)Returns the item in a popup menu that will execute the specified command, ornullif the menu does not contain such an item.- Parameters:
menu- the menu to searchcommand- the command to search for- Returns:
- the item within the menu tree that contains the command
-
findCommand
public static javax.swing.JMenuItem findCommand(javax.swing.JMenu menu, AbstractCommand command)Returns the item in a menu that will execute the specified command, ornullif the menu does not contain such an item.- Parameters:
menu- the menu to searchcommand- the command to search for- Returns:
- the item within the menu tree that contains the command
-
findCommand
public static javax.swing.JMenuItem findCommand(javax.swing.JMenuBar menu, AbstractCommand command)Returns the item in a menu bar that will execute the specified command, ornullif the menu does not contain such an item.- Parameters:
menu- the menu bar whose menus should be searched, ornullto use the main application windowcommand- the command to search for- Returns:
- the item within the menu tree that contains the command
-
-