public interface ActionManager
Definition of an interface for a component that creates GUI library specific action objects and related classes.
This interface plays a similar role for the action builder as the
ComponentManager
interface for the form builder: It hides the details of creating GUI library
specific objects. Instead of form elements this interface deals with objects
like actions, menus, and toolbar buttons.
There will be concrete implementations of this interface for all supported GUI libraries. When the action builder is invoked, an implementation must be provided. This object is then accessed by Jelly tag handler classes to create the objects they represent. With the objects created by this implementation the action related components of an application can be constructed.
Note: This interface is not intended to be directly
implemented by client code. It is subject to change even in minor releases as
new features are made available. Therefore if an application needs to provide
a custom implementation of this interface, it should extend an existing
implementation. For instance, the ActionManagerWrapper
class is a
good candidate if only a subset of methods is to be modified.
Modifier and Type | Method and Description |
---|---|
void |
addMenuSeparator(ActionBuilder actionBuilder,
Object menu)
Adds a separator to the specified menu.
|
void |
addToolBarSeparator(ActionBuilder actionBuilder,
Object toolBar)
Adds a separator to the specified tool bar.
|
FormAction |
createAction(ActionBuilder actionBuilder,
ActionData actionData)
Creates an action object based on the provided information.
|
Object |
createMenu(ActionBuilder actionBuilder,
Object menu,
TextIconData data,
Object parent)
Creates a (sub) menu.
|
Object |
createMenuBar(ActionBuilder actionBuilder)
Creates a menu bar.
|
ComponentHandler<?> |
createMenuItem(ActionBuilder actionBuilder,
ActionData actionData,
boolean checked,
Object parent)
Creates a menu item based on the specified action data object and returns
a component handler for it.
|
Object |
createMenuItem(ActionBuilder actionBuilder,
FormAction action,
boolean checked,
Object parent)
Creates a menu item based on the specified action object.
|
Object |
createToolbar(ActionBuilder actionBuilder)
Creates a toolbar object.
|
ComponentHandler<?> |
createToolbarButton(ActionBuilder actionBuilder,
ActionData data,
boolean checked,
Object parent)
Creates a toolbar button based on the given action data object and
returns a component handler for it.
|
Object |
createToolbarButton(ActionBuilder actionBuilder,
FormAction action,
boolean checked,
Object parent)
Creates a toolbar button based on the specified action object.
|
void |
registerPopupMenuHandler(Object component,
PopupMenuHandler handler,
ComponentBuilderData compData)
Registers the specified
PopupMenuHandler at the given UI
component. |
FormAction createAction(ActionBuilder actionBuilder, ActionData actionData) throws FormActionException
actionBuilder
- the central builder data objectactionData
- an object with all information about the action to
createFormActionException
- if an error occursObject createMenuItem(ActionBuilder actionBuilder, FormAction action, boolean checked, Object parent) throws FormActionException
actionBuilder
- the action builderaction
- the actionchecked
- a flag if a checked menu item should be createdparent
- the parent menu to which the new item should be addedFormActionException
- if an error occursComponentHandler<?> createMenuItem(ActionBuilder actionBuilder, ActionData actionData, boolean checked, Object parent) throws FormActionException
actionBuilder
- the action builderactionData
- an object with all information about the menu itemchecked
- a flag if a checked menu item should be createdparent
- the parent menu to which the new item should be addedFormActionException
- if an error occursObject createMenuBar(ActionBuilder actionBuilder) throws FormActionException
actionBuilder
- the action builderFormActionException
- if an error occursObject createMenu(ActionBuilder actionBuilder, Object menu, TextIconData data, Object parent) throws FormActionException
actionBuilder
- the action buildermenu
- the menu object; this will be null on the first call;
on the second call the object returned by the first call will be passeddata
- data defining the new menuparent
- the parent menuFormActionException
- if an error occursObject createToolbar(ActionBuilder actionBuilder) throws FormActionException
actionBuilder
- the action builderFormActionException
- if an error occursObject createToolbarButton(ActionBuilder actionBuilder, FormAction action, boolean checked, Object parent) throws FormActionException
actionBuilder
- the action builderaction
- the actionchecked
- a flag if a checked (toggle) button should be createdparent
- the parent component (a toolbar) to which the new button
should be addedFormActionException
- if an error occursComponentHandler<?> createToolbarButton(ActionBuilder actionBuilder, ActionData data, boolean checked, Object parent) throws FormActionException
actionBuilder
- the action builderdata
- a data object defining all properties of the buttonchecked
- a flag if a checked (toggle) button should be createdparent
- the parent component (a toolbar) to which the new button
should be addedFormActionException
- if an error occursvoid addMenuSeparator(ActionBuilder actionBuilder, Object menu) throws FormActionException
createMenu()
method.actionBuilder
- the action buildermenu
- the menu to which the separator should be addedFormActionException
- if an error occursvoid addToolBarSeparator(ActionBuilder actionBuilder, Object toolBar) throws FormActionException
createToolBar()
method.actionBuilder
- the action buildertoolBar
- the tool bar to which the separator should be addedFormActionException
- if an error occursvoid registerPopupMenuHandler(Object component, PopupMenuHandler handler, ComponentBuilderData compData) throws FormActionException
PopupMenuHandler
at the given UI
component. This will cause the handler to be invoked whenever the user
triggers the context menu for this component (e.g. by right clicking it
with the mouse). A concrete implementation has to install a proper event
listener at the component that takes care of calling the handler when it
detects a gesture that should bring up the context menu.component
- the componenthandler
- the handler for creating the menucompData
- the ComponentBuilderData
objectFormActionException
- if an error occursCopyright © 2016 The JGUIraffe Team. All rights reserved.