Class DataFormat
java.lang.Object
javafx.scene.input.DataFormat
Data format identifier used as means
 of identifying the data stored on a clipboard/dragboard.
- Since:
- JavaFX 2.0
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final DataFormatRepresents a List of Files.static final DataFormatRepresents an HTML formatted string.static final DataFormatA special platform specific image type, such as is commonly used on the clipboard and interoperates widely with other applications.static final DataFormatRepresents a plain text string.static final DataFormatRepresents an RTF formatted stringstatic final DataFormatRepresents a URL, encoded as a String
- 
Constructor SummaryConstructorsConstructorDescriptionDataFormat(String... ids) Create a new DataFormat, specifying the set of ids that are associated with this data format.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.Gets the unmodifiable set of identifiers for this DataFormat.inthashCode()Returns a hash code for thisDataFormatobject.static DataFormatlookupMimeType(String mimeType) Looks for the DataFormat which has been previously created with the given mime type as one of its ids.toString()Returns a string representation of thisDataFormatobject.
- 
Field Details- 
PLAIN_TEXTRepresents a plain text string.
- 
HTMLRepresents an HTML formatted string.
- 
RTFRepresents an RTF formatted string
- 
URLRepresents a URL, encoded as a String
- 
IMAGEA special platform specific image type, such as is commonly used on the clipboard and interoperates widely with other applications. For example, on Mac this might ultimately be a TIFF while on Windows it might be a DIB (device independent bitmap).
- 
FILESRepresents a List of Files.
 
- 
- 
Constructor Details- 
DataFormatCreate a new DataFormat, specifying the set of ids that are associated with this data format. Typically the ids are one or more mime types. For each id, any data associated with this DataFormat will be registered on the clipboard. For example, suppose I had the following:
 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.DataFormat fmt = new DataFormat("text/foo", "text/bar"); Clipboard clipboard = Clipboard.getSystemClipboard(); ClipboardContent content = new ClipboardContent(); content.put(fmt, "Hello"); clipboard.setContent(content);Note that the ids may be subject to platform restrictions in some cases. For instance, Swing requires a mime type so if an idis not of the "type/subtype" format it won't be possible to drag data of this type from/toJFXPanel.- Parameters:
- ids- The set of ids used to represent this DataFormat on the clipboard.
- Throws:
- IllegalArgumentException- if one of the given mime types is already assigned to another DataFormat.
 
 
- 
- 
Method Details- 
getIdentifiers
- 
toString
- 
hashCode
- 
equals
- 
lookupMimeTypeLooks for the DataFormat which has been previously created with the given mime type as one of its ids.- Parameters:
- mimeType- If null or the empty string, then null is returned.
- Returns:
- The matching DataFormat
 
 
-