java.awt.datatransfer
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(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(Object requestor)
Returns the contents of the clipboard.
|
Object |
getData(DataFlavor flavor) |
FlavorListener[] |
getFlavorListeners() |
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 Transferable getContents(Object requestor)
requestor
- The object requesting the contents. This
implementation ignores this parameter.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 ownerIllegalStateException
- If the clipboard is currently unavailablepublic DataFlavor[] getAvailableDataFlavors()
public boolean isDataFlavorAvailable(DataFlavor flavor)
public Object getData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
public void addFlavorListener(FlavorListener listener)
public void removeFlavorListener(FlavorListener listener)
public FlavorListener[] getFlavorListeners()