Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.gui.main.call
Class CallTransferHandler

java.lang.Object
  extended by javax.swing.TransferHandler
      extended by net.java.sip.communicator.util.swing.ExtendedTransferHandler
          extended by net.java.sip.communicator.impl.gui.main.call.CallTransferHandler
All Implemented Interfaces:
Serializable

public class CallTransferHandler
extends ExtendedTransferHandler

A TransferHandler that we use to handle dropping of UIContacts or simple string addresses to an existing Call. Dropping of a such data in the CallDialog would result in the creation of a call conference.

Author:
Yana Stamcheva
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class net.java.sip.communicator.util.swing.ExtendedTransferHandler
ExtendedTransferHandler.SelectedTextTransferable
 
Nested classes/interfaces inherited from class javax.swing.TransferHandler
TransferHandler.DropLocation, TransferHandler.TransferSupport
 
Field Summary
protected static DataFlavor uiContactDataFlavor
          The data flavor used when transferring UIContacts.
 
Fields inherited from class javax.swing.TransferHandler
COPY, COPY_OR_MOVE, LINK, MOVE, NONE
 
Constructor Summary
CallTransferHandler(Call call)
          Creates an instance of CallTransferHandler by specifying the call, to which dragged callees will be added.
 
Method Summary
 boolean canImport(JComponent comp, DataFlavor[] flavor)
          Indicates whether a component will accept an import of the given set of data flavors prior to actually attempting to import it.
 boolean importData(JComponent comp, Transferable t)
          Handles transfers to the chat panel from the clip board or a DND drop operation.
 
Methods inherited from class net.java.sip.communicator.util.swing.ExtendedTransferHandler
createTransferable, exportAsDrag, exportToClipboard, getSourceActions, getVisualRepresentation
 
Methods inherited from class javax.swing.TransferHandler
canImport, exportDone, getCopyAction, getCutAction, getPasteAction, importData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uiContactDataFlavor

protected static final DataFlavor uiContactDataFlavor
The data flavor used when transferring UIContacts.

Constructor Detail

CallTransferHandler

public CallTransferHandler(Call call)
Creates an instance of CallTransferHandler by specifying the call, to which dragged callees will be added.

Parameters:
call - the call to which the dragged callees will be added
Method Detail

canImport

public boolean canImport(JComponent comp,
                         DataFlavor[] flavor)
Indicates whether a component will accept an import of the given set of data flavors prior to actually attempting to import it. We return true to indicate that the transfer with at least one of the given flavors would work and false to reject the transfer.

Overrides:
canImport in class ExtendedTransferHandler
Parameters:
comp - component
flavor - the data formats available
Returns:
true if the data can be inserted into the component, false otherwise
Throws:
NullPointerException - if support is null

importData

public boolean importData(JComponent comp,
                          Transferable t)
Handles transfers to the chat panel from the clip board or a DND drop operation. The Transferable parameter contains the data that needs to be imported.

Overrides:
importData in class TransferHandler
Parameters:
comp - the component to receive the transfer;
t - the data to import
Returns:
true if the data was inserted into the component and false otherwise

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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