net.shredzone.ifish.gui
Class EntryTransferHandler
java.lang.Object
javax.swing.TransferHandler
net.shredzone.ifish.gui.EntryTransferHandler
- All Implemented Interfaces:
- Serializable
public class EntryTransferHandler
- extends TransferHandler
A transfer handler that allows to order Entry objects by drag and drop.
- Version:
- $Id: EntryTransferHandler.java 291 2009-04-28 21:29:27Z shred $
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EntryTransferHandler
public EntryTransferHandler(IFishPane fish)
- Create a new EntryTransferHandler
- Parameters:
fish - Reference to IFishPane
getSourceActions
public int getSourceActions(JComponent c)
- Get allowed source actions. This TransferHandler only supports MOVE since
we want to sort JTable entries.
- Overrides:
getSourceActions in class TransferHandler
- Parameters:
c - JComponent that initiates the DnD action.
- Returns:
- Source action, MOVE here.
canImport
public boolean canImport(JComponent comp,
DataFlavor[] transferFlavors)
- Check if this TransferHandler accepts one of the given flavors. Only
EntryContainer.entryFlavor is accepted here.
- Overrides:
canImport in class TransferHandler
- Parameters:
comp - JComponent that is the target of the DnD action.transferFlavors - DataFlavors to be checked
- Returns:
- true if this TransferHandler accepts one of the flavors.
createTransferable
public Transferable createTransferable(JComponent comp)
- Create a Transferable. The Transferable will contain all Entry
objects that have been selected.
- Overrides:
createTransferable in class TransferHandler
- Parameters:
comp - JComponent that is the source of the DnD action.
- Returns:
- Transferable containing the data.
importData
public boolean importData(JComponent comp,
Transferable t)
- Import data after dropping them to the component.
- Overrides:
importData in class TransferHandler
- Parameters:
comp - JComponent that is the target of the DnD action.t - Transferable containing the transported data.
- Returns:
- Always true.
Copyright © 2007-2011
shredzone.org. All Rights Reserved.