A class that implements a mechanism to transfer data using cut/copy/paste operations.
FlavorListeners may be registered on an instance of the Clipboard class to be notified about changes to the set of DataFlavors available on this clipboard (see addFlavorListener(java.awt.datatransfer.FlavorListener)).
A class that implements a mechanism to transfer data using cut/copy/paste operations. FlavorListeners may be registered on an instance of the Clipboard class to be notified about changes to the set of DataFlavors available on this clipboard (see addFlavorListener(java.awt.datatransfer.FlavorListener)).
(->clipboard name)
Constructor.
Creates a clipboard object.
name - java.lang.String
Constructor. Creates a clipboard object. name - `java.lang.String`
(add-flavor-listener this listener)
Registers the specified FlavorListener to receive FlavorEvents from this clipboard. If listener is null, no exception is thrown and no action is performed.
listener - the listener to be added - java.awt.datatransfer.FlavorListener
Registers the specified FlavorListener to receive FlavorEvents from this clipboard. If listener is null, no exception is thrown and no action is performed. listener - the listener to be added - `java.awt.datatransfer.FlavorListener`
(data-flavor-available? this flavor)
Returns whether or not the current contents of this clipboard can be provided in the specified DataFlavor.
flavor - the requested DataFlavor for the contents - java.awt.datatransfer.DataFlavor
returns: true if the current contents of this clipboard
can be provided in the specified DataFlavor;
false otherwise - boolean
throws: java.lang.NullPointerException - if flavor is null
Returns whether or not the current contents of this clipboard can be provided in the specified DataFlavor. flavor - the requested DataFlavor for the contents - `java.awt.datatransfer.DataFlavor` returns: true if the current contents of this clipboard can be provided in the specified DataFlavor; false otherwise - `boolean` throws: java.lang.NullPointerException - if flavor is null
(get-available-data-flavors this)
Returns an array of DataFlavors in which the current contents of this clipboard can be provided. If there are no DataFlavors available, this method returns a zero-length array.
returns: an array of DataFlavors in which the current
contents of this clipboard can be provided - java.awt.datatransfer.DataFlavor[]
throws: java.lang.IllegalStateException - if this clipboard is currently unavailable
Returns an array of DataFlavors in which the current contents of this clipboard can be provided. If there are no DataFlavors available, this method returns a zero-length array. returns: an array of DataFlavors in which the current contents of this clipboard can be provided - `java.awt.datatransfer.DataFlavor[]` throws: java.lang.IllegalStateException - if this clipboard is currently unavailable
(get-contents this requestor)
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.
requestor - the object requesting the clip data (not used) - java.lang.Object
returns: the current transferable object on the clipboard - java.awt.datatransfer.Transferable
throws: java.lang.IllegalStateException - if the clipboard is currently unavailable
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. requestor - the object requesting the clip data (not used) - `java.lang.Object` returns: the current transferable object on the clipboard - `java.awt.datatransfer.Transferable` throws: java.lang.IllegalStateException - if the clipboard is currently unavailable
(get-data this flavor)
Returns an object representing the current contents of this clipboard in the specified DataFlavor. The class of the object returned is defined by the representation class of flavor.
flavor - the requested DataFlavor for the contents - java.awt.datatransfer.DataFlavor
returns: an object representing the current contents of this clipboard
in the specified DataFlavor - java.lang.Object
throws: java.lang.NullPointerException - if flavor is null
Returns an object representing the current contents of this clipboard in the specified DataFlavor. The class of the object returned is defined by the representation class of flavor. flavor - the requested DataFlavor for the contents - `java.awt.datatransfer.DataFlavor` returns: an object representing the current contents of this clipboard in the specified DataFlavor - `java.lang.Object` throws: java.lang.NullPointerException - if flavor is null
(get-flavor-listeners this)
Returns an array of all the FlavorListeners currently registered on this Clipboard.
returns: all of this clipboard's FlavorListeners or an empty
array if no listeners are currently registered - java.awt.datatransfer.FlavorListener[]
Returns an array of all the FlavorListeners currently registered on this Clipboard. returns: all of this clipboard's FlavorListeners or an empty array if no listeners are currently registered - `java.awt.datatransfer.FlavorListener[]`
(get-name this)
Returns the name of this clipboard object.
returns: java.lang.String
Returns the name of this clipboard object. returns: `java.lang.String`
(remove-flavor-listener this listener)
Removes the specified FlavorListener so that it no longer receives FlavorEvents 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.
listener - the listener to be removed - java.awt.datatransfer.FlavorListener
Removes the specified FlavorListener so that it no longer receives FlavorEvents 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. listener - the listener to be removed - `java.awt.datatransfer.FlavorListener`
(set-contents this contents 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. The same applies to FlavorListeners 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.
contents - the transferable object representing the clipboard content - java.awt.datatransfer.Transferable
owner - the object which owns the clipboard content - java.awt.datatransfer.ClipboardOwner
throws: java.lang.IllegalStateException - if the clipboard is currently unavailable
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 FlavorListeners 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. contents - the transferable object representing the clipboard content - `java.awt.datatransfer.Transferable` owner - the object which owns the clipboard content - `java.awt.datatransfer.ClipboardOwner` throws: java.lang.IllegalStateException - if the clipboard is currently unavailable
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close