org.openide.util.datatransfer
Class ExTransferable.Multi.TransferObjectImpl

java.lang.Object
  extended by org.openide.util.datatransfer.ExTransferable.Multi.TransferObjectImpl
All Implemented Interfaces:
MultiTransferObject
Enclosing class:
ExTransferable.Multi

static class ExTransferable.Multi.TransferObjectImpl
extends java.lang.Object
implements MultiTransferObject

Class implementing MultiTransferObject interface.


Constructor Summary
ExTransferable.Multi.TransferObjectImpl(java.awt.datatransfer.Transferable[] trans)
          Creates new object from transferable objects.
 
Method Summary
 boolean areDataFlavorsSupported(java.awt.datatransfer.DataFlavor[] array)
          Test whether each transfered item supports at least one of these flavors.
 int getCount()
          Number of transfered elements.
 java.awt.datatransfer.Transferable getTransferableAt(int index)
          Get the transferable at some index.
 java.lang.Object getTransferData(int indx, java.awt.datatransfer.DataFlavor flavor)
          Get transfer data for the item at some index.
 java.awt.datatransfer.DataFlavor[] getTransferDataFlavors(int i)
          Gets list of all supported flavors for i-th element.
 boolean isDataFlavorSupported(int index, java.awt.datatransfer.DataFlavor flavor)
          Test whether data flavor is supported by index-th item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExTransferable.Multi.TransferObjectImpl

public ExTransferable.Multi.TransferObjectImpl(java.awt.datatransfer.Transferable[] trans)
Creates new object from transferable objects.

Parameters:
trans - array of transferable objects
Method Detail

getCount

public int getCount()
Number of transfered elements.

Specified by:
getCount in interface MultiTransferObject
Returns:
number of elements

getTransferableAt

public java.awt.datatransfer.Transferable getTransferableAt(int index)
Description copied from interface: MultiTransferObject
Get the transferable at some index.

Specified by:
getTransferableAt in interface MultiTransferObject
Parameters:
index - the index
Returns:
Transferable at the specific index

isDataFlavorSupported

public boolean isDataFlavorSupported(int index,
                                     java.awt.datatransfer.DataFlavor flavor)
Test whether data flavor is supported by index-th item.

Specified by:
isDataFlavorSupported in interface MultiTransferObject
Parameters:
index - the index of
flavor - flavor to test
Returns:
true if flavor is supported by all elements

areDataFlavorsSupported

public boolean areDataFlavorsSupported(java.awt.datatransfer.DataFlavor[] array)
Test whether each transfered item supports at least one of these flavors. Each item can support different flavor.

Specified by:
areDataFlavorsSupported in interface MultiTransferObject
Parameters:
array - array of flavors
Returns:
true if all items support one or more flavors

getTransferDataFlavors

public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors(int i)
Gets list of all supported flavors for i-th element.

Specified by:
getTransferDataFlavors in interface MultiTransferObject
Parameters:
i - the element to find flavors for
Returns:
array of supported flavors

getTransferData

public java.lang.Object getTransferData(int indx,
                                        java.awt.datatransfer.DataFlavor flavor)
                                 throws java.awt.datatransfer.UnsupportedFlavorException,
                                        java.io.IOException
Description copied from interface: MultiTransferObject
Get transfer data for the item at some index.

Specified by:
getTransferData in interface MultiTransferObject
Parameters:
indx - index of element to work with
flavor - one needs to obtain
Returns:
object for the flavor of the i-th element
Throws:
java.awt.datatransfer.UnsupportedFlavorException - if that flavor is not supported
java.io.IOException - if there is an I/O problem