org.araneaframework.framework
Interface OverlayContext

All Superinterfaces:
Serializable
All Known Implementing Classes:
StandardOverlayContainerWidget

public interface OverlayContext
extends Serializable

Another context interface that, in contrast to FlowContext and PopupWindowContext, deals with flow logic that is running in overlay mode.

Using OverlayContext assumes that the visual part of the application also supports it. One must register the OverlayContext in JSP with <ui:registerOverlay/> tag.

Since:
1.1
Author:
Alar Kvell (alar@araneaframework.org)

Nested Class Summary
static interface OverlayContext.OverlayActivityMarkerContext
          This is a marker interface to say that overlay mode is active by putting this interface class into the Environment.
 
Field Summary
static String OVERLAY_REQUEST_KEY
          The request parameter name identifying that the request comes from an overlay.
 
Method Summary
 Map getOverlayOptions()
          Provides the current options for overlay rendering.
 boolean isOverlayActive()
          Specifies whether the overlay mode is currently running and visible to the user.
 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 setOverlayOptions(Map options)
          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.
 

Field Detail

OVERLAY_REQUEST_KEY

public static final String OVERLAY_REQUEST_KEY
The request parameter name identifying that the request comes from an overlay.

See Also:
Constant Field Values
Method Detail

isOverlayActive

public boolean isOverlayActive()
Specifies whether the overlay mode is currently running and visible to the user.

Returns:
whether the overlay mode is currently active.

setOverlayOptions

public void setOverlayOptions(Map options)
Allows to specify custom overlay options as a Map. These options will be forwarded to the script that handles the overlay mode visually.

Parameters:
options - options as <String, String> pair.

getOverlayOptions

public Map getOverlayOptions()
Provides the current options for overlay rendering.

Returns:
the current options for overlay rendering.

replace

public void replace(Widget flow,
                    FlowContext.Configurator configurator)
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.

Parameters:
flow - The uninitialized widget that wishes to run.
configurator - Custom configuration for the new flow.

replace

public void replace(Widget flow)
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).

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

reset

public void reset(EnvironmentAwareCallback callback)
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.

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)
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.

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)
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.

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)
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.

Parameters:
flow - The uninitialized widget that should start to run.
See Also:
FlowContext.start(Widget)