public interface PopupMenuHandler
Definition of an interface for controlling popup menus that can be associated with GUI components.
With this interface a platform-independent way of associating popup menus
with specific UI elements can be realized. The basic idea is that the
interface provides the
ActionManager
registerPopupMenuHandler()
method for associating an object
implementing this interface with a UI element. This will cause a
platform-specific event handler being registered at said element, which
listens for gestures bringing up a context menu. When such a gesture is
detected the PopupMenuHandler
is invoked passing in a
implementation. Using this builder
object the handler can create an arbitrary complex menu. It is especially
free to adapt this menu to the current status of the application (it is
completely up to the handler, which actions it adds to the menu; it can even
add different actions on each invocation). When it calls the builder's
PopupMenuBuilder
method the menu will be
displayed. (The handler can also decide not to invoke PopupMenuBuilder.create()
create()
;
in this case no menu will be displayed.)
Modifier and Type | Method and Description |
---|---|
void |
constructPopup(PopupMenuBuilder builder,
ComponentBuilderData compData)
Asks this handler to create a popup menu using the specified
PopupMenuBuilder . |
void constructPopup(PopupMenuBuilder builder, ComponentBuilderData compData) throws FormActionException
PopupMenuBuilder
. An implementation can use the methods
offered by the builder to create a menu with arbitrary actions and sub
menus. On calling the builder's create()
method the menu
will be displayed. The ComponentBuilderData
object is a
source of all available information: through the BeanContext
accessible through this object many important objects can be obtained
including the current form or the ActionStore
. So all
actions required by the PopupMenuHandler
should be reachable
through this object.builder
- the builder for creating the menucompData
- the current ComponentBuilderData
object
providing access to lots of context informationFormActionException
- if an error occurs when creating the menuCopyright © 2016 The JGUIraffe Team. All rights reserved.