com.esri.arcgis.arcmapui
Class IContentsViewProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.arcmapui.IContentsViewProxy
All Implemented Interfaces:
IContentsView, Externalizable, Serializable
Direct Known Subclasses:
IContentsView2Proxy

public class IContentsViewProxy
extends com.esri.arcgis.interop.Dispatch
implements IContentsView, Serializable

Provides access to members that control table of contents views.

Description

Used to manage a contents view. The tabs in ArcMap's Table of Contents (TOC) are examples of a contents view.

Remarks

Use IContentsView to show or hide a view or to get or set selected items in a view. Selected items in the TOC's Display and Catalog View can include data frames, layers, legend groups, and legend classes. Additionally, standalone tables, workspaces, and datasets can be selected in the TOC's Catalog View. No items can be selected in the TOC's Selection view. To learn more about selected items, read the topics for Selected Item, AddToSelectedItems, and RemoveFromSelectedItems.

Product Availability

Available with ArcGIS Desktop.

See Also:
Serialized Form

Field Summary
 boolean noncastable
           
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef
 
Constructor Summary
  IContentsViewProxy()
           
  IContentsViewProxy(Object obj)
           
protected IContentsViewProxy(Object obj, String iid)
           
 
Method Summary
 void activate(int parentHWnd, IMxDocument document)
          Activates the contents view.
 void addListener(String iidStr, Object theListener, Object theSource)
           
 void addToSelectedItems(Object item)
          Adds to the selected items.
 void deactivate()
          Deactivates the contents view.
 Object getContextItem()
          The context item (could be an enumerator).
 int getHWnd()
          The HWND of the contents view.
 String getName()
          The name of the contents view.
 Object getSelectedItem()
          The selected item (could be an enumerator).
 boolean isShowLines()
          Indicates if lines are shown in the TOC tree.
 boolean isVisible()
          Indicates if the view is visible.
 void refresh(Object item)
          Refreshes the contents view.
 void removeFromSelectedItems(Object item)
          Removes an item from the selected items.
 void removeListener(String iidStr, Object theListener)
           
 void setContextItem(Object item)
          The context item (could be an enumerator).
 void setProcessEvents(boolean rhs1)
          Indicates if the view is currently responding to events.
 void setSelectedItem(Object item)
          The selected item (could be an enumerator).
 void setShowLines(boolean show)
          Indicates if lines are shown in the TOC tree.
 void setVisible(boolean vis)
          Indicates if the view is visible.
 
Methods inherited from class com.esri.arcgis.interop.Dispatch
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, optimizedVtblInvoke, queryInterface, readExternal, release, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

noncastable

public boolean noncastable
Constructor Detail

IContentsViewProxy

public IContentsViewProxy()

IContentsViewProxy

public IContentsViewProxy(Object obj)
                   throws IOException
Throws:
IOException

IContentsViewProxy

protected IContentsViewProxy(Object obj,
                             String iid)
                      throws IOException
Throws:
IOException
Method Detail

addListener

public void addListener(String iidStr,
                        Object theListener,
                        Object theSource)
                 throws IOException
Overrides:
addListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

removeListener

public void removeListener(String iidStr,
                           Object theListener)
                    throws IOException
Overrides:
removeListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

getName

public String getName()
               throws IOException,
                      AutomationException
The name of the contents view.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getName in interface IContentsView
Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getHWnd

public int getHWnd()
            throws IOException,
                   AutomationException
The HWND of the contents view.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getHWnd in interface IContentsView
Returns:
The hWnd (A COM typedef)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

activate

public void activate(int parentHWnd,
                     IMxDocument document)
              throws IOException,
                     AutomationException
Activates the contents view.

Remarks

