com.esri.adf.web.faces.component
Class ContextControl

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by com.esri.adf.web.faces.component.ContextControl
All Implemented Interfaces:
javax.faces.component.StateHolder

public class ContextControl
extends javax.faces.component.UIComponentBase

The context control establishes a working environment with a GIS server. Based on the specified value binding a connection to a GIS server is established and maintained.
The ContextControl works with WebContext object. The ContextTag class wraps the functionality of the ContextControl and enables the use of the context tag in a JSP page.


Field Summary
static String COMPONENT_FAMILY
          The standard component family for this component.
static String COMPONENT_TYPE
          The standard component type for this component.
static String CONTEXT_IDS_LIST
          The client IDs of the ContextControls on the page are stored under this list.
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
ContextControl()
          Creates a new ContextControl.
 
Method Summary
 void encodeBegin(javax.faces.context.FacesContext facesContext)
          Performs the initialization required when encoding of the control begins.
 String getFamily()
          Returns the family of this control.
 Object getValue()
           
 WebContext getWebContext()
          Returns the WebContext associated with this control.
 boolean isInit()
          Returns whether or not a control is initialized.
 boolean isPreserve()
          Returns whether or not the previous context should be preserved when the resource is changed.
 void restoreState(javax.faces.context.FacesContext facesContext, Object state)
          Restores the state of the control.
 Object saveState(javax.faces.context.FacesContext facesContext)
          Saves the state of this control.
 void setInit(boolean init)
          Sets the control to be initialized.
 void setPreserve(boolean preserve)
          Sets whether or not the previous context should be preserved when the resource is changed.
 void setValue(Object value)
           
 void setValueExpression(String name, javax.el.ValueExpression binding)
          Sets the value binding.
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY
The standard component family for this component.

See Also:
Constant Field Values

COMPONENT_TYPE

public static final String COMPONENT_TYPE
The standard component type for this component.

See Also:
Constant Field Values

CONTEXT_IDS_LIST

public static final String CONTEXT_IDS_LIST
The client IDs of the ContextControls on the page are stored under this list. This list is set as an attribute of the UIViewRoot of the page.

See Also:
Constant Field Values
Constructor Detail

ContextControl

public ContextControl()
Creates a new ContextControl.

Method Detail

setValueExpression

public void setValueExpression(String name,
                               javax.el.ValueExpression binding)
Sets the value binding. For the "value" attribute it checks if it is an instanceof WebContext or not. If not, it throws an ADFException. For all other cases, it simply calls super.setValueBinding()

Overrides:
setValueExpression in class javax.faces.component.UIComponent
Parameters:
name - the name of the attribute or property for which to set a ValueBinding
binding - the ValueBinding to set. If null, remove any currently set ValueBinding.

setValue

public void setValue(Object value)

getValue

public Object getValue()

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext facesContext)
Performs the initialization required when encoding of the control begins. Stores the associated WebContext in session scope. The WebContext can be retrieved from session using the ID of the context control.

Overrides:
encodeBegin in class javax.faces.component.UIComponentBase
Parameters:
facesContext - the FacesContext

getWebContext

public WebContext getWebContext()
Returns the WebContext associated with this control.

Returns:
WebContext- the WebContext

isPreserve

public boolean isPreserve()
Returns whether or not the previous context should be preserved when the resource is changed.

Returns:
boolean- if true, the context is preserved. The default is true.

setPreserve

public void setPreserve(boolean preserve)
Sets whether or not the previous context should be preserved when the resource is changed.

Parameters:
preserve - if true, the context is preserved. The default is true.

setInit

public void setInit(boolean init)
Sets the control to be initialized.

Parameters:
init - if true, perform the initialization

isInit

public boolean isInit()
Returns whether or not a control is initialized.

Returns:
boolean- if true, the control is initialized

getFamily

public String getFamily()
Returns the family of this control.

Specified by:
getFamily in class javax.faces.component.UIComponent
Returns:
String- the COMPONENT_FAMILY

saveState

public Object saveState(javax.faces.context.FacesContext facesContext)
Saves the state of this control.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UIComponentBase
Parameters:
facesContext - the associated FacesContext
Returns:
Object- the object to be saved

restoreState

public void restoreState(javax.faces.context.FacesContext facesContext,
                         Object state)
Restores the state of the control.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UIComponentBase
Parameters:
facesContext - the associated FacesContext
state - the object to restore the state of the control from