| |
|
| java.lang.Object java.awt.datatransfer.Clipboard
Constructor Summary | |
public | Clipboard(String name) Creates a clipboard object. |
Method Summary | |
public synchronized void | addFlavorListener(FlavorListener listener) Registers the specified FlavorListener to receive
FlavorEvent s from this clipboard. | public DataFlavor[] | getAvailableDataFlavors() Returns an array of DataFlavor s in which the current
contents of this clipboard can be provided. | public synchronized Transferable | getContents(Object requestor) Returns a transferable object representing the current contents
of the clipboard. | public Object | getData(DataFlavor flavor) Returns an object representing the current contents of this clipboard
in the specified DataFlavor . | public synchronized FlavorListener[] | getFlavorListeners() Returns an array of all the FlavorListener s currently
registered on this Clipboard . | public String | getName() Returns the name of this clipboard object. | public boolean | isDataFlavorAvailable(DataFlavor flavor) Returns whether or not the current contents of this clipboard can be
provided in the specified DataFlavor . | public synchronized void | removeFlavorListener(FlavorListener listener) Removes the specified FlavorListener so that it no longer
receives FlavorEvent s from this Clipboard . | public synchronized void | setContents(Transferable contents, ClipboardOwner owner) Sets the current contents of the clipboard to the specified
transferable object and registers the specified clipboard owner
as the owner of the new contents.
If there is an existing owner different from the argument
owner , that owner is notified that it no longer
holds ownership of the clipboard contents via an invocation
of ClipboardOwner.lostOwnership() on that owner.
An implementation of setContents() is free not
to invoke lostOwnership() directly from this method.
For example, lostOwnership() may be invoked later on
a different thread. |
getAvailableDataFlavors | public DataFlavor[] getAvailableDataFlavors()(Code) | | Returns an array of DataFlavor s in which the current
contents of this clipboard can be provided. If there are no
DataFlavor s available, this method returns a zero-length
array.
an array of DataFlavor s in which the currentcontents of this clipboard can be provided throws: IllegalStateException - if this clipboard is currently unavailable since: 1.5 |
getContents | public synchronized Transferable getContents(Object requestor)(Code) | | Returns a transferable object representing the current contents
of the clipboard. If the clipboard currently has no contents,
it returns null . The parameter Object requestor is
not currently used. The method throws
IllegalStateException if the clipboard is currently
unavailable. For example, on some platforms, the system clipboard is
unavailable while it is accessed by another application.
Parameters: requestor - the object requesting the clip data (not used) the current transferable object on the clipboard throws: IllegalStateException - if the clipboard is currently unavailable See Also: java.awt.Toolkit.getSystemClipboard |
isDataFlavorAvailable | public boolean isDataFlavorAvailable(DataFlavor flavor)(Code) | | Returns whether or not the current contents of this clipboard can be
provided in the specified DataFlavor .
Parameters: flavor - the requested DataFlavor for the contents true if the current contents of this clipboardcan be provided in the specified DataFlavor ;false otherwise throws: NullPointerException - if flavor is null throws: IllegalStateException - if this clipboard is currently unavailable since: 1.5 |
removeFlavorListener | public synchronized void removeFlavorListener(FlavorListener listener)(Code) | | Removes the specified FlavorListener so that it no longer
receives FlavorEvent s from this Clipboard .
This method performs no function, nor does it throw an exception, if
the listener specified by the argument was not previously added to this
Clipboard .
If listener is null , no exception
is thrown and no action is performed.
Parameters: listener - the listener to be removed See Also: Clipboard.addFlavorListener See Also: Clipboard.getFlavorListeners See Also: FlavorListener See Also: FlavorEvent since: 1.5 |
setContents | public synchronized void setContents(Transferable contents, ClipboardOwner owner)(Code) | | Sets the current contents of the clipboard to the specified
transferable object and registers the specified clipboard owner
as the owner of the new contents.
If there is an existing owner different from the argument
owner , that owner is notified that it no longer
holds ownership of the clipboard contents via an invocation
of ClipboardOwner.lostOwnership() on that owner.
An implementation of setContents() is free not
to invoke lostOwnership() directly from this method.
For example, lostOwnership() may be invoked later on
a different thread. The same applies to FlavorListener s
registered on this clipboard.
The method throws IllegalStateException if the clipboard
is currently unavailable. For example, on some platforms, the system
clipboard is unavailable while it is accessed by another application.
Parameters: contents - the transferable object representing theclipboard content Parameters: owner - the object which owns the clipboard content throws: IllegalStateException - if the clipboard is currently unavailable See Also: java.awt.Toolkit.getSystemClipboard |
|
|
|