org.araneaframework.uilib.core
Class BaseMenuWidget

java.lang.Object
  extended by org.araneaframework.core.BaseComponent
      extended by org.araneaframework.core.BaseService
          extended by org.araneaframework.core.BaseWidget
              extended by org.araneaframework.core.BaseApplicationWidget
                  extended by org.araneaframework.framework.container.StandardFlowContainerWidget
                      extended by org.araneaframework.framework.container.ExceptionHandlingFlowContainerWidget
                          extended by org.araneaframework.uilib.core.BaseMenuWidget
All Implemented Interfaces:
Serializable, Component, Composite, Composite.CompositeComponent, Composite.CompositeService, Composite.CompositeWidget, ApplicationComponent, ApplicationService, ApplicationWidget, FlowContext, FlowContextWidget, Service, MenuContext, Viewable, Viewable.ViewableComponent, Viewable.ViewableService, Viewable.ViewableWidget, Widget

public abstract class BaseMenuWidget
extends ExceptionHandlingFlowContainerWidget
implements MenuContext

The base implementation of the menu context that handles a menu. All custom menu contexts should extend it, and describe the menu structure in buildMenu().

Author:
Taimo Peelo (taimo@araneaframework.org)
See Also:
Serialized Form

Nested Class Summary
protected  class BaseMenuWidget.ItemSelectionListener
          Menu selection listener.
 
Nested classes/interfaces inherited from class org.araneaframework.framework.container.StandardFlowContainerWidget
StandardFlowContainerWidget.CallFrame, StandardFlowContainerWidget.CancelClosure, StandardFlowContainerWidget.FinishClosure, StandardFlowContainerWidget.FlowReference, StandardFlowContainerWidget.ReplaceClosure, StandardFlowContainerWidget.ResetClosure, StandardFlowContainerWidget.StandardTransitionHandler, StandardFlowContainerWidget.StartClosure
 
Nested classes/interfaces inherited from class org.araneaframework.core.BaseApplicationWidget
BaseApplicationWidget.CompositeImpl, BaseApplicationWidget.ViewableImpl, BaseApplicationWidget.ViewModel
 
Nested classes/interfaces inherited from class org.araneaframework.core.BaseWidget
BaseWidget.WidgetImpl
 
Nested classes/interfaces inherited from class org.araneaframework.core.BaseService
BaseService.ServiceImpl
 
Nested classes/interfaces inherited from class org.araneaframework.core.BaseComponent
BaseComponent.ComponentImpl
 
Nested classes/interfaces inherited from interface org.araneaframework.framework.FlowContext
FlowContext.Configurator, FlowContext.Handler, FlowContext.TransitionHandler
 
Nested classes/interfaces inherited from interface org.araneaframework.Widget
Widget.Interface
 
Nested classes/interfaces inherited from interface org.araneaframework.core.ApplicationWidget
ApplicationWidget.WidgetViewModel
 
Nested classes/interfaces inherited from interface org.araneaframework.core.ApplicationService
ApplicationService.ServiceViewModel
 
Nested classes/interfaces inherited from interface org.araneaframework.core.ApplicationComponent
ApplicationComponent.ComponentViewModel
 
Nested classes/interfaces inherited from interface org.araneaframework.Composite
Composite.CompositeComponent, Composite.CompositeService, Composite.CompositeWidget
 
Nested classes/interfaces inherited from interface org.araneaframework.Viewable
Viewable.ViewableComponent, Viewable.ViewableService, Viewable.ViewableWidget
 
Nested classes/interfaces inherited from interface org.araneaframework.Composite
Composite.CompositeComponent, Composite.CompositeService, Composite.CompositeWidget
 
Nested classes/interfaces inherited from interface org.araneaframework.Viewable
Viewable.ViewableComponent, Viewable.ViewableService, Viewable.ViewableWidget
 
Nested classes/interfaces inherited from interface org.araneaframework.Composite
Composite.CompositeComponent, Composite.CompositeService, Composite.CompositeWidget
 
Nested classes/interfaces inherited from interface org.araneaframework.Viewable
Viewable.ViewableComponent, Viewable.ViewableService, Viewable.ViewableWidget
 
Field Summary
protected  MenuItem menu
          The container (a root) that holds the menu items.
 
Fields inherited from class org.araneaframework.framework.container.ExceptionHandlingFlowContainerWidget
exception
 
Fields inherited from class org.araneaframework.framework.container.StandardFlowContainerWidget
callStack, finishable, top
 
Fields inherited from class org.araneaframework.core.BaseService
currentInputData, currentOutputData
 
Fields inherited from interface org.araneaframework.uilib.core.MenuContext
MENU_SELECT_EVENT_KEY, MENU_VIEWDATA_KEY
 
Fields inherited from interface org.araneaframework.framework.FlowContext
TRANSITION_CANCEL, TRANSITION_FINISH, TRANSITION_REPLACE, TRANSITION_RESET, TRANSITION_START
 
Fields inherited from interface org.araneaframework.core.ApplicationWidget
EVENT_HANDLER_ID_KEY, EVENT_PARAMETER_KEY, EVENT_PATH_KEY
 
Fields inherited from interface org.araneaframework.core.ApplicationService
ACTION_HANDLER_ID_KEY, ACTION_PARAMETER_KEY, ACTION_PATH_KEY
 
