wt.clients.util
Class WTObjectSelection

java.lang.Object
  extended bywt.clients.util.WTObjectSelection
All Implemented Interfaces:
ClipboardOwner, Transferable

public class WTObjectSelection
extends Object
implements Transferable, ClipboardOwner

A class which implements the capability required to transfer an array of WTObjects.

Supported API: true

Extendable: false


Field Summary
private  DataFlavor[] flavors_
           
(package private) static int PLAIN_TEXT
           
(package private) static int STRING
           
(package private) static String STRING_SEPARATOR
           
(package private) static int WT_OBJECT_ARRAY
           
private  WTObject[] wtObjectArray_
           
private  String wtObjectString_
           
 
Constructor Summary
WTObjectSelection(WTObject wt_object)
          Creates a transferable object capable of transfering the specified WTObject.
WTObjectSelection(WTObject[] wt_object_array)
          Creates a transferable object capable of transfering the specified array of WTObjects.
 
Method Summary
 Object getTransferData(DataFlavor flavor)
          Get the data in the requested format.
 DataFlavor[] getTransferDataFlavors()
          Determines the array of flavors in which this class can provide data.
private  String getWTObjectString_()
          Build a string representation of the wtobject array contained in this transferable object.
 boolean isDataFlavorSupported(DataFlavor flavor)
          Determines whether the requested flavor is supported by this object.
 void lostOwnership(Clipboard clipboard, Transferable contents)
          Notifies this object that it is no longer the owner of the contents of the clipboard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WT_OBJECT_ARRAY

static final int WT_OBJECT_ARRAY
See Also:
Constant Field Values

STRING

static final int STRING
See Also:
Constant Field Values

PLAIN_TEXT

static final int PLAIN_TEXT
See Also:
Constant Field Values

STRING_SEPARATOR

static final String STRING_SEPARATOR
See Also:
Constant Field Values

flavors_

private DataFlavor[] flavors_

wtObjectArray_

private WTObject[] wtObjectArray_

wtObjectString_

private String wtObjectString_
Constructor Detail

WTObjectSelection

public WTObjectSelection(WTObject[] wt_object_array)
Creates a transferable object capable of transfering the specified array of WTObjects.

Supported API: true

Parameters:
wt_object_array - an array of WTObjects to transfer.

WTObjectSelection

public WTObjectSelection(WTObject wt_object)
Creates a transferable object capable of transfering the specified WTObject.

Supported API: true

Parameters:
wt_object - the WTObject to transfer.
Method Detail

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Determines the array of flavors in which this class can provide data.

Supported API: true

Specified by:
getTransferDataFlavors in interface Transferable
Returns:
the array of flavors in which this class can provide data.
See Also:
DataFlavor, WTClipboard

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor flavor)
Determines whether the requested flavor is supported by this object.

Supported API: true

Specified by:
isDataFlavorSupported in interface Transferable
Parameters:
flavor - the requested data flavor.
Returns:
true if the flavor is supported, otherwise false.

getTransferData

public Object getTransferData(DataFlavor flavor)
                       throws UnsupportedFlavorException,
                              IOException
Get the data in the requested format.

Supported API: true

Specified by:
getTransferData in interface Transferable
Parameters:
flavor - the requested data flavor.
Throws:
UnsupportedFlavorException - if the requested data flavor is not supported.
IOException

getWTObjectString_

private String getWTObjectString_()
Build a string representation of the wtobject array contained in this transferable object. The generated string consists of concatenating the URL representation of each wtobject in the wtobject array.

Supported API: true

Returns:
the string representing the transferable object.

lostOwnership

public void lostOwnership(Clipboard clipboard,
                          Transferable contents)
Notifies this object that it is no longer the owner of the contents of the clipboard.

Supported API: true

Specified by:
lostOwnership in interface ClipboardOwner
Parameters:
clipboard - the clipboard that is no longer owned
contents - the contents which this owner had placed on the clipboard