public class ChatRoomContactListTransferHandler extends ExtendedTransferHandler
Modifier and Type | Class and Description |
---|---|
class |
ChatRoomContactListTransferHandler.ContactListTransferable
Transferable for JList that enables drag and drop of contacts.
|
ExtendedTransferHandler.SelectedTextTransferable
Constructor and Description |
---|
ChatRoomContactListTransferHandler(ChatRoomContactList contactList)
Creates an instance of ContactListTransferHandler passing the
contactList which uses this TransferHandler.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canImport(javax.swing.JComponent comp,
java.awt.datatransfer.DataFlavor[] flavor)
Indicates whether a component will accept an import of the given
set of data flavors prior to actually attempting to import it.
|
java.awt.datatransfer.Transferable |
createTransferable(javax.swing.JComponent component)
Creates a transferable for text pane components in order to enable drag
and drop of text.
|
javax.swing.Icon |
getVisualRepresentation(java.awt.datatransfer.Transferable t)
Overrides TransferHandler.getVisualRepresentation(Transferable t)
in order to return a custom drag icon.
|
boolean |
importData(javax.swing.JComponent comp,
java.awt.datatransfer.Transferable t)
Handles transfers to the contact list from the clip board or a
DND drop operation.
|
exportAsDrag, exportToClipboard, getSelectedTextFromComponent, getSourceActions
public ChatRoomContactListTransferHandler(ChatRoomContactList contactList)
contactList
- the DefaultContactList which uses this
TransferHandlerpublic java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent component)
createTransferable
in class ExtendedTransferHandler
component
- the component for which to create a
Transferablepublic boolean canImport(javax.swing.JComponent comp, java.awt.datatransfer.DataFlavor[] flavor)
canImport
in class ExtendedTransferHandler
comp
- componentflavor
- the data formats availablejava.lang.NullPointerException
- if support
is null
public boolean importData(javax.swing.JComponent comp, java.awt.datatransfer.Transferable t)
importData
in class javax.swing.TransferHandler
comp
- the component to receive the transfert
- the data to importTransferHandler.importData(JComponent, Transferable)
public javax.swing.Icon getVisualRepresentation(java.awt.datatransfer.Transferable t)
The default parent implementation of this method returns null.
getVisualRepresentation
in class ExtendedTransferHandler
t
- the data to be transferred; this value is expected to have been
created by the createTransferable
method
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.