public interface DialogContext
Interface describing the current state of a particular dialog context instance.
IMPLEMENTATION NOTE - Implementations of this interface will be stored in session scope, so they should be serializable.
Modifier and Type | Method and Description |
---|---|
void |
addDialogContextListener(DialogContextListener listener)
Register given
DialogContextListener for this DialogContext . |
void |
advance(javax.faces.context.FacesContext context,
String outcome)
Advance the execution of this
DialogContext instance,
until an interaction with the user is required. |
Object |
getData()
Return the generic data object representing model state for this
dialog instance.
|
DialogContextListener[] |
getDialogContextListeners()
Return the set of currently registered
DialogContextListener s. |
String |
getId()
Return the context identifier for this instance of the specified
dialog.
|
String |
getName()
Return the logical name of the dialog being executed by this instance.
|
Object |
getOpaqueState()
Return an opaque object containing any state information (besides the
context identifier, which is already saved) that this
DialogContext
instance would like to have saved in the JavaServer Faces component tree,
and then restored (via a call to setOpaqueData() on the
subsequent form submit. |
DialogContext |
getParent()
Return the parent
DialogContext instance associated with this
child DialogContext , if any; otherwise, return null . |
boolean |
isActive()
Return
true if this DialogContext is currently
active (created but not yet removed). |
void |
removeDialogContextListener(DialogContextListener listener)
Remove this previously registered
DialogContextListener for this
DialogContext . |
void |
setData(Object data)
Set the generic data object representing model state for this
dialog instance.
|
void |
setOpaqueState(Object opaqueState)
Restore state information that was previously returned by a call to
getOpaqueState() on this DialogContext instance. |
void |
start(javax.faces.context.FacesContext context)
Start the execution of this
DialogContext instance,
advancing until an interaction with the user is required. |
void |
stop(javax.faces.context.FacesContext context)
Stop the execution of this
DialogContext instance,
resulting in no currently active dialog for the current
JavaServer Faces view. |
boolean isActive()
Return true
if this DialogContext
is currently
active (created but not yet removed).
Object getData()
Return the generic data object representing model state for this dialog instance.
void setData(Object data)
Set the generic data object representing model state for this
dialog instance. As a value added feature, if the class of the
specified data object implements DialogContextListener
,
ensure that the data object is registered as a listener with this
DialogContext
, and deregistered when the DialogContext
is completed (or this instance is replaced).
data
- The new data instanceString getId()
Return the context identifier for this instance of the specified dialog.
String getName()
Return the logical name of the dialog being executed by this instance.
DialogContext
is an instance ofObject getOpaqueState()
Return an opaque object containing any state information (besides the
context identifier, which is already saved) that this DialogContext
instance would like to have saved in the JavaServer Faces component tree,
and then restored (via a call to setOpaqueData()
on the
subsequent form submit. If there is no such information to be recorded,
return null
.
IMPLEMENTATION NOTE - Because this object will be
stored as part of the JSF component tree, it must be Serializable
.
WARNING - This method should ONLY be called by the dialog framework infrastructure. It should NOT be called by the application.
void setOpaqueState(Object opaqueState)
Restore state information that was previously returned by a call to
getOpaqueState()
on this DialogContext
instance.
If the previous call to getOpaqueState()
returned null
,
this method will NOT be called.
WARNING - This method should ONLY be called by the dialog framework infrastructure. It should NOT be called by the application.
opaqueState
- The opaque state object that was previously returned
by a call to getOpaqueState()
after potentially being
serialized and deserialized by the JSF state saving functionalityDialogContext getParent()
Return the parent DialogContext
instance associated with this
child DialogContext
, if any; otherwise, return null
.
DialogContext
, may be nullIllegalStateException
- if a parent DialogContext
initially
associated with this DialogContext
is no longer availablevoid advance(javax.faces.context.FacesContext context, String outcome)
Advance the execution of this DialogContext
instance,
until an interaction with the user is required. At that
point, navigate to the appropriate view, call
FacesContext.renderResponse()
, and return.
context
- FacesContext for the current requestoutcome
- Logical outcome to use for driving a transition
out of a state that was waiting for user input, or null
if no transition should be performedIllegalStateException
- if this DialogContext
instance has not yet been startedvoid start(javax.faces.context.FacesContext context)
Start the execution of this DialogContext
instance,
advancing until an interaction with the user is required.
At that point, navigate to the appropriate view, call
FacesContext.renderResopnse()
, and return.
context
- FacesContext for the current requestIllegalStateException
- if this DialogContext
instance has already been startedvoid stop(javax.faces.context.FacesContext context)
Stop the execution of this DialogContext
instance,
resulting in no currently active dialog for the current
JavaServer Faces view.
context
- FacesContext for the current requestIllegalStateException
- if this DialogContext
instance has not yet been startedvoid addDialogContextListener(DialogContextListener listener)
listener
- The DialogContextListener
instance.DialogContextListener[] getDialogContextListeners()
DialogContextListener
s.void removeDialogContextListener(DialogContextListener listener)
DialogContextListener
for this
DialogContext
. The listener will no longer receive any
associated callbacks.listener
- The DialogContextListener
instance.Copyright © 2004-2013 Apache Software Foundation. All Rights Reserved.