Spec-Zone .ru
спецификации, руководства, описания, API
|
public class ClipboardContent extends java.util.HashMap<DataFormat,java.lang.Object>
Clipboard
data. It can hold multiple data in
several data formats.Constructor and Description |
---|
ClipboardContent() |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.io.File> |
getFiles()
Gets the List of Files from the clipboard which had previously
been registered.
|
java.lang.String |
getHtml()
Gets the HTML text String from the clipboard which had previously
been registered.
|
Image |
getImage()
Gets the Image from the clipboard which had previously
been registered.
|
java.lang.String |
getRtf()
Gets the RTF text String from the clipboard which had previously
been registered.
|
java.lang.String |
getString()
Gets the plain text String from the clipboard which had previously
been registered.
|
java.lang.String |
getUrl()
Gets the URL String from the clipboard which had previously
been registered.
|
boolean |
hasFiles()
Gets whether an List of Files (DataFormat.FILES) has been registered
on this Clipboard.
|
boolean |
hasHtml()
Gets whether an HTML text String (DataFormat.HTML) has been registered
on this Clipboard.
|
boolean |
hasImage()
Gets whether an Image (DataFormat.IMAGE) has been registered
on this Clipboard.
|
boolean |
hasRtf()
Gets whether an RTF String (DataFormat.RTF) has been registered
on this Clipboard.
|
boolean |
hasString()
Gets whether a plain text String (DataFormat.PLAIN_TEXT) has been registered
on this Clipboard.
|
boolean |
hasUrl()
Gets whether a url String (DataFormat.URL) has been registered
on this Clipboard.
|
boolean |
putFiles(java.util.List<java.io.File> files)
Puts an List of Files onto the Clipboard.
|
boolean |
putFilesByPath(java.util.List<java.lang.String> filePaths)
Puts an List of Files onto the Clipboard, based on the file path.
|
boolean |
putHtml(java.lang.String s)
Puts an HTML text String onto the Clipboard.
|
boolean |
putImage(Image i)
Puts an Image onto the Clipboard.
|
boolean |
putRtf(java.lang.String rtf)
Puts an RTF text String onto the Clipboard.
|
boolean |
putString(java.lang.String s)
Puts a plain text String onto the Clipboard.
|
boolean |
putUrl(java.lang.String url)
Puts a URL String onto the Clipboard.
|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
public final boolean hasString()
hasContent(DataFormat.PLAIN_TEXT)
returns true, false otherwisepublic final boolean putString(java.lang.String s)
setContent(DataFormat.PLAIN_TEXT, s)
. Setting this value
to null effectively clears it from the clipboard.s
- The string to place. This may be null.java.lang.NullPointerException
- if null reference is passedpublic final java.lang.String getString()
getContent(DataFormat.PLAIN_TEXT)
. If no such entry exists,
null is returned.public final boolean hasUrl()
public final boolean putUrl(java.lang.String url)
setContent(DataFormat.URL, s)
. Setting this value
to null effectively clears it from the clipboard.url
- The string to place. This may be null.java.lang.NullPointerException
- if null reference is passedpublic final java.lang.String getUrl()
getContent(DataFormat.URL)
. If no such entry exists,
null is returned.public final boolean hasHtml()
hasContent(DataFormat.HTML)
returns true, false otherwisepublic final boolean putHtml(java.lang.String s)
setContent(DataFormat.HTML, s)
. Setting this value
to null effectively clears it from the clipboard.s
- The string to place. This may be null.java.lang.NullPointerException
- if null reference is passedpublic final java.lang.String getHtml()
getContent(DataFormat.HTML)
. If no such entry exists,
null is returned.public final boolean hasRtf()
public final boolean putRtf(java.lang.String rtf)
setContent(DataFormat.RTF, s)
. Setting this value
to null effectively clears it from the clipboard.rtf
- The string to place. This may be null.java.lang.NullPointerException
- if null reference is passedpublic final java.lang.String getRtf()
getContent(DataFormat.RTF)
. If no such entry exists,
null is returned.public final boolean hasImage()
public final boolean putImage(Image i)
setContent(DataFormat.IMAGE, image)
. Setting this value
to null effectively clears it from the clipboard. 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).i
- The image to place. This may be null.java.lang.NullPointerException
- if null reference is passedpublic final Image getImage()
getContent(DataFormat.IMAGE)
. If no such entry exists,
null is returned.public final boolean hasFiles()
public final boolean putFiles(java.util.List<java.io.File> files)
setContent(DataFormat.FILES, files)
. Setting this value
to null effectively clears it from the clipboard.files
- The files to place. This may be null.java.lang.NullPointerException
- if null reference is passedpublic final boolean putFilesByPath(java.util.List<java.lang.String> filePaths)
putFiles(java.util.List)
method.filePaths
- The files to place. This may be null.java.lang.NullPointerException
- if null reference is passedpublic final java.util.List<java.io.File> getFiles()
getContent(DataFormat.FILES)
. If no such entry exists,
null is returned.Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. Use is subject to