Top Description Constructors Methods
javafx.scene.input

public Class ClipboardContent

extends HashMap<DataFormat, Object>
Class Inheritance
Imports
java.io.File, java.util.ArrayList, .HashMap, .List, javafx.scene.image.Image

Data container for Clipboard data. It can hold multiple data in several data formats.
Since
JavaFX 2.0

Constructor Summary

AccessConstructor and Description
public
ClipboardContent()

Creates a ClipboardContent.

Method Summary

Modifier and TypeMethod and Description
public final List<File>

Returns:

The List of Files in the ClipboardContent associated with DataFormat.FILES, or null if there is not one.
getFiles
()

Gets the List of Files from the ClipboardContent which had previously been put.

public final String

Returns:

The String in the ClipboardContent associated with DataFormat.HTML, or null if there is not one.
getHtml
()

Gets the HTML String from the ClipboardContent which had previously been put.

public final Image

Returns:

The Image in the ClipboardContent associated with DataFormat.IMAGE, or null if there is not one.
getImage
()

Gets the Image from the ClipboardContent which had previously been put.

public final String

Returns:

The String in the ClipboardContent associated with DataFormat.RTF, or null if there is not one.
getRtf
()

Gets the RTF String from the ClipboardContent which had previously been put.

public final String

Returns:

The String in the ClipboardContent associated with DataFormat.PLAIN_TEXT, or null if there is not one.
getString
()

Gets the plain text String from the ClipboardContent which had previously been put.

public final String

Returns:

The String in the ClipboardContent associated with DataFormat.URL, or null if there is not one.
getUrl
()

Gets the URL String from the ClipboardContent which had previously been put.

public final boolean

Returns:

true if containsKey(DataFormat.FILES) returns true, false otherwise
hasFiles
()

Gets whether a List of Files (DataFormat.FILES) has been put to this ClipboardContent.

public final boolean

Returns:

true if containsKey(DataFormat.HTML) returns true, false otherwise
hasHtml
()

Gets whether an HTML String (DataFormat.HTML) has been put to this ClipboardContent.

public final boolean

Returns:

true if containsKey(DataFormat.IMAGE) returns true, false otherwise
hasImage
()

Gets whether an Image (DataFormat.IMAGE) has been put to this ClipboardContent.

public final boolean

Returns:

true if containsKey(DataFormat.RTF) returns true, false otherwise
hasRtf
()

Gets whether a RTF String (DataFormat.RTF) has been put to this ClipboardContent.

public final boolean

Returns:

true if containsKey(DataFormat.PLAIN_TEXT) returns true, false otherwise
hasString
()

Gets whether a plain text String (DataFormat.PLAIN_TEXT) has been put to this ClipboardContent.

public final boolean

Returns:

true if containsKey(DataFormat.URL) returns true, false otherwise
hasUrl
()

Gets whether a URL String (DataFormat.URL) has been put to this ClipboardContent.

public final boolean

Returns:

always true (the files are always successfully put)
putFiles
(List<File>
The files to place. This may be null.
files
)

Puts a List of Files into the ClipboardContent.

public final boolean

Returns:

always true (the files are always successfully put)
putFilesByPath
(List<String>
The files to place. This may be null.
filePaths
)

Puts a List of Files into the ClipboardContent, based on the file path.

public final boolean

Returns:

always true (the HTML is always successfully put)
putHtml
(String
The string to place. This may be null.
html
)

Puts an HTML String into the ClipboardContent.

public final boolean

Returns:

always true (the image is always successfully put)
putImage
(Image
The image to place. This may be null.
i
)

Puts an Image into the ClipboardContent.

public final boolean

Returns:

always true (the RTF is always successfully put)
putRtf
(String
The string to place. This may be null.
rtf
)

Puts a RTF String into the ClipboardContent.

public final boolean

Returns:

always true (the string is always successfully put)
putString
(String
The string to place. This may be null.
s
)

Puts a plain text String into the ClipboardContent.

public final boolean

Returns:

always true (the URL is always successfully put)
putUrl
(String
The string to place. This may be null.
url
)

Puts a URL String into the ClipboardContent.

Inherited from java.util.HashMap:
clearclonecomputecomputeIfAbsentcomputeIfPresentcontainsKeycontainsValueentrySetforEachgetgetOrDefaultisEmptykeySetmergenewHashMapputputAllputIfAbsentremoveremovereplacereplacereplaceAllsizevalues

Constructor Detail

ClipboardContentback to summary
public ClipboardContent()

Creates a ClipboardContent.

Method Detail

getFilesback to summary
public final List<File> getFiles()

Gets the List of Files from the ClipboardContent which had previously been put. This is equivalent to invoking get(DataFormat.FILES). If no such entry exists, null is returned.

Returns:List<File>

The List of Files in the ClipboardContent associated with DataFormat.FILES, or null if there is not one.

getHtmlback to summary
public final String getHtml()

Gets the HTML String from the ClipboardContent which had previously been put. This is equivalent to invoking get(DataFormat.HTML). If no such entry exists, null is returned.

Returns:String

The String in the ClipboardContent associated with DataFormat.HTML, or null if there is not one.

