Package jexer.bits
Class Clipboard
- java.lang.Object
-
- jexer.bits.Clipboard
-
public class Clipboard extends java.lang.ObjectClipboard provides convenience methods to copy text and images to and from a shared clipboard. When the system clipboard is available it is used.
-
-
Constructor Summary
Constructors Constructor Description Clipboard()Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear whatever is on the local clipboard.voidcopyImage(java.awt.image.BufferedImage image)Copy an image to the clipboard.voidcopyText(java.lang.String text)Copy a text string to the clipboard.booleanisEmpty()Returns true if the clipboard is empty.booleanisImage()Returns true if the clipboard has an image.booleanisText()Returns true if the clipboard has a text string.java.awt.image.BufferedImagepasteImage()Obtain an image from the clipboard.java.lang.StringpasteText()Obtain a text string from the clipboard.
-
-
-
Method Detail
-
copyImage
public void copyImage(java.awt.image.BufferedImage image)
Copy an image to the clipboard.- Parameters:
image- image to copy
-
copyText
public void copyText(java.lang.String text)
Copy a text string to the clipboard.- Parameters:
text- string to copy
-
pasteImage
public java.awt.image.BufferedImage pasteImage()
Obtain an image from the clipboard.- Returns:
- image from the clipboard, or null if no image is available
-
pasteText
public java.lang.String pasteText()
Obtain a text string from the clipboard.- Returns:
- text string from the clipboard, or null if no text is available
-
isImage
public boolean isImage()
Returns true if the clipboard has an image.- Returns:
- true if an image is available from the clipboard
-
isText
public boolean isText()
Returns true if the clipboard has a text string.- Returns:
- true if a text string is available from the clipboard
-
isEmpty
public boolean isEmpty()
Returns true if the clipboard is empty.- Returns:
- true if the clipboard is empty
-
clear
public void clear()
Clear whatever is on the local clipboard. Note that this will not clear the system clipboard.
-
-