org.araneaframework.framework.container
Class StandardOverlayContainerWidget

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.StandardOverlayContainerWidget
All Implemented Interfaces:
Serializable, Component, Composite, Composite.CompositeComponent, Composite.CompositeService, Composite.CompositeWidget, ApplicationComponent, ApplicationService, ApplicationWidget, OverlayContext, Service, Viewable, Viewable.ViewableComponent, Viewable.ViewableService, Viewable.ViewableWidget, Widget

public class StandardOverlayContainerWidget
extends BaseApplicationWidget
implements OverlayContext

Since:
1.1
Author:
Alar Kvell (alar@araneaframework.org), Taimo Peelo (taimo@araneaframework.org)
See Also:
Serialized Form

Nested Class Summary
 
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.OverlayContext
OverlayContext.OverlayActivityMarkerContext
 
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.Widget
Widget.Interface
 
Field Summary
static Map DEFAULT_PRESENTATION_OPTIONS
           Map containing the default overlay presentation options.
protected  Map presentationOptions
           
 
Fields inherited from class org.araneaframework.core.BaseService
currentInputData, currentOutputData
 
Fields inherited from interface org.araneaframework.framework.OverlayContext
OVERLAY_REQUEST_KEY
 
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
StandardOverlayContainerWidget()
           
 
Method Summary
protected  void action(Path path, InputData input, OutputData output)
          If Path.hasNext() routes to the action to child, otherwise calls the appropriate ActionListener.
protected  void assertActiveHierarchy(Path path, String message)
          Asserts that the current widget is in the active hierarchy.
 void cancel()
          Similar to FlowContext.cancel() but closes the entire OverlayContext not just the last flow widget.
