public abstract class ActionManagerWrapper extends Object implements ActionManager
A base class for wrapper implementations of the ActionManager
interface.
An instance of this class is initialized with a reference to an
ActionManager
object. All methods simply delegate to this object.
This class is especially useful if a custom implementation of
ActionManager
is to be created based on an existing implementation.
Then only the methods to be customized have to be implemented. All other
methods can still delegate to the existing implementation.
Modifier | Constructor and Description |
---|---|
protected |
ActionManagerWrapper(ActionManager wrapped)
Creates a new instance of
ActionManagerWrapper and initializes it
with the wrapped ActionManager . |
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.
|
ActionManager |
getWrappedActionManager()
Returns a reference to the wrapped
ActionManager object. |
void |
registerPopupMenuHandler(Object component,
PopupMenuHandler handler,
ComponentBuilderData compData)
Registers the specified
PopupMenuHandler at the given UI
component. |
protected ActionManagerWrapper(ActionManager wrapped)
ActionManagerWrapper
and initializes it
with the wrapped ActionManager
. Note: This method does not check
whether the passed in ActionManager
object is null because
we do not want to enforce this restriction on all subclasses. The passed
in wrapped action manager is stored in an internal field and can be
accessed using the getWrappedActionManager()
method. If a
subclass needs another mechanism to access the wrapped manager, it has to
override the getWrappedActionManager()
method.wrapped
- the wrapped ActionManager
public ActionManager getWrappedActionManager()
ActionManager
object.ActionManager
public FormAction createAction(ActionBuilder actionBuilder, ActionData actionData) throws FormActionException
ActionManager
object.createAction
in interface ActionManager
actionBuilder
- the central builder data objectactionData
- an object with all information about the action to
createFormActionException
- if an error occurspublic Object createMenuItem(ActionBuilder actionBuilder, FormAction action, boolean checked, Object parent) throws FormActionException
ActionManager
object.createMenuItem
in interface ActionManager
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 occurspublic ComponentHandler<?> createMenuItem(ActionBuilder actionBuilder, ActionData actionData, boolean checked, Object parent) throws FormActionException
ActionManager
object.createMenuItem
in interface ActionManager
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 occurspublic Object createMenuBar(ActionBuilder actionBuilder) throws FormActionException
ActionManager
object.createMenuBar
in interface ActionManager
actionBuilder
- the action builderFormActionException
- if an error occurspublic Object createMenu(ActionBuilder actionBuilder, Object menu, TextIconData data, Object parent) throws FormActionException
ActionManager
object.createMenu
in interface ActionManager
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 occurspublic Object createToolbar(ActionBuilder actionBuilder) throws FormActionException
ActionManager
object.createToolbar
in interface ActionManager
actionBuilder
- the action builderFormActionException
- if an error occurspublic Object createToolbarButton(ActionBuilder actionBuilder, FormAction action, boolean checked, Object parent) throws FormActionException
ActionManager
object.createToolbarButton
in interface ActionManager
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 occurspublic ComponentHandler<?> createToolbarButton(ActionBuilder actionBuilder, ActionData data, boolean checked, Object parent) throws FormActionException
ActionManager
object.createToolbarButton
in interface ActionManager
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 occurspublic void addMenuSeparator(ActionBuilder actionBuilder, Object menu) throws FormActionException
createMenu()
method. Just delegates to the wrapped ActionManager
object.addMenuSeparator
in interface ActionManager
actionBuilder
- the action buildermenu
- the menu to which the separator should be addedFormActionException
- if an error occurspublic void addToolBarSeparator(ActionBuilder actionBuilder, Object toolBar) throws FormActionException
createToolBar()
method. Just delegates to the wrapped ActionManager
object.addToolBarSeparator
in interface ActionManager
actionBuilder
- the action buildertoolBar
- the tool bar to which the separator should be addedFormActionException
- if an error occurspublic void 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. Just delegates to the wrapped ActionManager
object.registerPopupMenuHandler
in interface ActionManager
component
- the componenthandler
- the handler for creating the menucompData
- the ComponentBuilderData
objectFormActionException
- if an error occursCopyright © 2016 The JGUIraffe Team. All rights reserved.