com.esri.arcgis.system
Class NameFactory

java.lang.Object
  extended by com.esri.arcgis.system.NameFactory
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, INameFactory, Serializable

public class NameFactory
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, INameFactory

Name Object Factory.

Description

A NameFactory object identifies and locates a geodatabase object such as a dataset or a workspace, or a map object such as a layer. You can implement your own custom drag-and-drop behavior for these objects on your controls and forms.

ESRI applications such as ArcMap and ArcCatalog may be either the drop source or the target for your custom drag-and-drop behavior. You cannot, however, change the standard drag-and-drop behavior of the windows inside ArcMap and ArcCatalog, though of course you can add your own custom windows and controls to the applications.

When implementing a drop source for ESRI data objects, use INameFactory::PackageNames to wrap up the objects chosen. When implementing the drop target, use UnPackageNames followed by whatever action you would like to do with the name objects.

Remarks

The DataObjectHelper (defined in esriSystemUI) performs a similar job to that of a NameFactory except it also supports file names as Name objects. It is used by the MapControl and PageLayoutControl to support drag-and-drop functionality.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
NameFactory()
          Constructs a NameFactory using ArcGIS Engine.
NameFactory(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
NameFactory theNameFactory = (NameFactory) obj;
 
Method Summary
 IName create(String nameString)
          Finds the correct name-string parser for the given name string, and uses it to create a new Name object.
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 int hashCode()
          the hashcode for this object
 Object packageNames(IEnumName names)
          Packages the set of names into a VARIANT (typically for initiating a drag operation).
 IEnumName unpackageNames(Object bytesArray)
          Unpackages the given VARIANT into a set of Name objects (typically for responding to a drop operation).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

NameFactory

public NameFactory()
            throws IOException,
                   UnknownHostException
Constructs a NameFactory using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

NameFactory

public NameFactory(Object obj)
            throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
NameFactory theNameFactory = (NameFactory) obj;

Construct a NameFactory using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to NameFactory.

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

getClsid

public static String getClsid()
getClsid.


equals

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

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

create

public IName create(String nameString)
             throws IOException,
                    AutomationException
Finds the correct name-string parser for the given name string, and uses it to create a new Name object.

Description

The Create method creates a new Name object by searching the "ESRI Name String Parsers" component category for objects implementing IParseNameString. Once the correct name-string parser is found it is used to create the Name object.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
create in interface INameFactory
Parameters:
nameString - The nameString (in)
Returns:
A reference to a com.esri.arcgis.system.IName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

packageNames

public Object packageNames(IEnumName names)
                    throws IOException,
                           AutomationException
Packages the set of names into a VARIANT (typically for initiating a drag operation).

Description

The PackageNames method packages a set of Name objects into a VARIANT. This is typically used to package data objects when starting a custom drag operation.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
packageNames in interface INameFactory
Parameters:
names - A reference to a com.esri.arcgis.system.IEnumName (in)
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

unpackageNames

public IEnumName unpackageNames(Object bytesArray)
                         throws IOException,
                                AutomationException
Unpackages the given VARIANT into a set of Name objects (typically for responding to a drop operation).

Description

The UnpackageNames method unpackages the given VARIANT into a set of Name objects. This is typically used to unpackage data objects when sresponding to a custom drop operation.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
unpackageNames in interface INameFactory
Parameters:
bytesArray - A Variant (in)
Returns:
A reference to a com.esri.arcgis.system.IEnumName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.