Package dsto.dfc.swt.commands

Framework for defining and presenting user commands in a UI.

See:
          Description

Interface Summary
Command Defines a command that may presented in a UI.
CommandListener Defines the events fired by Command's.
CommandMenuItemProvider Interface for providers of menu command representations (eg menu button, checkboxes, etc).
CommandToolbarItemProvider Interface for providers of toolbar command representations (eg buttons, checkboxes, etc).
CommandViewNodeListener Defines the events fired by CommandViewNode's.
CustomMenuCommand Interface for commands that wish to provide a custom menu UI.
CustomToolbarCommand Interface for commands that wish to provide a custom toolbar UI.
 

Class Summary
AbstractAboutCommand Base for commands that show an "about box.
AbstractAddEntryCommand Base class for commands that add a new entry to a control.
AbstractCommand Base class for most commands.
AbstractCommandItemProvider Abstract base class for command UI providers that represent a command with an SWT Item.
AbstractCopyCommand  
AbstractCutCommand  
AbstractDeleteCommand Basic delete command.
AbstractPasteCommand  
AbstractPropertiesCommand Base class for Properties type commands.
BasicExitCommand Base class for Exit commands.
BasicToggleCommand Base class for commands that can be "on" or "off".
CmdChangeDataObjectProperty Command to change a property of one or more target data objects.
CmdSetBeanProperty Command that sets the value of a Bean property (ie via a setX () method).
CmdToggleWindowStyle Command to toggle a style setting on a JFace window.
CommandButtonProvider Connects and synchronises a button with a command.
CommandEvent  
CommandKeyStrokeBinding Binds a widget key stroke listener to a Command.
CommandMenuButtonProvider Command UI provider that generates a MenuItem for the command.
CommandMenuCheckboxProvider Command UI provider that generates a checkbox MenuItem for the command.
CommandRegistry Registry of view to group mappings for commands.
Commands Generic command utility methods.
CommandToolbarButtonProvider Command UI provider that generates a ToolItem for the command.
CommandToolbarCheckboxProvider Command UI provider that generates a checkbox ToolItem for the command.
CommandView A list of Command's and sub-CommandView's intended to define the commands presented in a given UI context, such as a main menu or a toolbar.
CommandViewMenuBarProvider Synchronizes a menu bar with a CommandView.
CommandViewMenuProvider Synchronizes a popup menu with a CommandView.
CommandViewNode A node used to build the merged command trees used by CommandView's.
CommandViewNodeEvent  
CommandViewToolBarProvider Synchronizes a command view with a SWT CoolBar.
 

Package dsto.dfc.swt.commands Description

Framework for defining and presenting user commands in a UI. Commands are defined by the dsto.dfc.commands.Command interface and assembled into views (dsto.dfc.commands.CommandView) for presentation in menus, toolbars, etc. Command views may be contained inside command views, providing a way of composing commands from many different components.

Typically a component will create one command view for each type of UI (context menu, main menu, toolbar) and export them via its dsto.dfc.commands.CommandSource#getCommandView method. The component, or any of its clients, may add, remove or change commands in the command view at any time, the framework will ensure that the updates propagate and are reflected in the UI.

To create a UI presentation of a command view, use either dsto.dfc.commands.CommandToolBars#makeToolBar or one of the methods in dsto.dfc.commands.CommandMenus. You can use the installContextMenu method as a convenient way to install a context menu that will popup on a right mouse click.

See the source for dsto.dfc.table.DfcTable and dsto.dfc.tree.DfcTree for detailed examples of how to create and export command views.

Command groups

Each command has a logical group within in a given command view (see dsto.dfc.commands.Command#getGroupInView) which determines how it is visually grouped in the UI. For example, the edit.Cut command may have the group "Edit.cutnpaste" in the main menu view, which would put it under the "Edit" menu in a group delimited by menu separators along with other commands in the "cutnpaste" subgroup. The same command may have the group "edit" in a context menu or toolbar, both of which typically have a "flatter" structure than the main menu. Commands with a deep level of nesting will be placed inside pullright menus (or dropdown menus on a toolbar) eg the "view.Zoom To Fit" command might have the main menu group "View.zooming.Zoom.top" which would put it on a pullright "Zoom" menu.



Copyright © 2008 Commonwealth of Australia