Package docking.dnd
Class GenericDataFlavor
java.lang.Object
java.awt.datatransfer.DataFlavor
docking.dnd.GenericDataFlavor
- All Implemented Interfaces:
Externalizable
,Serializable
,Cloneable
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:
-
Field Summary
Fields inherited from class java.awt.datatransfer.DataFlavor
allHtmlFlavor, fragmentHtmlFlavor, imageFlavor, javaFileListFlavor, javaJVMLocalObjectMimeType, javaRemoteObjectMimeType, javaSerializedObjectMimeType, plainTextFlavor, selectionHtmlFlavor, stringFlavor
-
Constructor Summary
ConstructorDescriptionConstruct a new GenericDataFlavor.GenericDataFlavor
(Class<?> representationClass, String humanPresentableName) Construct a GenericDataFlavor that represents a Java classGenericDataFlavor
(String mimeType) construct a GenericDataFlavor from a Mime Type string.GenericDataFlavor
(String mimeType, String humanPresentableName) Construct a GenericDataFlavor that represents a MimeType If the mimeType is"application/x-java-serialized-object; class=<representation class>", the result is the same as calling new GenericDataFlavor(Class:forName(<representation class>)
GenericDataFlavor
(String mimeType, String humanPresentableName, ClassLoader classLoader) Construct a GenericDataFlavor that represents a MimeType If the mimeType is"application/x-java-serialized-object; class=<representation class>", the result is the same as calling new GenericDataFlavor(Class:forName(<representation class>).
-
Method Summary
Modifier and TypeMethodDescriptionboolean
equals
(DataFlavor dataFlavor) Return true if dataFlavor equals this generic data flavor.boolean
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 Details
-
GenericDataFlavor
public GenericDataFlavor()Construct a new GenericDataFlavor. -
GenericDataFlavor
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
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:
ClassNotFoundException
- if the class could not be loadedIllegalArgumentException
- thrown if mimeType does not specify a "class=" parameter
-
GenericDataFlavor
Construct a GenericDataFlavor that represents a MimeType If the mimeType is"application/x-java-serialized-object; class=<representation class>", the result is the same as calling new GenericDataFlavor(Class:forName(<representation class>)
- Parameters:
mimeType
- the string used to identify the MIME type for this flavorhumanPresentableName
- the human-readable string used to identify this flavor- Throws:
IllegalArgumentException
- thrown if the mimeType does not specify a "class=" parameter, or if the class is not successfully loaded
-
GenericDataFlavor
public GenericDataFlavor(String mimeType, String humanPresentableName, ClassLoader classLoader) throws ClassNotFoundException Construct a GenericDataFlavor that represents a MimeType If the mimeType is"application/x-java-serialized-object; class=<representation class>", the result is the same as calling new GenericDataFlavor(Class:forName(<representation class>).
- 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:
ClassNotFoundException
- is thrown if class could not be loaded
-
-
Method Details
-
equals
Return true if dataFlavor equals this generic data flavor.- Overrides:
equals
in classDataFlavor
-
equals
Return true if obj is equal this generic data flavor.- Overrides:
equals
in classDataFlavor
-