public class Clipboard extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected Transferable |
contents
The data currently on this clipboard.
|
protected ClipboardOwner |
owner
The owner of this clipboard.
|
| Constructor and Description |
|---|
Clipboard(java.lang.String name)
Initializes a new instance of
Clipboard with the
specified name. |
| Modifier and Type | Method and Description |
|---|---|
void |
addFlavorListener(FlavorListener listener) |
DataFlavor[] |
getAvailableDataFlavors() |
Transferable |
getContents(java.lang.Object requestor)
Returns the contents of the clipboard.
|
java.lang.Object |
getData(DataFlavor flavor) |
FlavorListener[] |
getFlavorListeners() |
java.lang.String |
getName()
Returns the name of the clipboard.
|
boolean |
isDataFlavorAvailable(DataFlavor flavor) |
void |
removeFlavorListener(FlavorListener listener) |
void |
setContents(Transferable contents,
ClipboardOwner owner)
Sets the content and owner of this clipboard.
|
protected Transferable contents
protected ClipboardOwner owner
public Clipboard(java.lang.String name)
Clipboard with the
specified name.name - The clipboard name.public java.lang.String getName()
public Transferable getContents(java.lang.Object requestor)
requestor - The object requesting the contents. This
implementation ignores this parameter.java.lang.IllegalStateException - If the clipboard is currently unavailablepublic void setContents(Transferable contents, ClipboardOwner owner)
lostOwnership()
is called on the current owner with the old contents of the given
clipboard.contents - The new clipboard contents.owner - The new clipboard ownerjava.lang.IllegalStateException - If the clipboard is currently unavailablepublic DataFlavor[] getAvailableDataFlavors()
public boolean isDataFlavorAvailable(DataFlavor flavor)
public java.lang.Object getData(DataFlavor flavor) throws UnsupportedFlavorException, java.io.IOException
UnsupportedFlavorExceptionjava.io.IOExceptionpublic void addFlavorListener(FlavorListener listener)
public void removeFlavorListener(FlavorListener listener)
public FlavorListener[] getFlavorListeners()