java.lang.Object | ||
↳ | java.awt.datatransfer.Clipboard | |
↳ | sun.awt.datatransfer.SunClipboard |
Serves as a common, helper superclass for the Win32 and X11 system Clipboards.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
flavorMap |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Registers the specified
FlavorListener to receive
FlavorEvent s from this clipboard. | |||||||||||
Checks change of the
DataFlavor s and, if necessary,
posts notifications on FlavorEvent s to the
AppContexts' EDTs. | |||||||||||
Returns an array of
DataFlavor s in which the current
contents of this clipboard can be provided. | |||||||||||
Returns a transferable object representing the current contents
of the clipboard.
| |||||||||||
Returns an object representing the current contents of this clipboard
in the specified
DataFlavor . | |||||||||||
Returns an array of all the
FlavorListener s currently
registered on this Clipboard . | |||||||||||
Returns whether or not the current contents of this clipboard can be
provided in the specified
DataFlavor . | |||||||||||
This method gets called when a bound property is changed.
| |||||||||||
Removes the specified
FlavorListener so that it no longer
receives FlavorEvent s from this Clipboard . | |||||||||||
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.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
The clipboard must be opened.
| |||||||||||
Returns zero-length array (not null) if the number of available formats is zero.
| |||||||||||
Clears the clipboard state (contents, owner and contents context) and
notifies the current owner that ownership is lost.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Registers the specified FlavorListener
to receive
FlavorEvent
s from this clipboard.
If listener
is null
, no exception
is thrown and no action is performed.
listener | the listener to be added |
---|
Checks change of the DataFlavor
s and, if necessary,
posts notifications on FlavorEvent
s to the
AppContexts' EDTs.
The parameter formats
is null iff we have just
failed to get formats available on the clipboard.
formats | data formats that have just been retrieved from this clipboard |
---|
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.
DataFlavor
s in which the current
contents of this clipboard can be providedReturns 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) |
---|
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 |
---|
DataFlavor
Returns an array of all the FlavorListener
s currently
registered on this Clipboard
.
FlavorListener
s or an empty
array if no listeners are currently registeredReturns whether or not the current contents of this clipboard can be
provided in the specified DataFlavor
.
flavor | the requested DataFlavor for the contents |
---|
true
if the current contents of this clipboard
can be provided in the specified DataFlavor
;
false
otherwiseIllegalStateException | if the clipboard has not been opened |
---|
This method gets called when a bound property is changed.
evt | A PropertyChangeEvent object describing the event source and the property that has changed. |
---|
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.
listener | the listener to be removed |
---|
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.
contents | the transferable object representing the clipboard content |
---|---|
owner | the object which owns the clipboard content |
The clipboard must be opened.
IOException |
---|
Returns zero-length array (not null) if the number of available formats is zero.
IllegalStateException | if formats could not be retrieved |
---|
Clears the clipboard state (contents, owner and contents context) and
notifies the current owner that ownership is lost. Does nothing if the
argument is not null
and is not equal to the current
contents context.
disposedContext | the AppContext that is disposed or
null if the ownership is lost because another
application acquired ownership.
|
---|