|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.faces.component.UIComponent
javax.faces.component.UIComponentBase
javax.faces.component.UICommand
com.esri.adf.web.faces.component.TocControl
public class TocControl
The TOC control—or table of contents control—displays the contents of a map and allows an end user to turn layers on
and off. The TOC control functions in the same manner as the table of contents in ArcMap: it presents a hierarchical
list of data frames, layers, and symbols displayed on the map.
The TocControl works with WebToc object. The
TocRenderer class renders the control to the appropriate markup, and the
TocTag class exposes the control as a JSP custom tag named toc.
The TOC is made up of a collection of TocNode objects. A TocNode stores content, maintains hierarchical
relationships, and responds to an event that occurs at that node. To store content, a TocNode requires a
TocNodeContent object to encapsulate the content at that node. A TocNode handles its
own expand or collapse event and delegates the check box event—for layer visibility—and the node operation—when node
content is clicked—to the TocNodeContent’s event handling methods:
public void handleCheckedEvent(TocEvent args)
public void handleNodeEvent(TocEvent args)
The TocRenderer controls how the TocControl is displayed on the page and
manages the events for the table of contents. The TocRenderer decodes the following request parameters from the
FacesContext:
• tocId + _nodeKey — The key of the node responsible for the operation
• tocId + _nodeOperation — The operation to be performed, which is either click or expandCollapse
| Field Summary | |
|---|---|
static java.lang.String |
COMPONENT_FAMILY
The standard component family for this component. |
static java.lang.String |
COMPONENT_TYPE
The standard component type for this component. |
static java.lang.String |
DEFAULT_XSL_FILE_NAME
The name of the XSL file used to render this control by default. |
| Constructor Summary | |
|---|---|
TocControl()
Initializes the TocControl. |
|
| Method Summary | |
|---|---|
java.lang.String |
getCollapsedImage()
Returns the collapsed image URL. |
java.lang.String |
getExpandedImage()
Returns the expanded image URL. |
java.lang.String |
getFamily()
Returns the family of this control. |
int |
getIndentWidth()
Returns the indentation level of the TOC nodes. |
java.lang.String |
getMapId()
Returns the map control id associated with the control. |
protected javax.faces.render.Renderer |
getRenderer(javax.faces.context.FacesContext context)
Returns a design-time renderer if the component is used in an IDE. |
java.lang.String |
getResourceImage()
Returns the resource image URL. |
java.lang.String |
getStyle()
Returns the style attributes of toolbar control. |
java.lang.String |
getStyleClass()
Returns the file name where the CSS style attributes are defined. |
java.lang.String |
getTextStyle()
Returns the TOC text CSS style. |
java.lang.String |
getTextStyleClass()
Returns the TOC text CSS class name. |
TocModel |
getTocModel()
Returns the TocModel object associated with this control. |
java.net.URL |
getXslUrl()
Returns the URL of the XSL file used to render the control. |
boolean |
isAutoPostBack()
Returns an indicator of whether to post back a TOC event. |
boolean |
isClientPostBack()
Indicates whether the control supports client side post back. |
boolean |
isInit()
Returns an indicator whether this control is initialized. |
boolean |
isShowExpanded()
Returns an indicator of whether to show collapsed/expanded images on the TOC. |
void |
processAction(javax.faces.event.ActionEvent event)
Processes an action fired by this control. |
TocEvent |
queueTocEvent(javax.faces.context.FacesContext facesContext,
java.lang.String nodeKey,
int nodeOperation,
java.lang.String contextMenuItemValue,
java.util.Map<java.lang.String,java.lang.Boolean> checkedNodeKeys)
Set the event arguments passed by the client and queues the action event. |
void |
restoreState(javax.faces.context.FacesContext facesContext,
java.lang.Object state)
Restores the state of the control. |
java.lang.Object |
saveState(javax.faces.context.FacesContext facesContext)
Saves the state of this control. |
void |
setAutoPostBack(boolean autoPostBack)
Sets whether to automatically post back on every check or uncheck event. |
void |
setClientPostBack(boolean clientPostBack)
Sets whether the control supports client side post back. |
void |
setCollapsedImage(java.lang.String collapsedImage)
Sets the collapsed image URL. |
void |
setExpandedImage(java.lang.String expandedImage)
Sets the expanded image URL. |
void |
setIndentWidth(int indent)
Sets the indentation level of the TOC nodes. |
void |
setInit(boolean init)
Sets an indicator whether to initialize the control. |
void |
setMapId(java.lang.String mapId)
Sets the map control id associated with the control. |
void |
setResourceImage(java.lang.String resourceImage)
Sets the resource image URL. |
void |
setShowExpanded(boolean showExpanded)
Sets the visibility of the collapsed/expanded images on the TOC. |
void |
setStyle(java.lang.String style)
Sets the default style for the toolbar control. |
void |
setStyleClass(java.lang.String styleClass)
Sets the CSS class name where the CSS style attributes are defined. |
void |
setTextStyle(java.lang.String textStyle)
Sets the TOC text CSS style. |
void |
setTextStyleClass(java.lang.String textStyleClass)
Sets the TOC text CSS class name. |
void |
setValueBinding(java.lang.String name,
javax.faces.el.ValueBinding binding)
Sets the value binding. |
void |
setXslUrl(java.net.URL xslUrl)
Sets the URL of the XSL file used to render the control. |
| Methods inherited from class javax.faces.component.UICommand |
|---|
addActionListener, broadcast, getAction, getActionListener, getActionListeners, getValue, isImmediate, queueEvent, removeActionListener, setAction, setActionListener, setImmediate, setValue |
| Methods inherited from class javax.faces.component.UIComponentBase |
|---|
addFacesListener, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String COMPONENT_FAMILY
public static final java.lang.String COMPONENT_TYPE
public static final java.lang.String DEFAULT_XSL_FILE_NAME
| Constructor Detail |
|---|
public TocControl()
| Method Detail |
|---|
public java.lang.String getFamily()
getFamily in class javax.faces.component.UICommandString- the COMPONENT_FAMILYprotected javax.faces.render.Renderer getRenderer(javax.faces.context.FacesContext context)
getRenderer in class javax.faces.component.UIComponentBasecontext - the FacesContext
Renderer- the renderer object
public void processAction(javax.faces.event.ActionEvent event)
throws javax.faces.event.AbortProcessingException
processAction in interface javax.faces.event.ActionListenerevent - the ActionEvent
javax.faces.event.AbortProcessingException - if the TOC node event fails
public TocEvent queueTocEvent(javax.faces.context.FacesContext facesContext,
java.lang.String nodeKey,
int nodeOperation,
java.lang.String contextMenuItemValue,
java.util.Map<java.lang.String,java.lang.Boolean> checkedNodeKeys)
TocEvent is created by
passing in the checked node and the boolean value indicating if the node is checked.
facesContext - the FacesContextnodeKey - the node keynodeOperation - - the operation to perform on the node (0 indicates expand/collapse, 1 indicates
check/uncheck, and an integer other than -1, 0, or 1 indicates a custom operation)contextMenuItemValue - - the value of the context menu item to be processedcheckedNodeKeys - - collection of TocEvent.CheckedTocNodespublic TocModel getTocModel()
TocModel object associated with this control.
TocModel- the TocModelpublic boolean isInit()
public void setInit(boolean init)
init - if true, initialize the control
public void setValueBinding(java.lang.String name,
javax.faces.el.ValueBinding binding)
setValueBinding in class javax.faces.component.UIComponentBasename - the name of the attribute or property for which to set a ValueBindingbinding - the ValueBinding to set. If null, remove any currently set ValueBinding.public java.lang.String getMapId()
String - the map control idpublic void setMapId(java.lang.String mapId)
mapId - the map control id.public java.net.URL getXslUrl()
URL- the URL objectpublic void setXslUrl(java.net.URL xslUrl)
xslUrl - the URL of the XSL filepublic java.lang.String getStyle()
String- the style attributespublic void setStyle(java.lang.String style)
style - the default style for the toolbar controlpublic java.lang.String getStyleClass()
String- the CSS classpublic void setStyleClass(java.lang.String styleClass)
styleClass - the CSS classpublic boolean isClientPostBack()
public void setClientPostBack(boolean clientPostBack)
clientPostBack - if true, the client side post back is supportedpublic boolean isAutoPostBack()
public void setAutoPostBack(boolean autoPostBack)
autoPostBack - if true, a TOC request is sent to the server after each eventpublic java.lang.String getTextStyle()
String- the TOC text CSS stylepublic void setTextStyle(java.lang.String textStyle)
textStyle - the TOC text CSS stylepublic java.lang.String getTextStyleClass()
String- the TOC text CSS class namepublic void setTextStyleClass(java.lang.String textStyleClass)
textStyleClass - the TOC text CSS class namepublic int getIndentWidth()
public void setIndentWidth(int indent)
indent - the number of pixels to indent nodespublic java.lang.String getExpandedImage()
String- a URL string to the imagepublic void setExpandedImage(java.lang.String expandedImage)
expandedImage - a URL string to the imagepublic java.lang.String getCollapsedImage()
String - a URL string to the imagepublic void setCollapsedImage(java.lang.String collapsedImage)
collapsedImage - a URL string to the imagepublic java.lang.String getResourceImage()
String- the resource image URLpublic void setResourceImage(java.lang.String resourceImage)
resourceImage - a URL string to the imagepublic void setShowExpanded(boolean showExpanded)
showExpanded - set to true to show the collapsed/expanded imagespublic boolean isShowExpanded()
public java.lang.Object saveState(javax.faces.context.FacesContext facesContext)
saveState in interface javax.faces.component.StateHoldersaveState in class javax.faces.component.UICommandfacesContext - the associated FacesContext
Object- the object to be saved
public void restoreState(javax.faces.context.FacesContext facesContext,
java.lang.Object state)
restoreState in interface javax.faces.component.StateHolderrestoreState in class javax.faces.component.UICommandfacesContext - the associated FacesContextstate - the object to restore the state of the control from
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||