Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.util.swing
Class ExtendedTransferHandler.SelectedTextTransferable

java.lang.Object
  extended by net.java.sip.communicator.util.swing.ExtendedTransferHandler.SelectedTextTransferable
All Implemented Interfaces:
Transferable
Enclosing class:
ExtendedTransferHandler

public class ExtendedTransferHandler.SelectedTextTransferable
extends Object
implements Transferable

Transferable for text pane components that enables drag and drop of text.


Constructor Summary
ExtendedTransferHandler.SelectedTextTransferable(JTextComponent component)
          Creates an instance of SelectedTextTransferable.
 
Method Summary
 Object getTransferData(DataFlavor flavor)
          Returns the selected text.
 DataFlavor[] getTransferDataFlavors()
          Returns supported flavors.
 boolean isDataFlavorSupported(DataFlavor flavor)
          Returns true if the given flavor is supported, otherwise returns false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedTransferHandler.SelectedTextTransferable

public ExtendedTransferHandler.SelectedTextTransferable(JTextComponent component)
Creates an instance of SelectedTextTransferable.

Parameters:
component - the text component
Method Detail

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Returns supported flavors.

Specified by:
getTransferDataFlavors in interface Transferable
Returns:
an array of supported flavors

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor flavor)
Returns true if the given flavor is supported, otherwise returns false.

Specified by:
isDataFlavorSupported in interface Transferable
Parameters:
flavor - the data flavor to verify
Returns:
true if the given flavor is supported, otherwise returns false

getTransferData

public Object getTransferData(DataFlavor flavor)
                       throws UnsupportedFlavorException,
                              IOException
Returns the selected text.

Specified by:
getTransferData in interface Transferable
Parameters:
flavor - the flavor
Returns:
the selected text
Throws:
IOException - if the data is no longer available in the requested flavor.
UnsupportedFlavorException - if the requested data flavor is not supported.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.