com.esri.adf.web.data
Class WebToc

java.lang.Object
  extended by com.esri.adf.web.data.TocModel
      extended by com.esri.adf.web.data.WebToc
All Implemented Interfaces:
WebContextInitialize, java.io.Serializable

public class WebToc
extends TocModel
implements WebContextInitialize, java.io.Serializable

The WebToc represents the business object that works with the TocControl using the TocFunctionality objects configured with the GISResources.

See Also:
Serialized Form

Field Summary
protected  WebContext context
          The associated WebMap object for this WebToc.
protected  java.lang.Class customReourceContentClass
           
protected  java.lang.String customResourceContentClassName
          The name of the custom class (which should be a sub-class of TocResourceContent) to use for the resource nodes
protected  int expandLevel
          The number of levels to expand by default.
protected  java.util.Hashtable<TocFunctionality,TocNode> funcsNodes
           
protected  java.lang.String imageFormat
          The format of the TOC images.
protected  int nextResourceNodeIndex
           
protected  java.util.ArrayList<TocNode> resourceNodes
           
protected static java.lang.String TOC_MODEL_TYPE
           
protected  java.util.ArrayList<TocFunctionality> tocFuncs
           
protected  boolean useMIMEData
          Indicates whether MIME data is used.
 
Fields inherited from class com.esri.adf.web.data.TocModel
init, showContextMenu, visible
 
Constructor Summary
WebToc()
          Initializes the WebToc.
 
Method Summary
 void destroy()
           The cleaup chores (such as releasing held resources) of attributes of a WebContext should be performed in this method.
 java.lang.String getCustomResourceContentClassName()
          Returns the name of the custom class (which should be a sub-class of TocREsourceContent) to use for the resource nodes
 int getExpandLevel()
          Returns the number of levels to be expanded by default.
 java.lang.String getImageFormat()
          Returns the format of the TOC images.
 java.util.Collection<TocNode> getRootNodes()
          Returns a collection of the top level TocNodes of the TOC.
 java.util.List<TocFunctionality> getTocFunctionalities()
           
 java.lang.String getTocModelType()
           
 WebContext getWebContext()
           
 void init(TocFunctionality tocFunc)
          Initializes the WebToc for the specified toc functionality.
 void init(WebContext context)
          Initializes the WebToc by associating itself with this context.
 boolean isUseMIMEData()
          Returns an indicator whether the control returns MIME data or not.
 void setCustomResourceContentClassName(java.lang.String customResourceContentClassName)
          Sets the name of the custom class (which should be a sub-class of TocResourceContent) to use for the resource nodes
 void setExpandLevel(int expandLevel)
          Sets the number of levels to be expanded by default.
 void setImageFormat(java.lang.String imageFormat)
          Sets the format of the TOC images.
 void setUseMIMEData(boolean useMIMEData)
          Sets whether the control returns MIME data or not.
 
Methods inherited from class com.esri.adf.web.data.TocModel
findNode, isInit, isShowContextMenu, isShowOpenResultLink, isVisible, setInit, setShowContextMenu, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected WebContext context
The associated WebMap object for this WebToc.


imageFormat

protected java.lang.String imageFormat
The format of the TOC images.


TOC_MODEL_TYPE

protected static final java.lang.String TOC_MODEL_TYPE
See Also:
Constant Field Values

useMIMEData

protected boolean useMIMEData
Indicates whether MIME data is used. True by default.


expandLevel

protected int expandLevel
The number of levels to expand by default. The default value is -1, expand all.


resourceNodes

protected java.util.ArrayList<TocNode> resourceNodes

tocFuncs

protected java.util.ArrayList<TocFunctionality> tocFuncs

funcsNodes

protected java.util.Hashtable<TocFunctionality,TocNode> funcsNodes

customResourceContentClassName

protected java.lang.String customResourceContentClassName
The name of the custom class (which should be a sub-class of TocResourceContent) to use for the resource nodes


customReourceContentClass

protected java.lang.Class customReourceContentClass

nextResourceNodeIndex

protected int nextResourceNodeIndex
Constructor Detail

WebToc

public WebToc()
Initializes the WebToc.

Method Detail

getTocModelType

public java.lang.String getTocModelType()
Specified by:
getTocModelType in class TocModel

init

public void init(WebContext context)
Initializes the WebToc by associating itself with this context. Concrete implementations may want to override this method to do other initialization tasks. This method is called by the ADF when the WebToc is initialized.

Specified by:
init in interface WebContextInitialize
Parameters:
context - WebContext
See Also:
WebContext.init(WebContext), WebContext.addResource(String, GISResource, int), WebContext.removeResource(GISResource)

init

public void init(TocFunctionality tocFunc)
Initializes the WebToc for the specified toc functionality.

Parameters:
tocFunc - the TocFunctionality to re-initialize

destroy

public void destroy()
Description copied from interface: WebContextInitialize

The cleaup chores (such as releasing held resources) of attributes of a WebContext should be performed in this method.

Typically this method is called by the WebContext when the context itself is destroyed.

The WebContext attribute is unusable after this method has been called.

Specified by:
destroy in interface WebContextInitialize
See Also:
WebContext.destroy()

setImageFormat

public void setImageFormat(java.lang.String imageFormat)
Sets the format of the TOC images.

Parameters:
imageFormat - the image format

getImageFormat

public java.lang.String getImageFormat()
Returns the format of the TOC images.

Returns:
String- the image format

getRootNodes

public java.util.Collection<TocNode> getRootNodes()
Returns a collection of the top level TocNodes of the TOC. These top level nodes typically represent data frames.

Specified by:
getRootNodes in class TocModel
Returns:
Collection- the collection of TocNodes

getCustomResourceContentClassName

public java.lang.String getCustomResourceContentClassName()
Returns the name of the custom class (which should be a sub-class of TocREsourceContent) to use for the resource nodes

Returns:
the name of the custom class

setCustomResourceContentClassName

public void setCustomResourceContentClassName(java.lang.String customResourceContentClassName)
Sets the name of the custom class (which should be a sub-class of TocResourceContent) to use for the resource nodes

Parameters:
customResourceContentClassName - the name of the custom class

getTocFunctionalities

public java.util.List<TocFunctionality> getTocFunctionalities()

setUseMIMEData

public void setUseMIMEData(boolean useMIMEData)
Sets whether the control returns MIME data or not. True by default.

Parameters:
useMIMEData - if true, MIME data is returned instead of an image URL string.

isUseMIMEData

public boolean isUseMIMEData()
Returns an indicator whether the control returns MIME data or not.

Returns:
boolean- if true, MIME data is used

setExpandLevel

public void setExpandLevel(int expandLevel)
Sets the number of levels to be expanded by default.

Parameters:
expandLevel - the expand level

getExpandLevel

public int getExpandLevel()
Returns the number of levels to be expanded by default.

Returns:
int - the expand level

getWebContext

public WebContext getWebContext()