Spec-Zone .ru
спецификации, руководства, описания, API
|
public class DataFormat
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static DataFormat |
FILES
Represents a List of Files.
|
static DataFormat |
HTML
Represents an HTML formatted string.
|
static DataFormat |
IMAGE
A special platform specific image type, such as is commonly used
on the clipboard and interoperates widely with other applications.
|
static DataFormat |
PLAIN_TEXT
Represents a plain text string.
|
static DataFormat |
RTF
Represents an RTF formatted string
|
static DataFormat |
URL
Represents a URL, encoded as a String
|
Constructor and Description |
---|
DataFormat(java.lang.String... ids)
Create a new DataFormat, specifying the set of ids that are associated with
this data format.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
|
java.util.Set<java.lang.String> |
getIdentifiers()
Gets the unmodifiable set of identifiers for this DataFormat.
|
int |
hashCode()
Returns a hash code for this
DataFormat object. |
static DataFormat |
lookupMimeType(java.lang.String mimeType)
Looks for the DataFormat which has been previously created with
the given mime type as one of its ids.
|
java.lang.String |
toString()
Returns a string representation of this
DataFormat object. |
public static final DataFormat PLAIN_TEXT
public static final DataFormat HTML
public static final DataFormat RTF
public static final DataFormat URL
public static final DataFormat IMAGE
public static final DataFormat FILES
public DataFormat(java.lang.String... ids)
DataFormat fmt = new DataFormat("text/foo", "text/bar");
Clipboard clipboard = Clipboard.getSystemClipboard();
ClipboardContent content = new ClipboardContent();
content.pu(fmt, "Hello");
clipboard.setContent(content);
With the above code, if I were to look on the clipboard, I'd find the String "Hello"
listed both for "text/foo" and "text/bar" on the clipboard.ids
- The set of ids used to represent this DataFormat on the clipboard.java.lang.IllegalArgumentException
- if one of the given mime types is already
assigned to another DataFormat.public final java.util.Set<java.lang.String> getIdentifiers()
public java.lang.String toString()
DataFormat
object.toString
in class java.lang.Object
DataFormat
object.public int hashCode()
DataFormat
object.hashCode
in class java.lang.Object
DataFormat
object.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the reference object with which to compare.true
if this object is equal to the obj
argument; false
otherwise.public static DataFormat lookupMimeType(java.lang.String mimeType)
mimeType
- If null or the empty string, then null is returned.Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. Use is subject to