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 Strokeprotected TreePathprotected Rectangleprotected AutoscrollingJTreeFields inherited from class javax.swing.TransferHandler
COPY, COPY_OR_MOVE, LINK, MOVE, NONE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractTreeTransferHandler(AutoscrollingJTree tree, int action, boolean beADropTarget) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleancanPerformAction(AutoscrollingJTree target, List<DataFlavor> flavors, int action, Point location, TreePath dropPath) protected abstract booleancanStartDrag(TreePath[] paths) protected voidprotected TransferablecreateTransferable(JComponent c, boolean drag) protected abstract TransferablecreateTransferableForCutCopy(TreePath[] paths) protected abstract TransferablecreateTransferableForDrag(TreePath[] paths) voiddragEnter(DropTargetDragEvent dtde) voiddragExit(DropTargetEvent dte) voiddragOver(DropTargetDragEvent dtde) protected voiddrawHighlight(TreePath path) voiddrop(DropTargetDropEvent dtde) voidprotected abstract booleanexecuteDrop(AutoscrollingJTree tree, Transferable transferable, TreePath parentTreePath, int action) voidexportToClipboard(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 intgetSourceActions(TreePath[] selPaths) Override to provide the actions available for the given pathsprotected TreePathMethods 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:
dragEnterin interfaceDropTargetListener
-
dragExit
- Specified by:
dragExitin interfaceDropTargetListener
-
dragOver
- Specified by:
dragOverin interfaceDropTargetListener
-
dropActionChanged
- Specified by:
dropActionChangedin interfaceDropTargetListener
-
drop
- Specified by:
dropin interfaceDropTargetListener
-
pathFor
-
getSourceActions
---------------------------- Methods from TransferHandler ------------------------------- Overrides:
getSourceActionsin classTransferHandler
-
getSourceActions
Override to provide the actions available for the given paths -
createTransferable
- Overrides:
createTransferablein 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:
exportToClipboardin 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)
-