Gets the singleton instance of the system Clipboard which interfaces
with clipboard facilities provided by the native platform. This
clipboard enables data transfer between Java programs and native
applications which use native clipboard facilities.
In addition to any and all formats specified in the flavormap.properties
file, or other file specified by the AWT.DnD.flavorMapFileURL
Toolkit property, text returned by the system Clipboard's
getTransferData()
method is available in the following flavors:
- DataFlavor.stringFlavor
- DataFlavor.plainTextFlavor (deprecated)
As with
java.awt.datatransfer.StringSelection
, if the
requested flavor is
DataFlavor.plainTextFlavor
, or an
equivalent flavor, a Reader is returned.
Note: The behavior of
the system Clipboard's
getTransferData()
method for
DataFlavor.plainTextFlavor
, and equivalent DataFlavors, is
inconsistent with the definition of
DataFlavor.plainTextFlavor
. Because of this, support for
DataFlavor.plainTextFlavor
, and equivalent flavors, is
deprecated.
Each actual implementation of this method should first check if there
is a security manager installed. If there is, the method should call
the security manager's checkSystemClipboardAccess
method
to ensure it's ok to to access the system clipboard. If the default
implementation of checkSystemClipboardAccess
is used (that
is, that method is not overriden), then this results in a call to the
security manager's checkPermission
method with an
AWTPermission("accessClipboard")
permission.
Returns:
the system Clipboard
Throws:
- HeadlessException - if GraphicsEnvironment.isHeadless()
returns true
Since:
JDK1.1
See Also:
GraphicsEnvironment.isHeadless()
,
Clipboard
,
StringSelection
,
DataFlavor.stringFlavor
,
DataFlavor.plainTextFlavor
,
Reader
,
AWTPermission
,