Package ca.cgjennings.ui
Class ListTransferHandler
- java.lang.Object
-
- javax.swing.TransferHandler
-
- ca.cgjennings.ui.ListTransferHandler
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ListTransferHandler.RubbishTransferHandler
public class ListTransferHandler extends javax.swing.TransferHandler
A transfer handler for moving items between lists.- Author:
- Chris Jennings
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ListTransferHandler.ListTransferable
static class
ListTransferHandler.RubbishTransferHandler
This can be used as the transfer handler for a "rubbish can".
-
Field Summary
Fields Modifier and Type Field Description protected int
addCount
protected int
addIndex
protected int[]
indices
protected java.awt.datatransfer.DataFlavor
localArrayListFlavor
protected java.lang.String
localArrayListType
protected java.awt.datatransfer.DataFlavor
serialArrayListFlavor
-
Constructor Summary
Constructors Constructor Description ListTransferHandler()
ListTransferHandler(java.lang.Class<?> contentClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canImport(javax.swing.JComponent c, java.awt.datatransfer.DataFlavor[] flavors)
protected java.awt.datatransfer.Transferable
createTransferable(javax.swing.JComponent c)
protected void
exportDone(javax.swing.JComponent c, java.awt.datatransfer.Transferable data, int action)
int
getSourceActions(javax.swing.JComponent c)
protected java.util.ArrayList<?>
getTransferData(java.awt.datatransfer.Transferable t)
javax.swing.Icon
getVisualRepresentation(java.awt.datatransfer.Transferable t)
boolean
importData(javax.swing.TransferHandler.TransferSupport transfer)
-
-
-
Field Detail
-
localArrayListFlavor
protected java.awt.datatransfer.DataFlavor localArrayListFlavor
-
serialArrayListFlavor
protected java.awt.datatransfer.DataFlavor serialArrayListFlavor
-
localArrayListType
protected java.lang.String localArrayListType
-
indices
protected int[] indices
-
addIndex
protected int addIndex
-
addCount
protected int addCount
-
-
Method Detail
-
getVisualRepresentation
public javax.swing.Icon getVisualRepresentation(java.awt.datatransfer.Transferable t)
- Overrides:
getVisualRepresentation
in classjavax.swing.TransferHandler
-
getTransferData
protected java.util.ArrayList<?> getTransferData(java.awt.datatransfer.Transferable t)
-
importData
public boolean importData(javax.swing.TransferHandler.TransferSupport transfer)
- Overrides:
importData
in classjavax.swing.TransferHandler
-
exportDone
protected void exportDone(javax.swing.JComponent c, java.awt.datatransfer.Transferable data, int action)
- Overrides:
exportDone
in classjavax.swing.TransferHandler
-
canImport
public boolean canImport(javax.swing.JComponent c, java.awt.datatransfer.DataFlavor[] flavors)
- Overrides:
canImport
in classjavax.swing.TransferHandler
-
createTransferable
protected java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent c)
- Overrides:
createTransferable
in classjavax.swing.TransferHandler
-
getSourceActions
public int getSourceActions(javax.swing.JComponent c)
- Overrides:
getSourceActions
in classjavax.swing.TransferHandler
-
-