You can also activate a contents view by setting IMxDocument::CurrentContentsView (in ArcMap) or ISxDocument::CurrentContentsView (in ArcScene or ArcGlobe).

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
activate in interface IContentsView
Parameters:
parentHWnd - The parentHWnd (A COM typedef) (in)
document - A reference to a com.esri.arcgis.arcmapui.IMxDocument (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deactivate

public void deactivate()
                throws IOException,
                       AutomationException
Deactivates the contents view.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
deactivate in interface IContentsView
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

refresh

public void refresh(Object item)
             throws IOException,
                    AutomationException
Refreshes the contents view. If a non-null item is specified, it refreshes only that item and its children.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
refresh in interface IContentsView
Parameters:
item - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSelectedItem

public Object getSelectedItem()
                       throws IOException,
                              AutomationException
The selected item (could be an enumerator).

Description

This property is not functional for TOCSelectionView. When working with a TOCDisplayView or TOCCatalogView this property has several usages:

1. The property can be a single object of any of the following types:

IMap
ILayer
ILegendGroup
IWorkspace (source view only)
IDataset (source view only)
IStandaloneTable (source view only)

2. The property can be a Set of items of the types listed in 1. Only multiple items of the same type can be selected simultaneously, so when setting this property using a Set, the Set should contain items of the same type.

3. The property can be an array where the contents of the array represent the hierarchical path to a single selected item. This is common when a single legend class is selected.

For example: If Array(0) = pMap, Array(1) = pLayer, Array(2) = pLegendGroup, and Array(3) = n, then the selected item is the nth legend class in pLegendGroup. When setting or adding to the selection, pass higher-level objects (in this case the IMap and ILayer objects) to improve peformance.

4. The property can be an array which contains an array of the structure explained in 3. This is common when multiple legend classes are selected.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getSelectedItem in interface IContentsView
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSelectedItem

public void setSelectedItem(Object item)
                     throws IOException,
                            AutomationException
The selected item (could be an enumerator).

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
setSelectedItem in interface IContentsView
Parameters:
item - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addToSelectedItems

public void addToSelectedItems(Object item)
                        throws IOException,
                               AutomationException
Adds to the selected items.

Description

This method is not functional for TOCSelectionView. When working with a TOCDisplayView or TOCCatalogView the item parameter has several usages:

1. The parameter can be a single object of any of the following types:

IMap
ILayer
ILegendGroup
IWorkspace (source view only)
IDataset (source view only)
IStandaloneTable (source view only)

2. The parameter can be a Set of items of the types listed in 1. Only multiple items of the same type can be selected simultaneously, so the Set should contain items of the same type.

3. The parameter can be an array where the contents of the array represent the hierarchical path to a single selected item. Use this to add a single legend class to the selection.

For example: If Array(0) = pMap, Array(1) = pLayer, Array(2) = pLegendGroup, and Array(3) = n, then the method will add the nth legend class in pLegendGroup. When building the array, include higher-level objects (in this case the IMap and ILayer objects) to improve peformance.

4. The parameter can be an array which contains an array of the structure explained in 3. Use this to add multiple legend classes to the selection.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
addToSelectedItems in interface IContentsView
Parameters:
item - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removeFromSelectedItems

public void removeFromSelectedItems(Object item)
                             throws IOException,
                                    AutomationException
Removes an item from the selected items.

Description

This method is not functional for TOCSelectionView. When working with a TOCDisplayView or TOCCatalogView the item parameter has several usages:

1. The parameter can be a single object of any of the following types:

IMap
ILayer
ILegendGroup
IWorkspace (source view only)
IDataset (source view only)
IStandaloneTable (source view only)

2. The parameter can be a Set of items of the types listed in 1. Only multiple items of the same type can be selected simultaneously, so the Set should contain items of the same type.

3. The parameter can be an array where the contents of the array represent the hierarchical path to a single selected item. Use this to remove a single legend class from the selection.

For example: If Array(0) = pMap, Array(1) = pLayer, Array(2) = pLegendGroup, and Array(3) = n, then the method will remove the nth legend class in pLegendGroup. When building the array, include higher-level objects (in this case the IMap and ILayer objects) to improve peformance.

4. The parameter can be an array which contains an array of the structure explained in 3. Use this to remove multiple legend classes from the selection.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
removeFromSelectedItems in interface IContentsView
Parameters:
item - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getContextItem

public Object getContextItem()
                      throws IOException,
                             AutomationException
The context item (could be an enumerator).

Remarks

You need at least to write a minimalistic implementation of this property as shown here:

Private m_ContextItem as Variant

Private Property Let IContentsView_ContextItem(ByVal RHS As Variant)
m_ContextItem = RHS
End Property

Private Property Get IContentsView_ContextItem() As Variant
IContentsView_ContextItem = m_ContextItem
End Property

The ContextItem property will contain the item on which the user makes a right-click in the TOC and at this point a context menu may be shown.

At 9.0 a default context menu is shown when the user right-clicks in your custom TOC. If you need to get rid of this menu in order to implement your own you will find the Selectable Layers Tab example valuable.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getContextItem in interface IContentsView
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setContextItem

public void setContextItem(Object item)
                    throws IOException,
                           AutomationException
The context item (could be an enumerator).

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
setContextItem in interface IContentsView
Parameters:
item - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isShowLines

public boolean isShowLines()
                    throws IOException,
                           AutomationException
Indicates if lines are shown in the TOC tree.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
isShowLines in interface IContentsView
Returns:
The show
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setShowLines

public void setShowLines(boolean show)
                  throws IOException,
                         AutomationException
Indicates if lines are shown in the TOC tree.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
setShowLines in interface IContentsView
Parameters:
show - The show (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isVisible

public boolean isVisible()
                  throws IOException,
                         AutomationException
Indicates if the view is visible.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
isVisible in interface IContentsView
Returns:
The vis
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setVisible

public void setVisible(boolean vis)
                throws IOException,
                       AutomationException
Indicates if the view is visible.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
setVisible in interface IContentsView
Parameters:
vis - The vis (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setProcessEvents

public void setProcessEvents(boolean rhs1)
                      throws IOException,
                             AutomationException
Indicates if the view is currently responding to events.

Remarks

This property allows you to temporarily suspend the processing of events by the contents view so that for instance, it doesn't unnecessarily refresh when some routine repeatitively modifies its content.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
setProcessEvents in interface IContentsView
Parameters:
rhs1 - The rhs1 (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.