Package docking.dnd
Class GenericDataFlavor
- java.lang.Object
-
- java.awt.datatransfer.DataFlavor
-
- docking.dnd.GenericDataFlavor
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,java.lang.Cloneable
public class GenericDataFlavor extends java.awt.datatransfer.DataFlavor
Generic data flavor class to override the equals(DataFlavor) method in order to have data flavors support the same general class types such as an ArrayList.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GenericDataFlavor()
Construct a new GenericDataFlavor.GenericDataFlavor(java.lang.Class<?> representationClass, java.lang.String humanPresentableName)
Construct a GenericDataFlavor that represents a Java classGenericDataFlavor(java.lang.String mimeType)
construct a GenericDataFlavor from a Mime Type string.GenericDataFlavor(java.lang.String mimeType, java.lang.String humanPresentableName)
Construct a GenericDataFlavor that represents a MimeType If the mimeType is "application/x-java-serialized-object; class=", the result is the same as calling new GenericDataFlavor(Class:forName( ) GenericDataFlavor(java.lang.String mimeType, java.lang.String humanPresentableName, java.lang.ClassLoader classLoader)
Construct a GenericDataFlavor that represents a MimeType If the mimeType is "application/x-java-serialized-object; class=", the result is the same as calling new GenericDataFlavor(Class:forName( ).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.awt.datatransfer.DataFlavor dataFlavor)
Return true if dataFlavor equals this generic data flavor.boolean
equals(java.lang.Object obj)
Return true if obj is equal this generic data flavor.-
Methods inherited from class java.awt.datatransfer.DataFlavor
clone, equals, getDefaultRepresentationClass, getDefaultRepresentationClassAsString, getHumanPresentableName, getMimeType, getParameter, getPrimaryType, getReaderForText, getRepresentationClass, getSubType, getTextPlainUnicodeFlavor, hashCode, isFlavorJavaFileListType, isFlavorRemoteObjectType, isFlavorSerializedObjectType, isFlavorTextType, isMimeTypeEqual, isMimeTypeEqual, isMimeTypeSerializedObject, isRepresentationClassByteBuffer, isRepresentationClassCharBuffer, isRepresentationClassInputStream, isRepresentationClassReader, isRepresentationClassRemote, isRepresentationClassSerializable, match, normalizeMimeType, normalizeMimeTypeParameter, readExternal, selectBestTextFlavor, setHumanPresentableName, toString, tryToLoadClass, writeExternal
-
-
-
-
Constructor Detail
-
GenericDataFlavor
public GenericDataFlavor()
Construct a new GenericDataFlavor.
-
GenericDataFlavor
public GenericDataFlavor(java.lang.Class<?> representationClass, java.lang.String humanPresentableName)
Construct a GenericDataFlavor that represents a Java class- Parameters:
representationClass
- the class used to transfer data in this flavorhumanPresentableName
- the human-readable string used to identify this flavor. If this parameter is null then the value of the the MIME Content Type is used.
-
GenericDataFlavor
public GenericDataFlavor(java.lang.String mimeType) throws java.lang.ClassNotFoundException
construct a GenericDataFlavor from a Mime Type string.- Parameters:
mimeType
- he string used to identify the MIME type for this flavor The string must specify a "class=" parameter in order to succeed in constructing a DataFlavor.- Throws:
java.lang.ClassNotFoundException
- if the class could not be loadedjava.lang.IllegalArgumentException
- thrown if mimeType does not specify a "class=" parameter
-
GenericDataFlavor
public GenericDataFlavor(java.lang.String mimeType, java.lang.String humanPresentableName)
Construct a GenericDataFlavor that represents a MimeType If the mimeType is "application/x-java-serialized-object; class=", the result is the same as calling new GenericDataFlavor(Class:forName( ) - Parameters:
mimeType
- the string used to identify the MIME type for this flavorhumanPresentableName
- the human-readable string used to identify this flavor- Throws:
java.lang.IllegalArgumentException
- thrown if the mimeType does not specify a "class=" parameter, or if the class is not successfully loaded
-
GenericDataFlavor
public GenericDataFlavor(java.lang.String mimeType, java.lang.String humanPresentableName, java.lang.ClassLoader classLoader) throws java.lang.ClassNotFoundException
Construct a GenericDataFlavor that represents a MimeType If the mimeType is "application/x-java-serialized-object; class=", the result is the same as calling new GenericDataFlavor(Class:forName( ). - Parameters:
mimeType
- the string used to identify the MIME type for this flavorhumanPresentableName
- the human-readable string used to identify this flavor.classLoader
- class loader to load the class- Throws:
java.lang.ClassNotFoundException
- is thrown if class could not be loaded
-
-
Method Detail
-
equals
public boolean equals(java.awt.datatransfer.DataFlavor dataFlavor)
Return true if dataFlavor equals this generic data flavor.- Overrides:
equals
in classjava.awt.datatransfer.DataFlavor
-
equals
public boolean equals(java.lang.Object obj)
Return true if obj is equal this generic data flavor.- Overrides:
equals
in classjava.awt.datatransfer.DataFlavor
-
-