protected  void event(Path path, InputData input)
          If path hasNextStep() routes to the correct child, otherwise calls the appropriate listener.
 void finish(Object result)
          /** Similar to FlowContext.finish(Object) but closes the entire OverlayContext not just the last flow widget.
protected  Environment getChildWidgetEnvironment()
          Returns the widget's Environment by default.
 Map getOverlayOptions()
          Provides the current options for overlay rendering.
protected  void init()
          Init callback.
 boolean isOverlayActive()
          Specifies whether the overlay mode is currently running and visible to the user.
protected  void render(OutputData output)
          Renders the component to output, meant for overriding.
 void replace(Widget flow)
          Destroys the current flow and starts a new one inside the overlay mode.
 void replace(Widget flow, FlowContext.Configurator configurator)
          Destroys the current flow and starts a new one inside the overlay mode.
 void reset(EnvironmentAwareCallback callback)
          Resets all currently running flows inside the overlay mode and calls the callback allowing to start new flows.
 void setMain(Widget main)
           
 void setOverlay(FlowContextWidget overlay)
           
 void setOverlayOptions(Map presentationOptions)
          Allows to specify custom overlay options as a Map.
 void start(Widget flow)
          Starts a new nested flow inside the overlay mode.
 void start(Widget flow, FlowContext.Configurator configurator, FlowContext.Handler handler)
          Starts a new nested flow inside the overlay mode, that can be configured using the configurator.
 void start(Widget flow, FlowContext.Handler handler)
          Starts a new nested flow inside the overlay mode.
protected  void update(InputData input)
           
 
Methods inherited from class org.araneaframework.core.BaseApplicationWidget
_getComposite, _getViewable, addActionListener, addEventListener, addWidget, addWidget, clearActionListeners, clearEventlisteners, clearGlobalEventListener, disableWidget, enableWidget, getActionId, getChildEnvironment, getChildren, getEnvironment, getEventId, getViewModel, getWidget, handleAction, handleEvent, handleUpdate, propagate, putViewData, putViewDataOnce, removeActionListener, removeEventListener, removeViewData, removeWidget, setGlobalEventListener
 
Methods inherited from class org.araneaframework.core.BaseWidget
_getWidget, getInputData, getOutputData, handleWidgetException
 
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, destroy, 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, getScope, isAlive
 

Field Detail

DEFAULT_PRESENTATION_OPTIONS

public static final Map DEFAULT_PRESENTATION_OPTIONS

Map containing the default overlay presentation options. Default values are as follows:


presentationOptions

protected Map presentationOptions
Constructor Detail

StandardOverlayContainerWidget

public StandardOverlayContainerWidget()
Method Detail

setMain

public void setMain(Widget main)

setOverlay

public void setOverlay(FlowContextWidget overlay)

isOverlayActive

public boolean isOverlayActive()
Description copied from interface: OverlayContext
Specifies whether the overlay mode is currently running and visible to the user.

Specified by:
isOverlayActive in interface OverlayContext
Returns:
whether the overlay mode is currently active.

getChildWidgetEnvironment

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

Overrides:
getChildWidgetEnvironment in class BaseApplicationWidget
Throws:
Exception

init

protected void init()
             throws Exception
Description copied from class: BaseComponent
Init callback. Gets called when the component is initilized.

Overrides:
init in class BaseComponent
Throws:
Exception - Any runtime exception that may occur.

update

protected void update(InputData input)
               throws Exception
Overrides:
update in class BaseApplicationWidget
Throws:
Exception

event

protected void event(Path path,
                     InputData input)
              throws Exception
Description copied from class: BaseApplicationWidget
If path hasNextStep() routes to the correct child, otherwise calls the appropriate listener.

Overrides:
event in class BaseApplicationWidget
Throws:
Exception

action

protected void action(Path path,
                      InputData input,
                      OutputData output)
               throws Exception
Description copied from class: BaseApplicationWidget
If Path.hasNext() routes to the action to child, otherwise calls the appropriate ActionListener.

Overrides:
action in class BaseApplicationWidget
Parameters:
path - The path of the component to whom the action is targeted.
input - The request data.
output - The response data.
Throws:
Exception - Any runtime exception that may occur.

assertActiveHierarchy

protected void assertActiveHierarchy(Path path,
                                     String message)
Asserts that the current widget is in the active hierarchy. If not, the execution will fail with an exception.

Parameters:
path - Path of the widget (from the request).
message - A description message to include with the exception.
Since:
1.1.2

render

protected void render(OutputData output)
               throws Exception
Description copied from class: BaseApplicationWidget
Renders the component to output, meant for overriding.

Overrides:
render in class BaseApplicationWidget
Throws:
Exception

replace

public void replace(Widget flow)
Description copied from interface: OverlayContext
Destroys the current flow and starts a new one inside the overlay mode. When the new flow ends execution, it will return control to the caller of the current flow (no matter whether it is inside the overlay mode or not).

Specified by:
replace in interface OverlayContext
Parameters:
flow - The uninitialized widget that should start to run.
See Also:
FlowContext.replace(Widget)

replace

public void replace(Widget flow,
                    FlowContext.Configurator configurator)
Description copied from interface: OverlayContext
Destroys the current flow and starts a new one inside the overlay mode. When the new flow ends execution, it will return control to the caller of the current flow (no matter whether it is inside the overlay mode or not). Started subflow can be configured using the configurator.

Specified by:
replace in interface OverlayContext
Parameters:
flow - The uninitialized widget that wishes to run.
configurator - Custom configuration for the new flow.

reset

public void reset(EnvironmentAwareCallback callback)
Description copied from interface: OverlayContext
Resets all currently running flows inside the overlay mode and calls the callback allowing to start new flows. Useful e.g. in a menu, when selecting a new menu item and reseting the old stack.

Specified by:
reset in interface OverlayContext
Parameters:
callback - The callback to handle the calling of new flows.
See Also:
FlowContext.reset(EnvironmentAwareCallback)

start

public void start(Widget flow,
                  FlowContext.Configurator configurator,
                  FlowContext.Handler handler)
Description copied from interface: OverlayContext
Starts a new nested flow inside the overlay mode, that can be configured using the configurator. Current flow becomes inactive untils subflow calls FlowContext.finish(Object) or FlowContext.cancel(). handler allows to receive a notification, when the subflow ends execution.

The flow is the only mandatory parameter.

Specified by:
start in interface OverlayContext
Parameters:
flow - The uninitialized widget that should start to run.
configurator - The configuration handler for the widget.
handler - Allows to receive noticifation when the widget finishes or cancels the flow.

start

public void start(Widget flow,
                  FlowContext.Handler handler)
Description copied from interface: OverlayContext
Starts a new nested flow inside the overlay mode. Current flow becomes inactive untils subflow calls FlowContext.finish(Object) or FlowContext.cancel(). handler allows to receive a notification, when the subflow ends execution.

The flow is the only mandatory parameter.

Specified by:
start in interface OverlayContext
Parameters:
flow - The uninitialized widget that should start to run.
handler - Allows to receive noticifation when the widget finishes or cancels the flow.

start

public void start(Widget flow)
Description copied from interface: OverlayContext
Starts a new nested flow inside the overlay mode. Current flow becomes inactive untils subflow calls FlowContext.finish(Object) or FlowContext.cancel().

The flow is mandatory parameter.

Specified by:
start in interface OverlayContext
Parameters:
flow - The uninitialized widget that should start to run.
See Also:
FlowContext.start(Widget)

getOverlayOptions

public Map getOverlayOptions()
Description copied from interface: OverlayContext
Provides the current options for overlay rendering.

Specified by:
getOverlayOptions in interface OverlayContext
Returns:
the current options for overlay rendering.

setOverlayOptions

public void setOverlayOptions(Map presentationOptions)
Description copied from interface: OverlayContext
Allows to specify custom overlay options as a Map. These options will be forwarded to the script that handles the overlay mode visually.

Specified by:
setOverlayOptions in interface OverlayContext
Parameters:
presentationOptions - options as <String, String> pair.

finish

public void finish(Object result)
Description copied from interface: OverlayContext
/** Similar to FlowContext.finish(Object) but closes the entire OverlayContext not just the last flow widget.

Specified by:
finish in interface OverlayContext
Parameters:
result - The result to return from the overlay context.

cancel

public void cancel()
Description copied from interface: OverlayContext
Similar to FlowContext.cancel() but closes the entire OverlayContext not just the last flow widget.

Specified by:
cancel in interface OverlayContext