|
|||||||||
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 String |
COMPONENT_FAMILY
The standard component family for this component. |
static String |
COMPONENT_TYPE
The standard component type for this component. |
static String |
DEFAULT_XSL_FILE_NAME
The name of the XSL file used to render this control by default. |
Fields inherited from class javax.faces.component.UIComponent |
---|
bindings |
Constructor Summary | |
---|---|
TocControl()
Initializes the TocControl. |
Method Summary | |
---|---|
String |
getCollapsedImage()
Returns the collapsed image URL. |
String |
getExpandedImage()
Returns the expanded image URL. |
String |
getFamily()
Returns the family of this control. |
int |
getIndentWidth()
Returns the indentation level of the TOC nodes. |
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. |
String |
getResourceImage()
Returns the resource image URL. |
String |
getStyle()
Returns the style attributes of toolbar control. |
String |
getStyleClass()
Returns the file name where the CSS style attributes are defined. |
String |
getTextStyle()
Returns the TOC text CSS style. |
String |
getTextStyleClass()
Returns the TOC text CSS class name. |
TocModel |
getTocModel()
Returns the TocModel object associated with this control. |
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,
String nodeKey,
int nodeOperation,
String contextMenuItemValue,
Map<String,Boolean> checkedNodeKeys)
Set the event arguments passed by the client and queues the action event. |
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 |
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(String collapsedImage)
Sets the collapsed image URL. |
void |
setExpandedImage(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(String mapId)
Sets the map control id associated with the control. |
void |
setResourceImage(String resourceImage)
Sets the resource image URL. |
void |
setShowExpanded(boolean showExpanded)
Sets the visibility of the collapsed/expanded images on the TOC. |
void |
setStyle(String style)
Sets the default style for the toolbar control. |
void |
setStyleClass(String styleClass)
Sets the CSS class name where the CSS style attributes are defined. |
void |
setTextStyle(String textStyle)
Sets the TOC text CSS style. |
void |
setTextStyleClass(String textStyleClass)
Sets the TOC text CSS class name. |
void |
setValueExpression(String name,
javax.el.ValueExpression binding)
Sets the value binding. |
void |
setXslUrl(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, getActionExpression, getActionListener, getActionListeners, getValue, isImmediate, queueEvent, removeActionListener, setAction, setActionExpression, setActionListener, setImmediate, setValue |
Methods inherited from class javax.faces.component.UIComponentBase |
---|
addFacesListener, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, 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 |
---|
public static final String COMPONENT_FAMILY
public static final String COMPONENT_TYPE
public static final String DEFAULT_XSL_FILE_NAME
Constructor Detail |
---|
public TocControl()
Method Detail |
---|
public String getFamily()
getFamily
in class javax.faces.component.UICommand
String
- the COMPONENT_FAMILY
protected javax.faces.render.Renderer getRenderer(javax.faces.context.FacesContext context)
getRenderer
in class javax.faces.component.UIComponentBase
context
- the FacesContext
Renderer
- the renderer objectpublic void processAction(javax.faces.event.ActionEvent event) throws javax.faces.event.AbortProcessingException
processAction
in interface javax.faces.event.ActionListener
event
- the ActionEvent
javax.faces.event.AbortProcessingException
- if the TOC node event failspublic TocEvent queueTocEvent(javax.faces.context.FacesContext facesContext, String nodeKey, int nodeOperation, String contextMenuItemValue, Map<String,Boolean> checkedNodeKeys)
TocEvent
is created by
passing in the checked node and the boolean value indicating if the node is checked.
facesContext
- the FacesContext
nodeKey
- 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.CheckedTocNode
spublic TocModel getTocModel()
TocModel
object associated with this control.
TocModel
- the TocModelpublic boolean isInit()
public void setInit(boolean init)
init
- if true, initialize the controlpublic void setValueExpression(String name, javax.el.ValueExpression binding)
setValueExpression
in class javax.faces.component.UIComponent
name
- 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 String getMapId()
String
- the map control idpublic void setMapId(String mapId)
mapId
- the map control id.public URL getXslUrl()
URL
- the URL objectpublic void setXslUrl(URL xslUrl)
xslUrl
- the URL of the XSL filepublic String getStyle()
String
- the style attributespublic void setStyle(String style)
style
- the default style for the toolbar controlpublic String getStyleClass()
String
- the CSS classpublic void setStyleClass(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 String getTextStyle()
String
- the TOC text CSS stylepublic void setTextStyle(String textStyle)
textStyle
- the TOC text CSS stylepublic String getTextStyleClass()
String
- the TOC text CSS class namepublic void setTextStyleClass(String textStyleClass)
textStyleClass
- the TOC text CSS class namepublic int getIndentWidth()
public void setIndentWidth(int indent)
indent
- the number of pixels to indent nodespublic String getExpandedImage()
String
- a URL string to the imagepublic void setExpandedImage(String expandedImage)
expandedImage
- a URL string to the imagepublic String getCollapsedImage()
String
- a URL string to the imagepublic void setCollapsedImage(String collapsedImage)
collapsedImage
- a URL string to the imagepublic String getResourceImage()
String
- the resource image URLpublic void setResourceImage(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 Object saveState(javax.faces.context.FacesContext facesContext)
saveState
in interface javax.faces.component.StateHolder
saveState
in class javax.faces.component.UICommand
facesContext
- the associated FacesContext
Object
- the object to be savedpublic void restoreState(javax.faces.context.FacesContext facesContext, Object state)
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class javax.faces.component.UICommand
facesContext
- 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 |