Constructor Summary
BaseMenuWidget(Widget topWidget)
          Constructor that initializes the menu widget and sets the topWidget as its parent
 
Method Summary
protected abstract  MenuItem buildMenu()
          Method that must be implemented to build the menu.
protected  Environment getChildWidgetEnvironment()
          Returns the widget's Environment by default.
 MenuItem getMenu()
          Provides access to the (full) menu.
 String getSelectionPath()
          Provides the Path of the currently selected menu item as a String.
protected  void init()
          Initializes the menu.
protected  void initMenuSelectorMountSupport()
          Initializes the menu selector that works with bookmarks.
 void selectMenuItem(String menuItemPath)
          Selects (activates) the requested menu item.
 void setMenu(MenuItem menu)
          Specifies the menu to use and show.
 
Methods inherited from class org.araneaframework.framework.container.ExceptionHandlingFlowContainerWidget
event, handleEventCancel, handleEventReset, handleEventRetry, handleWidgetException, propagate, render, renderExceptionHandler, update
 
Methods inherited from class org.araneaframework.framework.container.StandardFlowContainerWidget
addFrameWidget, addNestedEnvironmentEntry, cancel, destroy, doCancel, doFinish, doReplace, doReset, doStart, doTransition, finish, getActiveCallFrame, getActiveFlow, getCallStack, getCurrentReference, getTransitionHandler, isNested, makeCallFrame, putLocalEnvironmentEntries, replace, replace, reset, setFinishable, setTop, setTransitionHandler, start, start, start
 
Methods inherited from class org.araneaframework.core.BaseApplicationWidget
_getComposite, _getViewable, action, addActionListener, addEventListener, addWidget, addWidget, clearActionListeners, clearEventlisteners, clearGlobalEventListener, disableWidget, enableWidget, getActionId, getChildEnvironment, getChildren, getEnvironment, getEventId, getViewModel, getWidget, handleAction, handleEvent, handleUpdate, putViewData, putViewDataOnce, removeActionListener, removeEventListener, removeViewData, removeWidget, setGlobalEventListener
 
Methods inherited from class org.araneaframework.core.BaseWidget
_getWidget, getInputData, getOutputData
 
Methods inherited from class org.araneaframework.core.BaseService
_getService, handleServiceException
 
Methods inherited from class org.araneaframework.core.BaseComponent
_addComponent, _addComponent, _checkCall, _disableComponent, _enableComponent, _endCall, _endWaitingCall, _getChildren, _getComponent, _getDisabledChildren, _propagate, _relocateComponent, _removeComponent, _setEnvironment, _setScope, _startCall, _startWaitingCall, _strictCheckCall, _strictStartCall, _waitNoCall, disable, enable, getScope, handleException, isAlive, isDead, isInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.araneaframework.Widget
_getWidget
 
Methods inherited from interface org.araneaframework.Service
_getService
 
Methods inherited from interface org.araneaframework.Component
_getComponent, getEnvironment, getScope, isAlive
 

Field Detail

menu

protected MenuItem menu
The container (a root) that holds the menu items.

Constructor Detail

BaseMenuWidget

public BaseMenuWidget(Widget topWidget)
               throws Exception
Constructor that initializes the menu widget and sets the topWidget as its parent

Parameters:
topWidget - The parent widget.
Throws:
Exception - Any non-specific runtime exception that may occur.
Method Detail

init

protected void init()
             throws Exception
Initializes the menu. Also marks it as not finishable (it means that this widget does not inovke FlowContext.finish() nor FlowContext.cancel()).

Overrides:
init in class ExceptionHandlingFlowContainerWidget
Throws:
Exception - Any non-specific exception that may occur.

getChildWidgetEnvironment

protected Environment getChildWidgetEnvironment()
                                         throws Exception
Description copied from class: BaseApplicationWidget
Returns the widget's Environment by default. Usually overridden.

Overrides:
getChildWidgetEnvironment in class StandardFlowContainerWidget
Throws:
Exception

initMenuSelectorMountSupport

protected void initMenuSelectorMountSupport()
Initializes the menu selector that works with bookmarks.

Since:
1.1.1

selectMenuItem

public void selectMenuItem(String menuItemPath)
                    throws Exception
Description copied from interface: MenuContext
Selects (activates) the requested menu item.

Specified by:
selectMenuItem in interface MenuContext
Parameters:
menuItemPath - The full path of the menu item.
Throws:
Exception - Any non-specific exception that may occur.

buildMenu

protected abstract MenuItem buildMenu()
                               throws Exception
Method that must be implemented to build the menu.

Returns:
built menu.
Throws:
Exception - Any non-specific runtime exception that may occur.

getSelectionPath

public String getSelectionPath()
Provides the Path of the currently selected menu item as a String.

Returns:
the path of the currently selected menu item, or null
Since:
1.1.1

getMenu

public MenuItem getMenu()
Description copied from interface: MenuContext
Provides access to the (full) menu.

Specified by:
getMenu in interface MenuContext
Returns:
the menu.

setMenu

public void setMenu(MenuItem menu)
Description copied from interface: MenuContext
Specifies the menu to use and show.

Specified by:
setMenu in interface MenuContext
Parameters:
menu - the new menu