getImageback to summary
public final Image getImage()

Gets the Image from the ClipboardContent which had previously been put. This is equivalent to invoking get(DataFormat.IMAGE). If no such entry exists, null is returned.

Returns:Image

The Image in the ClipboardContent associated with DataFormat.IMAGE, or null if there is not one.

getRtfback to summary
public final String getRtf()

Gets the RTF String from the ClipboardContent which had previously been put. This is equivalent to invoking get(DataFormat.RTF). If no such entry exists, null is returned.

Returns:String

The String in the ClipboardContent associated with DataFormat.RTF, or null if there is not one.

getStringback to summary
public final String getString()

Gets the plain text String from the ClipboardContent which had previously been put. This is equivalent to invoking get(DataFormat.PLAIN_TEXT). If no such entry exists, null is returned.

Returns:String

The String in the ClipboardContent associated with DataFormat.PLAIN_TEXT, or null if there is not one.

getUrlback to summary
public final String getUrl()

Gets the URL String from the ClipboardContent which had previously been put. This is equivalent to invoking get(DataFormat.URL). If no such entry exists, null is returned.

Returns:String

The String in the ClipboardContent associated with DataFormat.URL, or null if there is not one.

hasFilesback to summary
public final boolean hasFiles()

Gets whether a List of Files (DataFormat.FILES) has been put to this ClipboardContent.

Returns:boolean

true if containsKey(DataFormat.FILES) returns true, false otherwise

hasHtmlback to summary
public final boolean hasHtml()

Gets whether an HTML String (DataFormat.HTML) has been put to this ClipboardContent.

Returns:boolean

true if containsKey(DataFormat.HTML) returns true, false otherwise

hasImageback to summary
public final boolean hasImage()

Gets whether an Image (DataFormat.IMAGE) has been put to this ClipboardContent.

Returns:boolean

true if containsKey(DataFormat.IMAGE) returns true, false otherwise

hasRtfback to summary
public final boolean hasRtf()

Gets whether a RTF String (DataFormat.RTF) has been put to this ClipboardContent.

Returns:boolean

true if containsKey(DataFormat.RTF) returns true, false otherwise

hasStringback to summary
public final boolean hasString()

Gets whether a plain text String (DataFormat.PLAIN_TEXT) has been put to this ClipboardContent.

Returns:boolean

true if containsKey(DataFormat.PLAIN_TEXT) returns true, false otherwise

hasUrlback to summary
public final boolean hasUrl()

Gets whether a URL String (DataFormat.URL) has been put to this ClipboardContent.

Returns:boolean

true if containsKey(DataFormat.URL) returns true, false otherwise

putFilesback to summary
public final boolean putFiles(List<File> files)

Puts a List of Files into the ClipboardContent. This is equivalent to invoking put(DataFormat.FILES, files). Setting this value to null effectively clears it from the ClipboardContent.

Parameters
files:List<File>

The files to place. This may be null.

Returns:boolean

always true (the files are always successfully put)

putFilesByPathback to summary
public final boolean putFilesByPath(List<String> filePaths)

Puts a List of Files into the ClipboardContent, based on the file path. This is simply a convenience method which constructs a List of Files and invokes the putFiles method.

Parameters
filePaths:List<String>

The files to place. This may be null.

Returns:boolean

always true (the files are always successfully put)

putHtmlback to summary
public final boolean putHtml(String html)

Puts an HTML String into the ClipboardContent. This is equivalent to invoking put(DataFormat.HTML, html). Setting this value to null effectively clears it from the ClipboardContent.

Parameters
html:String

The string to place. This may be null.

Returns:boolean

always true (the HTML is always successfully put)

putImageback to summary
public final boolean putImage(Image i)

Puts an Image into the ClipboardContent. This is equivalent to invoking put(DataFormat.IMAGE, i). Setting this value to null effectively clears it from the ClipboardContent. When an image is placed on the clipboard in this manner, an operating system dependent image is loaded onto the clipboard (such as TIFF on Mac or DIB on Windows).

Parameters
i:Image

The image to place. This may be null.

Returns:boolean

always true (the image is always successfully put)

putRtfback to summary
public final boolean putRtf(String rtf)

Puts a RTF String into the ClipboardContent. This is equivalent to invoking put(DataFormat.RTF, rtf). Setting this value to null effectively clears it from the ClipboardContent.

Parameters
rtf:String

The string to place. This may be null.

Returns:boolean

always true (the RTF is always successfully put)

putStringback to summary
public final boolean putString(String s)

Puts a plain text String into the ClipboardContent. This is equivalent to invoking put(DataFormat.PLAIN_TEXT, s). Setting this value to null effectively clears it from the ClipboardContent.

Parameters
s:String

The string to place. This may be null.

Returns:boolean

always true (the string is always successfully put)

putUrlback to summary
public final boolean putUrl(String url)

Puts a URL String into the ClipboardContent. This is equivalent to invoking put(DataFormat.URL, url). Setting this value to null effectively clears it from the ClipboardContent.

Parameters
url:String

The string to place. This may be null.

Returns:boolean

always true (the URL is always successfully put)