org.openide.util.datatransfer
Class ExTransferable.Single

java.lang.Object
  extended by org.openide.util.datatransfer.ExTransferable.Single
All Implemented Interfaces:
java.awt.datatransfer.Transferable
Enclosing class:
ExTransferable

public abstract static class ExTransferable.Single
extends java.lang.Object
implements java.awt.datatransfer.Transferable

Support for transferable owner with only one data flavor. Subclasses need only implement getData().


Constructor Summary
ExTransferable.Single(java.awt.datatransfer.DataFlavor flavor)
          Constructor.
 
Method Summary
protected abstract  java.lang.Object getData()
          Abstract method to override to provide the right data for this transferable.
 java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
           
 java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
           
 boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExTransferable.Single

public ExTransferable.Single(java.awt.datatransfer.DataFlavor flavor)
Constructor.

Parameters:
flavor - flavor of the data
Method Detail

getTransferDataFlavors

public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Specified by:
getTransferDataFlavors in interface java.awt.datatransfer.Transferable

isDataFlavorSupported

public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
Specified by:
isDataFlavorSupported in interface java.awt.datatransfer.Transferable

getTransferData

public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
                                 throws java.awt.datatransfer.UnsupportedFlavorException,
                                        java.io.IOException
Specified by:
getTransferData in interface java.awt.datatransfer.Transferable
Throws:
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException

getData

protected abstract java.lang.Object getData()
                                     throws java.io.IOException,
                                            java.awt.datatransfer.UnsupportedFlavorException
Abstract method to override to provide the right data for this transferable.

Returns:
the data
Throws:
java.io.IOException - when an I/O error occurs
java.awt.datatransfer.UnsupportedFlavorException - if the flavor is not supported