Class AbstractTreeTransferHandler
java.lang.Object
javax.swing.TransferHandler
com.inductiveautomation.ignition.client.util.gui.tree.AbstractTreeTransferHandler
- All Implemented Interfaces:
DropTargetListener
,Serializable
,EventListener
- Direct Known Subclasses:
ClientTagTreeTransferHandler
,TagTransferHandler
public abstract class AbstractTreeTransferHandler
extends TransferHandler
implements DropTargetListener
A class that can acts as a 1.4 TransferHandler, and a 1.3 DropTargetListener all at once.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.TransferHandler
TransferHandler.DropLocation, TransferHandler.TransferSupport
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stroke
protected TreePath
protected Rectangle
protected AutoscrollingJTree
Fields inherited from class javax.swing.TransferHandler
COPY, COPY_OR_MOVE, LINK, MOVE, NONE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractTreeTransferHandler
(AutoscrollingJTree tree, int action, boolean beADropTarget) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
canPerformAction
(AutoscrollingJTree target, List<DataFlavor> flavors, int action, Point location, TreePath dropPath) protected abstract boolean
canStartDrag
(TreePath[] paths) protected void
protected Transferable
createTransferable
(JComponent c, boolean drag) protected abstract Transferable
createTransferableForCutCopy
(TreePath[] paths) protected abstract Transferable
createTransferableForDrag
(TreePath[] paths) void
dragEnter
(DropTargetDragEvent dtde) void
dragExit
(DropTargetEvent dte) void
dragOver
(DropTargetDragEvent dtde) protected void
drawHighlight
(TreePath path) void
drop
(DropTargetDropEvent dtde) void
protected abstract boolean
executeDrop
(AutoscrollingJTree tree, Transferable transferable, TreePath parentTreePath, int action) void
exportToClipboard
(JComponent comp, Clipboard clip, int action) Copied from super so that it calls createTransferableForCutCopy instead of the normal one.int
---------------------------- Methods from TransferHandler ------------------------------protected abstract int
getSourceActions
(TreePath[] selPaths) Override to provide the actions available for the given pathsprotected TreePath
Methods inherited from class javax.swing.TransferHandler
canImport, canImport, exportAsDrag, exportDone, getCopyAction, getCutAction, getDragImage, getDragImageOffset, getPasteAction, getVisualRepresentation, importData, importData, setDragImage, setDragImageOffset
-
Field Details
-
tree
-
rect
-
lastHighlight
-
highlightStroke
-
-
Constructor Details
-
AbstractTreeTransferHandler
- Parameters:
tree
- The tree in question.action
- A bitmask to use as the acceptable actions (@seeDropTarget.getDefaultActions()
beADropTarget
- Should this tree be a drop target?
-
-
Method Details
-
drawHighlight
-
clearHighlight
protected void clearHighlight() -
dragEnter
- Specified by:
dragEnter
in interfaceDropTargetListener
-
dragExit
- Specified by:
dragExit
in interfaceDropTargetListener
-
dragOver
- Specified by:
dragOver
in interfaceDropTargetListener
-
dropActionChanged
- Specified by:
dropActionChanged
in interfaceDropTargetListener
-
drop
- Specified by:
drop
in interfaceDropTargetListener
-
pathFor
-
getSourceActions
---------------------------- Methods from TransferHandler ------------------------------- Overrides:
getSourceActions
in classTransferHandler
-
getSourceActions
Override to provide the actions available for the given paths -
createTransferable
- Overrides:
createTransferable
in classTransferHandler
-
createTransferable
-
exportToClipboard
public void exportToClipboard(JComponent comp, Clipboard clip, int action) throws IllegalStateException Copied from super so that it calls createTransferableForCutCopy instead of the normal one.- Overrides:
exportToClipboard
in classTransferHandler
- Throws:
IllegalStateException
-
canStartDrag
-
createTransferableForDrag
-
createTransferableForCutCopy
-
canPerformAction
protected abstract boolean canPerformAction(AutoscrollingJTree target, List<DataFlavor> flavors, int action, Point location, TreePath dropPath) -
executeDrop
protected abstract boolean executeDrop(AutoscrollingJTree tree, Transferable transferable, TreePath parentTreePath, int action)
-