FlavorListener
s may be registered on an instance of the Clipboard
class to be notified about changes to the set of DataFlavor
s
available on this clipboard (see addFlavorListener
).
java.desktop/java.awt.Toolkit#getSystemClipboard
, java.desktop/java.awt.Toolkit#getSystemSelection
Modifier and Type | Field and Description |
---|---|
protected Transferable | contents
Contents of the clipboard. |
private Set | currentDataFlavors
A set of |
private Set | flavorListeners
An aggregate of flavor listeners registered on this local clipboard. |
pack-priv String | |
protected ClipboardOwner | owner
The owner of the clipboard. |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public synchronized void | addFlavorListener(FlavorListener
the listener to be added listener)Registers the specified |
private void | fireFlavorsChanged()
Checks change of the |
public DataFlavor[] | Returns: an array ofDataFlavor s in which the current contents of
this clipboard can be providedReturns an array of |
private Set | Returns: a set ofDataFlavor s currently available on this
clipboardReturns a set of |
public synchronized Transferable | Returns: the current transferable object on the clipboardthe object requesting the clip data (not used) requestor)Returns a transferable object representing the current contents of the clipboard. |
public Object | Returns: an object representing the current contents of this clipboard in the specifiedDataFlavor the requested flavor)DataFlavor for the contentsReturns an object representing the current contents of this clipboard in
the specified |
public synchronized FlavorListener[] | Returns: all of this clipboard'sFlavorListener s or an empty array
if no listeners are currently registeredReturns an array of all the |
public String | |
public boolean | Returns: true if the current contents of this clipboard can be
provided in the specified DataFlavor ; false
otherwisethe requested flavor)DataFlavor for the contentsReturns whether or not the current contents of this clipboard can be
provided in the specified |
public synchronized void | removeFlavorListener(FlavorListener
the listener to be removed listener)Removes the specified |
public synchronized void | setContents(Transferable
the transferable object representing the clipboard
content contents, ClipboardOwner the object which owns the clipboard content 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. |
contents | back to summary |
---|---|
protected Transferable contents Contents of the clipboard. |
currentDataFlavors | back to summary |
---|---|
private Set<DataFlavor> currentDataFlavors A set of
|
flavorListeners | back to summary |
---|---|
private Set<FlavorListener> flavorListeners An aggregate of flavor listeners registered on this local clipboard.
|
name | back to summary |
---|---|
pack-priv String name |
owner | back to summary |
---|---|
protected ClipboardOwner owner The owner of the clipboard. |
Clipboard | back to summary |
---|---|
public Clipboard(String name) Creates a clipboard object.
|
addFlavorListener | back to summary |
---|---|
public synchronized void addFlavorListener(FlavorListener listener) Registers the specified
|
fireFlavorsChanged | back to summary |
---|---|
private void fireFlavorsChanged() Checks change of the
|
getAvailableDataFlavors | back to summary |
---|---|
public DataFlavor[] getAvailableDataFlavors() Returns an array of
|
getAvailableDataFlavorSet | back to summary |
---|---|
private Set Returns a set of
|
getContents | back to summary |
---|---|
public synchronized Transferable getContents(Object requestor) Returns a transferable object representing the current contents of the
clipboard. If the clipboard currently has no contents, it returns
|
getData | back to summary |
---|---|
public Object getData(DataFlavor flavor) throws UnsupportedFlavorException, IOException Returns an object representing the current contents of this clipboard in
the specified
|
getFlavorListeners | back to summary |
---|---|
public synchronized FlavorListener[] getFlavorListeners() Returns an array of all the
|
getName | back to summary |
---|---|
public String getName() Returns the name of this clipboard object.
|
isDataFlavorAvailable | back to summary |
---|---|
public boolean isDataFlavorAvailable(DataFlavor flavor) Returns whether or not the current contents of this clipboard can be
provided in the specified
|
removeFlavorListener | back to summary |
---|---|
public synchronized void removeFlavorListener(FlavorListener listener) Removes the specified
|
setContents | back to summary |
---|---|
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
The method throws
|