wt.clients.util
Class WTClipboard

java.lang.Object
  extended byjava.awt.datatransfer.Clipboard
      extended bywt.clients.util.WTClipboard

public class WTClipboard
extends Clipboard

This class holds the clipboard that is currently being used by Windchill clients to hold Windchill objects. If access to the system clipboard is granted by the user, a text representation of the Windchill object will placed in the system clipboard. Untrusted Applets are not allowed access to the system clipboard unless the user grants permission. This class also holds the dataflavor that is unique to Windchill.

Supported API: true

Extendable: false


Field Summary
private static String OBJECT_ARRAY_PRESENTABLE_NAME
           
private static Clipboard systemClipboard__
           
private  boolean systemClipboardOwner__
           
private static boolean verbose
           
private static String WINDCHILL_CLIPBOARD_NAME
           
private static Clipboard windchillClipboard__
           
static DataFlavor WT_OBJECT_ARRAY_FLAVOR
          The DataFlavor representing an array of WTObject class objects, where:
 
Fields inherited from class java.awt.datatransfer.Clipboard
contents, owner
 
Constructor Summary
private WTClipboard(String name)
          The constructor is private since this class should never be instantiated outside of this class.
 
Method Summary
static Clipboard getClipboard()
          Get the Windchill clipboard.
 Transferable getContents(Object requestor)
          Get the data from the clipboard.
 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.
 
Methods inherited from class java.awt.datatransfer.Clipboard
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WINDCHILL_CLIPBOARD_NAME

private static final String WINDCHILL_CLIPBOARD_NAME
See Also:
Constant Field Values

systemClipboard__

private static Clipboard systemClipboard__

windchillClipboard__

private static Clipboard windchillClipboard__

systemClipboardOwner__

private boolean systemClipboardOwner__

verbose

private static boolean verbose

OBJECT_ARRAY_PRESENTABLE_NAME

private static String OBJECT_ARRAY_PRESENTABLE_NAME

WT_OBJECT_ARRAY_FLAVOR

public static DataFlavor WT_OBJECT_ARRAY_FLAVOR
The DataFlavor representing an array of WTObject class objects, where:

representationClass = wt.fc.WTObject
mimeType = "application/x-java-serialized-object"

Constructor Detail

WTClipboard

private WTClipboard(String name)
The constructor is private since this class should never be instantiated outside of this class.

Parameters:
name - A name that describes the clipboard.
Method Detail

getClipboard

public static Clipboard getClipboard()
Get the Windchill clipboard. The Windchill clipboard is kept track of statically by this class. If the Windchill clipboard has not yet been created, this method will create it. This method will also try to get access to the System Clipboard. Currently the jdk does not allow setting any object in the clipboard except strings.

Supported API: true

Returns:
the Windchill clipboard

setContents

public 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 registered, that owner is notified that it no longer holds ownership of the clipboard contents.

Supported API: true

Parameters:
owner - the object which owns the clipboard data.

getContents

public Transferable getContents(Object requestor)
Get the data from the clipboard. If the system clipboard is being used and Windchill does not own it, the data will be obtained from the system clipboard. If the system clipboard is being used and is owned by Windchill, then the data is obtained from the Windchill clipboard. If the system clipboard is not in use, the data is obtained from the Windchill clipboard.

Supported API: true

Parameters:
requestor - the object requesting the clipboard data.
Returns:
the data from the clipboard.