|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packagejava.awt.datatransfer
as colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
A class which implements a mechanism to transfer data using cut/copy/paste operations. @see java.awt.Toolkit#getSystemClipboard @version 1.Class Clipboard, constructor Clipboard(String)12 0215 12/0203/0001 @author Amy Fowler
Creates a clipboard object. @see java.awt.Toolkit#getSystemClipboardClass Clipboard, Transferable getContents(Object)
Returns a transferable object representing the current contents of the clipboard. If the clipboard currently has no contents it returnsClass Clipboard, String getName()null
. The parameter Object requestor is not currently used. The method throwsIllegalStateException
if the clipboard is currently unavailable. For example on some platforms the system clipboard is unavailable while it is accessed by another application. @param requestor the object requesting the clip data (not used) @return the current transferable object on the clipboard @throws IllegalStateException if the clipboard is currently unavailable @see java.awt.Toolkit#getSystemClipboard
Returns the name of this clipboard object. @see java.awt.Toolkit#getSystemClipboardClass Clipboard, void setContents(Transferable, ClipboardOwner)
Sets the current contents of the clipboard to the specified transferable object and registers the specified clipboard owner as the owner of the new contents. If there is an existing owner registered that owner is notified that it no longer holds ownership of the clipboard contents. The method throws IllegalStateException
if the clipboard is currently unavailable. For example on some platforms the system clipboard is unavailable while it is accessed by another application. @param content the transferable object representing the clipboard content @param owner the object which owns the clipboard content @throws IllegalStateException if the clipboard is currently unavailable @see java.awt.Toolkit#getSystemClipboard
Defines the interface for classes that will provide data to a clipboard. @version 1.7 028 12/0203/0001 @author Amy Fowler
Each instance represents the opaque concept of a data format as would appear on a clipboard during drag and drop or in a file system.Class DataFlavor, constructor DataFlavor()@version 1.
DataFlavor
objects are constant and never change once instantiated.53 0267 12/0903/01 @author Blake Sullivan @author Laurence P. G. Cable @author Jeff Dunn
Constructs a newClass DataFlavor, constructor DataFlavor(Class, String)DataFlavor
. This constructor is provided only for the purpose of supporting theExternalizable
interface. It is not intended for public (client) use. @since 1.2
Class DataFlavor, constructor DataFlavor(String)ConstructConstructs aDataFlavor
that represents a Java class.The returned
DataFlavor
will have the following characteristics:representationClass = representationClass mimeType = application/x-java-serialized-object@param representationClass the class used to transfer data in this flavor @param humanPresentableName the human-readable string used to identify this flavor.;Ifif this parameter isnull
then the value of the the MIME Content Type is used.
Class DataFlavor, constructor DataFlavor(String, String)ConstructConstructs aDataFlavor
from aMime TypemimeType
string. The string can specify a "class=" parameter to create a DataFlavor
with the desired representation class. If the string does not contain "class=" parameterjava.io.InputStream
is used as default. @param mimeType the string used to identify the MIME type for this flavor. If; if the class specified by "class=" parameter is not successfully loaded then anIllegalArgumentExceptionClassNotFoundException
is thrown.@exception ClassNotFoundException if the class is not loaded @exception IllegalArgumentException ifmimeType
is invalid
Class DataFlavor, constructor DataFlavor(String, String, ClassLoader)ConstructConstructs aDataFlavor
that represents aMimeType
.The returned
DataFlavor
will have the following characteristics:If the
mimeType
is "application/x-java-serialized-object; class=<representation class>" the result is the same as callingnew DataFlavor(Class:forName(<representation class>)
.as above
otherwiseOtherwise:representationClass = InputStream mimeType = mimeType@param mimeType the string used to identify the MIME type for this flavor.;Ifif the themimeType
does not specify a "class=" parameter or if the class is not successfully loaded then anIllegalArgumentException
is thrown.@param humanPresentableName the human-readable string used to identify this flavor. If; if this parameter isnull
then the value of the the MIME Content Type is used.@exception IllegalArgumentException ifmimeType
is invalid or if the class is not successfully loaded
Class DataFlavor, Object clone()ConstructConstructs aDataFlavor
that represents aMimeType
.The returned
DataFlavor
will have the following characteristics:If the mimeType is "application/x-java-serialized-object; class=<representation class>" the result is the same as calling
new DataFlavor(Class:forName(<representation class>)
.as above
otherwiseOtherwise:representationClass = InputStream mimeType = mimeType@param mimeType the string used to identify the MIME type for this flavor @param humanPresentableName the human-readiblereadable string used to identify this flavor @param classLoader the class loader to use @exception ClassNotFoundException if the class is not loaded @exception IllegalArgumentException ifmimeType
is invalid
Returns a clone of thisClass DataFlavor, boolean equals(DataFlavor)DataFlavor
. @return a clone of thisDataFlavor
Tests aClass DataFlavor, boolean equals(Object)DataFlavor
to thisDataFlavor
for equality. TwoDataFlavorsDataFlavor
s are considered equal if and only if their MIME primary type and subtype and representation class are equal. Additionally if the primary type is "text" the subtype denotes a text flavor which supports the charset parameter and the representation class is notjava.io.Reader
java.lang.String
java.nio.CharBuffer
or[C
thecharset parameter must also be equal. If
either DataFlavora charset isof primarynottypeexplicitly"text"specifiedbut no charset isfor one or bothspecifiedDataFlavor
s the platform defaultcharsetencoding is assumed. SeeselectBestTextFlavor
for a list of text flavors which support the charset parameter. @param that theDataFlavor
.to compare withthis
@returntrue
ifthethat
DataFlavors represent exactlyis equivalent tothethisDataFlavor
;samefalse
type.otherwise @see #selectBestTextFlavor
Class DataFlavor, boolean equals(String)If the objectTests an arbitraryisObject
an instanceto thisofDataFlavor
for equality. TwoDataFlavors are considered
representationClassequal if and only if their MIME primary typewilland subtypebeand representation class arecomparedequal.ThisAdditionally if the primary type is "text" the subtype denotes a text flavor which supports the charset parameter and the representationmethod doesclass is notusejava.io.Reader
equals(java.lang.String
)java.nio.CharBuffer
or[C
thecharset
parameter must also bemethodequal. Ifso it doesa charset is notreturnexplicitly specified for one or boths the platform default encoding is assumed. See
trueDataFlavorselectBestTextFlavor
forthe objectsa list ofStringtexttypeflavors which support the charset parameter. @param that theObject
to compare withthis
@returntrue
ifthethat
objects areis equivalentequalto thisDataFlavor
;false
otherwise @see #selectBestTextFlavor
Class DataFlavor, String getHumanPresentableName()CompareCompares only themimeType
against the passed inString
andrepresentationClass
is not considered in the comparison. IfrepresentationClass
needs to be compared thenequals(new DataFlavor(s))
may be used. @deprecated As inconsistent withhashCode()
contract useisMimeTypeEqual(String)
instead. @return true if the String (MimeType) is equal
Returns the human presentable name for the dataClass DataFlavor, String getMimeType()foramtformat that thisDataFlavor
represents. This name would be localized for different countries. @return the human presentable name for the data format that thisDataFlavor
represents
Returns the MIME type string for this DataFlavor
. @return the MIME type string for this flavor
Class DataFlavor, String getParameter(String)Returns the human presentable name for thisClass DataFlavor, String getPrimaryType()DataFlavor
ifparamName
equals "humanPresentableName". Otherwise returns the MIME type value associated withparamName
. @param paramName the parameter name requested @return the value of the name parameter ornull
if there is no associated value @see MimeType#getParameter
Returns the primary MIME type for thisClass DataFlavor, Reader getReaderForText(Transferable)DataFlavor
. @return the primary MIME type of thisDataFlavor
Gets aClass DataFlavor, Class getRepresentationClass()readerReader foranainput streamtext flavor decoded if necessary for the expected charset (encoding).This worksTheonly if thesupported representationclass ofclasses arethisjava.io.Reader
flavorjava.lang.String
isjava.nio.CharBuffer
[C
java.io.InputStream
(orjava.nio.ByteBuffer
aandsubclass)[B
.In case of representation class beingBecause text flavors which do
Readernot support theresult willcharset parameterbeare encoded in a non-standard format thisclassmethod should notitselfbe called for such flavors.@returnHowevera Readerin order toreadmaintain backward-compatibility if this method is called for such a flavor this method will treat thedataflavor@exceptionasIllegalArgumentException ifthough it supports therepresentation class is notcharset parameter and attemptjava.io.InputStreamtoordecodejavait accordingly.langSeeselectBestTextFlavor
for a list of text flavors which do not support the charset parameter.String@param transferable theTransferable
whose data will be requested in this flavor @return aReader
to read theTransferable
's data @exception IllegalArgumentException if thecharset (characterrepresentationencoding)class is notsupported byone of theJDK.seven listed above @exception IllegalArgumentException if thetransferableTransferable
hasnull
data.@exception NullPointerException if thetransferable argumentTransferable
isnull
@exception UnsupportedEncodingException if.thethis flavor's representation isjava.io.InputStream
java.nio.ByteBuffer
or[B
and this flavor's encoding is not supported by thisflavor.implementation of the Java platform @exception UnsupportedFlavorException if thetransferableTransferable
does not support this flavor.@exception IOException if the data cannot be read because of an I/O error @see #selectBestTextFlavor @since 1.3
Returns theClass DataFlavor, String getSubType()Class
which objects supporting thisDataFlavor
will return when thisDataFlavor
is requested. @return theClass
which objects supporting thisDataFlavor
will return when thisDataFlavor
is requested
Returns the sub MIME type of thisClass DataFlavor, int hashCode()DataFlavor
. @return the Sub MIME type of thisDataFlavor
Returns hash code for thisClass DataFlavor, boolean isFlavorJavaFileListType()DataFlavor
. For two equalDataFlavorsDataFlavor
s hash codes are equal. For theString
that matchesDataFlavor.equals(String)
it is not guaranteed thatDataFlavor
's hash code is equal to the hash code of theString
. @return a hash code for thisDataFlavor
Returns true if theClass DataFlavor, boolean isFlavorRemoteObjectType()DataFlavor
specified represents a list of file objects. @return true ifflavortheDataFlavor
specified represents a List of File objects
Returns true if theClass DataFlavor, boolean isFlavorSerializedObjectType()DataFlavor
specified represents a remote object. @return true if theDataFlavor
specified represents a Remote Object
Returns true if theClass DataFlavor, boolean isMimeTypeEqual(DataFlavor)DataFlavor
specified represents a serialized object. @return true if theDataFlavor
specified represents a Serialized Object
Class DataFlavor, boolean isMimeTypeEqual(String)CompareCompares themimeType
of twoDataFlavor
objects.noNo parameters are considered. @param dataFlavor theDataFlavor
to be compared @return true if theMimeTypesMimeType
s are equal otherwise false
Returns whether the string representation of the MIME type passed in is equivalent to the MIME type of thisClass DataFlavor, boolean isMimeTypeSerializedObject()DataFlavor
. Parameters are notincudedincluded in the comparison.The comparison may involve adding default attributes for some MIME types (such as adding charset=US-ASCII to text/plain MIME types that have no charset parameter specified).@param mimeType the string representation of the MIME type @return true if the string representation of the MIME type passed in is equivalent to the MIME type of thisDataFlavor
; false otherwise.@throws NullPointerException if mimeType isnull
Class DataFlavor, boolean isRepresentationClassInputStream()doesDoes theDataFlavor
represent a serialized object
Class DataFlavor, boolean isRepresentationClassRemote()doesDoes theDataFlavor
represent ajava.io.InputStream
Returns true if the representation class isClass DataFlavor, boolean isRepresentationClassSerializable()Remote
. @return true if the representation class isRemote
Returns true if the representation class can be serialized. @return true if the representation class can be serializedClass DataFlavor, boolean match(DataFlavor)
Tests aClass DataFlavor, String normalizeMimeType(String)DataFlavor
to thisDataFlavor
for equality. TwoDataFlavorsDataFlavor
s are considered equal if andmatchonly if their MIME primarytypestype andsubtypessubtype and representationclassesclass areallequal. Additionally if the primary type is "text" the subtype denotes a text flavor which supports the charset parameter and the representation class isalsonotconsideredjava.io.Reader
Ifjava.lang.String
eitherjava.nio.CharBuffer
DataFlavororis[C
oftheprimarycharset
typeparameter"text"must also bebutequal. Ifnoa charset is not explicitly specified for one or bothDataFlavor
s the platform defaultcharsetencoding is assumed. SeeselectBestTextFlavor
for a list of text flavors which support the charset parameter. @param that theDataFlavor
.to compare withthis
@returntrue
ifthat
is equivalent to thisDataFlavor
;false
otherwise @see #selectBestTextFlavor
Called for each MIME type string to give DataFlavor
subtypes the opportunity to change how the normalization of MIME types is accomplished. One possible use would be to add default parameter/value pairs in cases where none are present in the MIME type string passed in. This method is never invoked by this implementation from 1.1 onwards. @deprecated
Class DataFlavor, String normalizeMimeTypeParameter(String, String)Called onClass DataFlavor, void readExternal(ObjectInput)DataFlavor
for every MIME Type parameter to allowDataFlavor
subclasses to handle special parameters like the text/plaincharset
parameters whose values are case insensitive. (MIME type parameter values are supposed to be case sensitive.This method is called for each parameter name/value pair and should return the normalized representation of the
parameterValue
. This method is never invoked by this implementation from 1.1 onwards. @deprecated
Class DataFlavor, DataFlavor selectBestTextFlavor(DataFlavor[])restoreRestores thisDataFlavor
fromana Serialized state.
Selects the best textClass DataFlavor, void setHumanPresentableName(String)DataFlavor
from an array ofDataFlavor
s. OnlyDataFlavor.stringFlavor
and equivalent flavors and flavors that have a primary MIME type of "text" are considered for selection.Flavors are first sorted by their MIME types in the following order:
- "text/sgml"
- "text/xml"
- "text/html"
- "text/rtf"
- "text/enriched"
- "text/richtext"
- "text/uri-list"
- "text/tab-separated-values"
- "text/t140"
- "text/rfc822-headers"
- "text/parityfec"
- "text/directory"
- "text/css"
- "text/calendar"
- "application/x-java-serialized-object"
- "text/plain"
- "text/<other>"
For example "text/sgml" will be selected over "text/html" and
DataFlavor.stringFlavor
will be chosen overDataFlavor.plainTextFlavor
.If two or more flavors share the best MIME type in the array then that MIME type will be checked to see if it supports the charset parameter.
The following MIME types support or are treated as though they support the charset parameter:
The following MIME types do not support or are treated as though they do not support the charset parameter:
- "text/sgml"
- "text/xml"
- "text/html"
- "text/enriched"
- "text/richtext"
- "text/uri-list"
- "text/directory"
- "text/css"
- "text/calendar"
- "application/x-java-serialized-object"
- "text/plain"
For "text/<other>" MIME types the first time the JRE needs to determine whether the MIME type supports the charset parameter it will check whether the parameter is explicitly listed in an arbitrarily chosen
- "text/rtf"
- "text/tab-separated-values"
- "text/t140"
- "text/rfc822-headers"
- "text/parityfec"
DataFlavor
which uses that MIME type. If so the JRE will assume from that point on that the MIME type supports the charset parameter and will not check again. If the parameter is not explicitly listed the JRE will assume from that point on that the MIME type does not support the charset parameter and will not check again. Because this check is performed on an arbitrarily chosenDataFlavor
developers must ensure that allDataFlavor
s with a "text/<other>" MIME type specify the charset parameter if it is supported by that MIME type. Developers should never rely on the JRE to substitute the platform's default charset for a "text/<other>" DataFlavor. Failure to adhere to this restriction will lead to undefined behavior.If the best MIME type in the array does not support the charset parameter the flavors which share that MIME type will then be sorted by their representation classes in the following order:
java.io.InputStream
java.nio.ByteBuffer
[B
<all others>.If two or more flavors share the best representation class or if no flavor has one of the three specified representations then one of those flavors will be chosen non-deterministically.
If the best MIME type in the array does support the charset parameter the flavors which share that MIME type will then be sorted by their representation classes in the following order:
java.io.Reader
java.lang.String
java.nio.CharBuffer
[C
<all others>.If two or more flavors share the best representation class and that representation is one of the four explicitly listed then one of those flavors will be chosen non-deterministically. If however no flavor has one of the four specified representations the flavors will then be sorted by their charsets. Unicode charsets such as "UTF-16" "UTF-8" "UTF-16BE" "UTF-16LE" and their aliases are considered best. After them the platform default charset and its aliases are selected. "US-ASCII" and its aliases are worst. All other charsets are chosen in alphabetical order but only charsets supported by this implementation of the Java platform will be considered.
If two or more flavors share the best charset the flavors will then again be sorted by their representation classes in the following order:
java.io.InputStream
java.nio.ByteBuffer
[B
<all others>.If two or more flavors share the best representation class or if no flavor has one of the three specified representations then one of those flavors will be chosen non-deterministically. @param availableFlavors an array of available
@return the best (highest fidelity) flavorDataFlavor
sin anaccordingencoding supported by the JDKto the rules specified above ornull
ifnoneavailableFlavors
canisbenull
has zero length or contains no text flavors @sincefound1.3
Sets the human presentable name for the data format that this DataFlavor
represents. This name would be localized for different countries. @param humanPresentableName the new human presentable name
Class DataFlavor, String toString()String representation of thisClass DataFlavor, Class tryToLoadClass(String, ClassLoader)DataFlavor
and its parameters. TheresultresultingString
contains the name of theDataFlavor
class this flavor's MIME type and its representation class.andIf this flavorMimehas a primary MIME type ofthis"text" supports the charset parameter and hasFlavoran encoded representation the flavor's charset is also included. SeeselectBestTextFlavor
for a list of text flavors which support the charset parameter. @return string representation of thisDataFlavor
@see #selectBestTextFlavor
Class DataFlavor, void writeExternal(ObjectOutput)triedTries to load a class from: the bootstrap loader the system loader the context loader (if one is present) and finally the loader specified. @param className the name of the class to be loaded @param fallback the fallback loader @throwsreturn the class loaded @exception ClassNotFoundException if class is not found
Class DataFlavor, DataFlavor javaFileListFlavorSerializeSerializes thisDataFlavor
.
To transfer a list of files to/from Java (and the underlying platform) aClass DataFlavor, String javaJVMLocalObjectMimeTypeDataFlavor
of this type/subtype and representation class ofjava.util.List
is used. Each element of the list is required/guaranteed to be of typejava.io.File
.
Class DataFlavor, String javaRemoteObjectMimeTypetoTo transfer a reference to an arbitrary Java object reference that has no associated MIME Content-type across aTransferable
interface WITHIN THE SAME JVM aDataFlavor
with this type/subtype is used with arepresentationClass
equal to the type of the class/interface being passed across theTransferble
.The object reference returned from
Transferable.getTransferData
for a()DataFlavor
with this MIME Content-Type is required to be aninstanceofinstance of the representation Class of theDataFlavor
.
In order to pass a live link to a Remote object via a Drag and DropClass DataFlavor, String javaSerializedObjectMimeTypeACTION_LINK
operation a Mime Content Type of application/x-java-remote-object should be used where the representation class of theDataFlavor
represents the type of theRemote
interface to be transferred.
Class DataFlavor, DataFlavor plainTextFlavoraA MIME Content-Type of application/x-java-serialized-object represents a graph of Java object(s) that have been made persistent. The representation class associated with thisDataFlavor
identifies the Java type of an object returned as a reference from an invocationjava.awt.datatransfer.getTransferData
.()
TheClass DataFlavor, DataFlavor stringFlavorDataFlavor
representing plain text withunicodeUnicode encoding where:representationClass = InputStream mimeType = "text/plain; charset=unicode"ThisDataFlavor
has been deprecated because (1) Its representation is an InputStream an 8-bit based representation while Unicode is a 16-bit character set; and (2) The charset "unicode" is not well-defined. "unicode" implies a particular platform's implementation of Unicode not a cross-platform implementation. @deprecated as of 1.3. UseDataFlavor.getReaderForText( Transferable)
instead ofTransferable. getTransferData(DataFlavor.plainTextFlavor)
.
TheDataFlavor
representing a Java Unicode String class where:representationClass = java.lang.String mimeType = "application/x-java-serialized-object"
AClass FlavorMap, Map getFlavorsForNatives(String[])Thetwo-wayFlavorMapMapis an interfacebetweento"natives"a(Strings)map that mapswhich correspond to platformnative type names (strings) to-MIME type stringsspecfic data formats andalso their"flavors"associated(DataFlavors. This map is used by the)DnD systemwhich corerspond tomapplatformdata types-independenttoMIME typesto enable the transfer of objects between Java.and the platform via the platform DnD SystemFlavorMaps need not be symmetric but typically are.@see SystemFlavorMap@version 1.14 0216 12/0203/0001 @since 1.2
Class FlavorMap, Map getNativesForFlavors(DataFlavor[])mapReturnsnatives to corresponding flavors @param native TheaarrayMap
ofString nativethetypesspecifiedtoString
mapnatives toDataFlavorstheirorcorrespondingnullDataFlavor
.@returnTheareturnedMap
object whichiscontains 0 or more entriesa modifiable copy of thiswithFlavorMap
'skeysinternalofdata.type String and values of type DataFlavorClient code is free to modify thewhereMap
the DataFlavor valueswithout affecting thismappedobject.(if@paramany)nativesare thean array(platformofindependent)String
stypes corresponding to their nativewhich will be the key(platformsetdependent)ofdata typethe returnednamesMap
. Ifthe parameter isnull
then themap returned should beisthe complete mapspecified a mapping of allmappings between native names and theirString
corresponding DataFlavorsnatives currently known tothe implementation at the time of the call. The MapthisreturnedFlavorMap
is mutable andto their correspondingconsideredDataFlavor
stowill beowned byreturned.the@returncallerathusjava.util.Map
allowingof"nesting"String
of FlavorMapnatives toimplementations.DataFlavor
s
mapReturnsflavors to native data types names @param flavors TheaarrayMap
ofDataFlavors tothe specifiedmapDataFlavor
s tonative typestheir correspondingorString
nullnative.@returnTheareturnedMap
objectwhich contains between 0 or more entries with keys of typeisDataFlavor and valuesa modifiable copy oftypethisStringFlavorMap
'swhereinternalthedata.String values mappedClient code is(iffreeany)toaremodify thenative (platformMap
dependent)withoutdata typeaffecting thisnameobject.corresponding@paramto theflavors an(platformarrayindependent)ofDataFlavor
s(MimeType).whichIf the parameter is null thenwill be the key set of the returnedMap.
returnedIfshouldnull
be the complete mapis specified a mapping of allmappings between DataFlavors and their corresponding nativeDataFlavor
snamescurrently known tothe implementation at the time of the call. ThethisMapFlavorMap
returned is mutableto their correspondingandString
considered tonatives will beowned byreturned.the@returncallerathusjava.util.Map
allowingof"nesting"DataFlavor
softoFlavorMapString
implementations.natives
AClass StringSelection, constructor StringSelection(String)Transferable
which implements the capability required to transfer aString
. ThisTransferable
properly supportsDataFlavor.stringFlavor
and all equivalent flavors. Support forDataFlavor.plainTextFlavor
and all equivalent flavors is deprecated. No otherDataFlavorsDataFlavor
s are supported. @see java.awt.datatransfer.DataFlavor.stringFlavor @see java.awt.datatransfer.DataFlavor.plainTextFlavor
Creates aClass StringSelection, Object getTransferData(DataFlavor)Transferable
capable of transferring the specifiedString
.
Returns theClass StringSelection, DataFlavor[] getTransferDataFlavors()Transferable
's data in the requestedDataFlavor
if possible. If the desired flavor isDataFlavor.stringFlavor
or an equivalent flavor theString
representing the selection is returned. If the desired flavor is DataFlavor.plainTextFlavor or an equivalent flavor aReader
is returned. Note: The behavior of this method for DataFlavor.plainTextFlavor and equivalentDataFlavorsDataFlavor
s is inconsistent with the definition ofDataFlavor.plainTextFlavor
. @param flavor the requested flavor for the data @return the data in the requested flavor as outlined above.@throws UnsupportedFlavorException if the requested data flavor is not equivalent to eitherDataFlavor.stringFlavor
orDataFlavor.plainTextFlavor
.@throws IOException if an IOException occurs while retrieving the data. By default StringSelection never throws this exception but a subclass may. @throws NullPointerException if flavor isnull
@see java.io.Reader
Returns an array of flavors in which thisClass StringSelection, boolean isDataFlavorSupported(DataFlavor)Transferable
can provide the data.DataFlavor.stringFlavor
is properly supported. Support forDataFlavor.plainTextFlavor
is deprecated. @return an array of length two whose elements areDataFlavor. stringFlavor
andDataFlavor.plainTextFlavor
.
Returns whether the requested flavor is supported by thisTransferable
. @param flavor the requested flavor for the data @return true ifflavor
is equal toDataFlavor.stringFlavor
orDataFlavor.plainTextFlavor
; false ifflavor
is not one of the above flavors @throws NullPointerException if flavor isnull
Class SystemFlavorMap, DataFlavor decodeDataFlavor(String)The SystemFlavorMap isan externallya configurable mapthat maps platform native typebetweennames"natives" (stringsStrings) which correspond toMIMEplatform-specifictype stringsdata formats andalso"flavors" (DataFlavors) whichtheir associatedcorrespond toDataFlavors.platform-independent MIME types. Thismapmapping is used by theDnDdatasystem to map platformtransfer subsystem to transfer datatypesbetweento MIME typesJava and nativetoapplications and between Java applications in separate VMs.enableIn thetransferSunof objects betweenreference implementation theJavadefault SystemFlavorMap is initialized by the filejre/lib/flavormap.properties
and theplatform viacontents of theplatformURL referenced by the AWT propertyAWT.
DnD.flavorMapFileURL. SeeSystemflavormap.properties
for details. @version 1.19 0227 12/0203/0001 @since 1.2
Decodes aClass SystemFlavorMap, String decodeJavaMIMEType(String)String
native for use as aDataFlavor
. @param nat theString
to decode @return the decodedJavaDataFlavor
MIMETypeorasnull
aifDataFlavornat is not an encodedString
native
Decodes aClass SystemFlavorMap, String encodeDataFlavor(DataFlavor)String
native for use as a Java MIME type. @param nat theString
to decode @return the decoded JavaMIMETypeMIME type ornull
if nat is not an encodedString
stringnative
Class SystemFlavorMap, String encodeJavaMIMEType(String)@return encodeEncodes aJavaDataFlavor
MIMETypefor use as aString
native. The format of an encodedDataFlavor
is implementation-dependent. The only restrictions are:MIME type
- The encoded representation is
null
if and only if the specifiedDataFlavor
isnull
or its MIME typeString
isnull
.- The encoded representations for two non-
null
DataFlavor
s with non-null
MIME typeString
s are equal if and only if theString
s of theseDataFlavor
s are equal according toString.equals(Object)
.Sun's reference implementation of this method returns the MIME
typenameString
of the specifiedDataFlavor
prefixed withJAVA_DATAFLAVOR:
. @param flav theDataFlavor
to encode @return the encodedString
ornull
if flav isnull
or has anull
MIME type
Class SystemFlavorMap, FlavorMap getDefaultFlavorMap()@return encodeEncodes aJava MIMETypeMIME type for use as aString
native. The format of an encoded representation of a MIME type is implementation-dependent. The only restrictions are:
- The encoded representation is
null
if and only if the MIME typeString
isnull
.- The encoded representations for two non-
null
MIME typeString
s are equal if and only if theseString
s are equal according toString.equals(Object)
.Sun's reference implementation of this method returns the
specified MIME typeString
prefixed withJAVA_DATAFLAVOR:
. @param mimeType the MIME typenameto encode @return the encodedString
ornull
if mimeType isnull
Class SystemFlavorMap, Map getFlavorsForNatives(String[])getReturns the defaultsystemFlavorMapimplementationfor this thread's ClassLoader.
Class SystemFlavorMap, Map getNativesForFlavors(DataFlavor[])mapReturns aMap
of the specifiedString
natives to their most preferredDataFlavor
. EachDataFlavor
value will be the same as the firstDataFlavor
in the List returned bygetFlavorsForNative
for the specified native.If a specified native is previously unknown to the data transfer subsystem and that native has been properly encoded then invoking this method will establish a mapping in both directions between the specified native and a
natives toDataFlavor
whose MIME type is a decoded version of the native. @param natives an array ofString
s which will be the key set of the returnedMap
. Ifnull
is specified a mapping of all supportedString
natives to their most preferredDataFlavor
s will be returned. @return ajava.util.Map
ofString
correspondingDataFlavor
s @see #getFlavorsForNative @seeflavors#encodeJavaMIMEType
Class SystemFlavorMap, boolean isJavaMIMEType(String)mapReturnsflavorsaMap
of the specifiedDataFlavor
s to their most preferredString
native. Each native value will be the same as the first native in the List returned bygetNativesForFlavor
for the specified flavor.If a specified
DataFlavor
is previously unknown to the data transfer subsystem then invoking this method will establish a mapping in both directions between the specifiedDataFlavor
and an encoded version of its MIME type as its native. @param flavors an array ofDataFlavor
s which will be the key set of the returnedMap
. Ifnull
is specified a mapping of allDataFlavor
s known to the datatypestransfer subsystem to their most preferredString
natives will be returned. @return ajava.util.Map
ofDataFlavor
s toString
natives @see #getNativesForFlavor @seenames#encodeDataFlavor
@returnReturnsifwhether thenative typespecifiedstringString
is an encoded JavaMIMETypeMIME type. @param str theString
to test @returntrue
if theString
is encoded;false
otherwise
Defines the interface for classes that can be used to provide data for a transfer operation. @version 1.Class Transferable, boolean isDataFlavorSupported(DataFlavor)8 0210 12/0203/0001 @author Amy Fowler
Returns whether or not the specified data flavor is supported for this object. @param flavor the requested flavor for the data @return boolean indicatingwjetherwhether or not the data flavor is supported
Signals that the requested data is not supported in this flavor. @see Transferable#getTransferData @version 1.Class UnsupportedFlavorException, constructor UnsupportedFlavorException(DataFlavor)12 0213 12/0903/01 @author Amy Fowler
Constructs an UnsupportedFlavorException. @param flavor the flavor object which caused the exception@throws NullPointerException if.flavor isMay benull
.