com.esri.arcgis.systemUI
Class DataObjectHelper

java.lang.Object
  extended bycom.esri.arcgis.systemUI.DataObjectHelper
All Implemented Interfaces:
IDataObjectHelper, ISupportErrorInfo, java.io.Serializable

public class DataObjectHelper
extends java.lang.Object
implements IDataObjectHelper, ISupportErrorInfo

Helper class for OLE drag and drop.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Description

Provides helper methods and properties for retrieving data from an IDataObject interface. IDataObject is a windows standard interface used for dragging and droping data. This is available directly through the InternalObject property.

Remarks

The DataObjectHelper can be used by the MapControl and PageLayoutControl to control drag-and-drop operations.

The NameFactory class (defined in esriSystem) performs a similar job for Name objects with non-ESRI controls, though the DataObjectHelper handles drag-and-drop for both Name objects and file names.

See Also:
Serialized Form

Constructor Summary
DataObjectHelper()
          Constructs a DataObjectHelper using ArcGIS Engine.
DataObjectHelper(java.lang.Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
 
Method Summary
 boolean canGetFiles()
          Indicates if files are available in the DataObject.
 boolean canGetNames()
          Indicates if ESRI names are available in the DataObject.
 boolean equals(java.lang.Object o)
          Compare this object with another
 IDataObjectHelper getAsIDataObjectHelper()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 ISupportErrorInfo getAsISupportErrorInfo()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
static java.lang.String getClsid()
           
 java.lang.Object getData(int format)
          If specified DataObject format can be retrieved, returns the data as safe array of bytes.
 java.lang.Object getFiles()
          If the DataObject format supports files, returns a safe array of strings representing filenames.
 boolean getFormat(int format)
          Indicates if the DataObject supports the specified format.
 java.lang.Object getInternalObject()
          Provides access to the internal IDataObject pointer.
 IEnumName getNames()
          If the DataObject format supports ESRI names, returns an enumerator of names.
 int hashCode()
          the hashcode for this object
 void interfaceSupportsErrorInfo(GUID riid)
          Supported Platforms
 void setInternalObjectByRef(java.lang.Object ppObject)
          Provides access to the internal IDataObject pointer.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataObjectHelper

public DataObjectHelper()
                 throws java.io.IOException,
                        java.net.UnknownHostException
Constructs a DataObjectHelper using ArcGIS Engine.

Throws:
java.io.IOException - if there are interop problems
java.net.UnknownHostException - if there are interop problems

DataObjectHelper

public DataObjectHelper(java.lang.Object obj)
                 throws java.io.IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.

Construct a DataObjectHelper using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to DataObjectHelper.
DataObjectHelper theDataObjectHelper = (DataObjectHelper) obj;

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
java.io.IOException - if there are interop problems
Method Detail

getClsid

public static java.lang.String getClsid()

getAsIDataObjectHelper

public IDataObjectHelper getAsIDataObjectHelper()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsISupportErrorInfo

public ISupportErrorInfo getAsISupportErrorInfo()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


equals

public boolean equals(java.lang.Object o)
Compare this object with another


hashCode

public int hashCode()
the hashcode for this object


setInternalObjectByRef

public void setInternalObjectByRef(java.lang.Object ppObject)
                            throws java.io.IOException,
                                   AutomationException
Description copied from interface: IDataObjectHelper
Provides access to the internal IDataObject pointer.

Specified by:
setInternalObjectByRef in interface IDataObjectHelper
Parameters:
ppObject - A reference to another Object (IUnknown) (in)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

getInternalObject

public java.lang.Object getInternalObject()
                                   throws java.io.IOException,
                                          AutomationException
Description copied from interface: IDataObjectHelper
Provides access to the internal IDataObject pointer.

Supported Platforms

Windows, Solaris, Linux

Description

The internal DataObject implements the IDataObject interface. The DataObject gets populated before any OleDrop events (IMapControlEvents2::OnOleDrop or the IPageLayoutControlEvents::OnOleDrop) are triggered.

Specified by:
getInternalObject in interface IDataObjectHelper
Returns:
A reference to another Object (IUnknown)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getData

public java.lang.Object getData(int format)
                         throws java.io.IOException,
                                AutomationException
Description copied from interface: IDataObjectHelper
If specified DataObject format can be retrieved, returns the data as safe array of bytes.

Supported Platforms

Windows, Solaris, Linux

Description

Returns a safe array of bytes from the DataObject, given the specified format. This safe arrray is not processed in anyway. Typically used when dropping data onto the PageLayoutControl and MapControl from other applications.

Specified by:
getData in interface IDataObjectHelper
Parameters:
format - The format (in)
Returns:
A Variant
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

getFormat

public boolean getFormat(int format)
                  throws java.io.IOException,
                         AutomationException
Description copied from interface: IDataObjectHelper
Indicates if the DataObject supports the specified format.

Supported Platforms

Windows, Solaris, Linux

Description

GetFormat returns the DataObject format code. The format code corresponds to a clipboard format that is unqiue to the system and is registered with the windows api function RegisterClipboardFormat. Other standard drag and drop formats are available. For example, 1 is used for text, 2 for a bitmap and 15 is used for a file list.

Use to test if the format of data in the DataObject matches the specified format. Typically used when dropping data onto the PageLayoutControl and MapControl from other applications.

Specified by:
getFormat in interface IDataObjectHelper
Parameters:
format - The format (in)
Returns:
The pbFormatSupported
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

canGetFiles

public boolean canGetFiles()
                    throws java.io.IOException,
                           AutomationException
Description copied from interface: IDataObjectHelper
Indicates if files are available in the DataObject.

Supported Platforms

Windows, Solaris, Linux

Description

Indicates whether a safe array of filenames can be aquired from the DataObject. Iterate through the array to retrieve a list of filenames. This is typically used when dropping data from Windows Explorer onto the PageLayoutControl or MapControl.

Specified by:
canGetFiles in interface IDataObjectHelper
Returns:
The canGetFiles
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

getFiles

public java.lang.Object getFiles()
                          throws java.io.IOException,
                                 AutomationException
Description copied from interface: IDataObjectHelper
If the DataObject format supports files, returns a safe array of strings representing filenames.

Supported Platforms

Windows, Solaris, Linux

Description

Use this method when CanGetFiles returns true. Iterate through the safe array to retrieve a list of filenames. This is typically used when data is being dropped onto the PageLayoutControl or MapControl from Windows Explorer.

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

canGetNames

public boolean canGetNames()
                    throws java.io.IOException,
                           AutomationException
Description copied from interface: IDataObjectHelper
Indicates if ESRI names are available in the DataObject.

Supported Platforms

Windows, Solaris, Linux

Description

Indicates whether an IEnumName object can be aquired from the DataObject. Use the IEnumName object to enumerate over a set of IName objects. This is typically used when dropping data from ArcCatalog onto the PageLayoutControl or MapControl. 

Specified by:
canGetNames in interface IDataObjectHelper
Returns:
The canGetNames
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

getNames

public IEnumName getNames()
                   throws java.io.IOException,
                          AutomationException
Description copied from interface: IDataObjectHelper
If the DataObject format supports ESRI names, returns an enumerator of names.

Supported Platforms

Windows, Solaris, Linux

Description

Use this method when CanGetNames returns true. Use the IEnumName object to enumerate over a set of IName objects. This is typically used when data is being dropped onto the PageLayoutControl or MapControl from ArcCatalog.

Specified by:
getNames in interface IDataObjectHelper
Returns:
A reference to a com.esri.arcgis.system.IEnumName
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws java.io.IOException,
                                       AutomationException
Description copied from interface: ISupportErrorInfo

Supported Platforms

Windows, Solaris, Linux

Description

Indicates whether the interface supports IErrorInfo.

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.