Package xal.extension.application
Class ActionFactory
java.lang.Object
xal.extension.application.ActionFactory
ActionFactory is a factory class with methods that can instantiate actions
for use in menus and the toolbar. All of the actions are standard
document-based application actions. In addition to actions, it also defines
menu handlers that get invoked when a menu is activated. Typically it menu
handlers are used to dynamically populate menus. For example there is
"documents" submenu under the "Window" menu that populates itself upon
selection with a list of menu items having one menu item for each open
document.
- Author:
- t6p
-
Method Summary
Modifier and TypeMethodDescriptionstatic Action
captureWindowAsImageAction
(xal.extension.application.XalAbstractDocument document) Make an action that captures the main window corresponding to the document as a PNG image and allows the user to save it to a file.protected static Action
cascadeWindowsAction
(xal.extension.application.XalAbstractDocument document) Cascade all document windows relative to the location of the window where the action was fired.protected static Action
openURLAction
(String urlSpec) Make an action that is used internally to open a file as specified by the given URL specification into a new document.protected static Action
showDocumentAction
(xal.extension.application.XalAbstractDocument document) Make an internal action used by the documentsHandler to show a specified document when that document is selected from the documents submenu.
-
Method Details
-
openURLAction
Make an action that is used internally to open a file as specified by the given URL specification into a new document. This action is used by the menu items in the dynamically generated submenu "Open Recent" in the "File" menu. The "Open Recent" submenu lists the URL specifications of the recently opened files.- Parameters:
urlSpec
- The URL specification of the file to open- Returns:
- An action that opens a file corresponding to the given URL specification
- See Also:
-
openRecentHandler()
-
showDocumentAction
Make an internal action used by the documentsHandler to show a specified document when that document is selected from the documents submenu.- Parameters:
document
- The document to be shown- Returns:
- An action that displays the window of the specified document
- See Also:
-
documentsHandler()
-
cascadeWindowsAction
protected static Action cascadeWindowsAction(xal.extension.application.XalAbstractDocument document) Cascade all document windows relative to the location of the window where the action was fired.- Parameters:
document
- The document about whose window all other windows will cascade- Returns:
- An action that cascades all windows in the application
-
captureWindowAsImageAction
public static Action captureWindowAsImageAction(xal.extension.application.XalAbstractDocument document) Make an action that captures the main window corresponding to the document as a PNG image and allows the user to save it to a file.- Parameters:
document
- The document whose main window should be captured- Returns:
- An action that captures the main window as a PNG image
-