Interface PopupMenuHandler
-
- All Known Implementing Classes:
SimplePopupMenuHandler
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 theActionManager
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 thePopupMenuHandler
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'sPopupMenuBuilder
method the menu will be displayed. (The handler can also decide not to invokePopupMenuBuilder.create()
create()
; in this case no menu will be displayed.)- Version:
- $Id: PopupMenuHandler.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
constructPopup(PopupMenuBuilder builder, ComponentBuilderData compData)
Asks this handler to create a popup menu using the specifiedPopupMenuBuilder
.
-
-
-
Method Detail
-
constructPopup
void constructPopup(PopupMenuBuilder builder, ComponentBuilderData compData) throws FormActionException
Asks this handler to create a popup menu using the specifiedPopupMenuBuilder
. An implementation can use the methods offered by the builder to create a menu with arbitrary actions and sub menus. On calling the builder'screate()
method the menu will be displayed. TheComponentBuilderData
object is a source of all available information: through theBeanContext
accessible through this object many important objects can be obtained including the current form or theActionStore
. So all actions required by thePopupMenuHandler
should be reachable through this object.- Parameters:
builder
- the builder for creating the menucompData
- the currentComponentBuilderData
object providing access to lots of context information- Throws:
FormActionException
- if an error occurs when creating the menu
-
-