public class Clipboard extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
Clipboard.ClipboardListener |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TYPE_IMAGE |
static java.lang.String |
TYPE_ROILINKLIST |
static java.lang.String |
TYPE_ROILIST |
static java.lang.String |
TYPE_SEQUENCE |
static java.lang.String |
TYPE_SEQUENCEROILIST |
Constructor and Description |
---|
Clipboard() |
Modifier and Type | Method and Description |
---|---|
static void |
addListener(Clipboard.ClipboardListener listener) |
static void |
clear()
Clears the clipboard.
|
static void |
clearSystem()
Clears content of system clipboard.
|
static void |
fireChangedEvent() |
static java.lang.Object |
get()
Returns object actually stored in the clipboard.
|
static java.lang.Object |
get(java.lang.String type)
Returns object actually stored in the clipboard if it has the specified type.
|
static java.awt.datatransfer.DataFlavor[] |
getAllTypeSystem()
Returns all type of content available in the system clipboard.
|
static java.lang.Object |
getSystem(java.awt.datatransfer.DataFlavor type)
Gets an object from the system clipboard.
|
static java.lang.String |
getType()
Returns the type of stored object.
|
static boolean |
hasTypeSystem(java.awt.datatransfer.DataFlavor type)
Returns if current content of the system clipboard contains specified type of data.
|
static boolean |
isType(java.lang.String t)
Returns true if the specified type match the current type stored in Clipboard
|
static void |
put(java.lang.String type,
java.lang.Object object)
Puts an object in the clipboard.
|
static void |
putSystem(java.awt.datatransfer.Transferable contents,
java.awt.datatransfer.ClipboardOwner owner)
Puts an object in the system clipboard.
|
static void |
removeListener(Clipboard.ClipboardListener listener) |
public static final java.lang.String TYPE_SEQUENCEROILIST
public static final java.lang.String TYPE_ROILIST
public static final java.lang.String TYPE_ROILINKLIST
public static final java.lang.String TYPE_SEQUENCE
public static final java.lang.String TYPE_IMAGE
public Clipboard()
public static void clear()
public static boolean isType(java.lang.String t)
public static java.lang.String getType()
public static java.lang.Object get()
public static java.lang.Object get(java.lang.String type)
null
otherwise.public static void put(java.lang.String type, java.lang.Object object)
type
- object type (should not be null).object
- object to save in clipboard.public static boolean hasTypeSystem(java.awt.datatransfer.DataFlavor type)
type
- the requested DataFlavor
for the contentsjava.lang.NullPointerException
- if flavor
is null
java.lang.IllegalStateException
- if this clipboard is currently unavailableClipboard.isDataFlavorAvailable(DataFlavor)
public static java.awt.datatransfer.DataFlavor[] getAllTypeSystem()
java.lang.IllegalStateException
- if this clipboard is currently unavailableClipboard.getAvailableDataFlavors()
public static java.lang.Object getSystem(java.awt.datatransfer.DataFlavor type) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException
type
- the requested DataFlavor
for the contentsjava.io.IOException
java.lang.NullPointerException
- if flavor
is null
java.lang.IllegalStateException
- if this clipboard is currently unavailablejava.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
- if the data in the requested DataFlavor
can not be retrievedClipboard.getData(DataFlavor)
public static void clearSystem()
public static void putSystem(java.awt.datatransfer.Transferable contents, java.awt.datatransfer.ClipboardOwner owner)
contents
- the transferable object representing the
clipboard contentowner
- the object which owns the clipboard contentClipboard.setContents(Transferable, ClipboardOwner)
public static void addListener(Clipboard.ClipboardListener listener)
public static void removeListener(Clipboard.ClipboardListener listener)
public static void fireChangedEvent()