org.tentackle.appworx
Class AppDbObjectTransferable

java.lang.Object
  extended by org.tentackle.appworx.AppDbObjectTransferable
All Implemented Interfaces:
ClipboardOwner, Transferable

public class AppDbObjectTransferable
extends Object
implements Transferable, ClipboardOwner

Transferable for Drag and Drop of AppDbObjects or lists of.

Author:
harald

Field Summary
static DataFlavor appDbObjectFlavor
          flavor for a single AppDbObject
static DataFlavor appDbObjectListFlavor
          flavor for a list of AppDbObjects
 
Constructor Summary
AppDbObjectTransferable(AppDbObject object)
          Creates a transfertable for an object.
AppDbObjectTransferable(Collection<?> objects)
          Creates a transferable for a collection of objects.
 
Method Summary
 Object getTransferData(DataFlavor flv)
          Returns an object which represents the data to be transferred.
 DataFlavor[] getTransferDataFlavors()
          Returns an array of DataFlavor objects indicating the flavors the data can be provided in.
 boolean isDataFlavorSupported(DataFlavor flv)
          Returns whether or not the specified data flavor is supported for this object.
 void lostOwnership(Clipboard clipboard, Transferable contents)
          Notifies this object that it is no longer the clipboard owner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

appDbObjectFlavor

public static final DataFlavor appDbObjectFlavor
flavor for a single AppDbObject


appDbObjectListFlavor

public static final DataFlavor appDbObjectListFlavor
flavor for a list of AppDbObjects

Constructor Detail

AppDbObjectTransferable

public AppDbObjectTransferable(AppDbObject object)
Creates a transfertable for an object.

Parameters:
object - the AppDbObject

AppDbObjectTransferable

public AppDbObjectTransferable(Collection<?> objects)
Creates a transferable for a collection of objects. Non-AppDbObjects are skipped.

Parameters:
objects -
Method Detail

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Description copied from interface: java.awt.datatransfer.Transferable
Returns an array of DataFlavor objects indicating the flavors the data can be provided in. The array should be ordered according to preference for providing the data (from most richly descriptive to least descriptive).

Specified by:
getTransferDataFlavors in interface Transferable
Returns:
an array of data flavors in which this data can be transferred

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor flv)
Description copied from interface: java.awt.datatransfer.Transferable
Returns whether or not the specified data flavor is supported for this object.

Specified by:
isDataFlavorSupported in interface Transferable
Parameters:
flv - the requested flavor for the data
Returns:
boolean indicating whether or not the data flavor is supported

getTransferData

public Object getTransferData(DataFlavor flv)
                       throws UnsupportedFlavorException
Description copied from interface: java.awt.datatransfer.Transferable
Returns an object which represents the data to be transferred. The class of the object returned is defined by the representation class of the flavor.

Specified by:
getTransferData in interface Transferable
Parameters:
flv - the requested flavor for the data
Throws:
UnsupportedFlavorException - if the requested data flavor is not supported.
See Also:
DataFlavor.getRepresentationClass()

lostOwnership

public void lostOwnership(Clipboard clipboard,
                          Transferable contents)
Description copied from interface: java.awt.datatransfer.ClipboardOwner
Notifies this object that it is no longer the clipboard owner. This method will be called when another application or another object within this application asserts ownership of the clipboard.

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


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de