Class TreeDragAndDropWidget
java.lang.Object
org.pushingpixels.radiance.theming.api.RadianceThemingWidget<JTree>
org.pushingpixels.radiance.theming.internal.widget.tree.dnd.TreeDragAndDropWidget
TreeWrapper is used to handle drag and drop and popup menus in any JTree.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classInternal class that implements DragGestureListener.(package private) classInternal class that implements DragSourceListener.(package private) class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PropertyChangeListenerprivate DragGestureRecognizerprivate DragSourceprivate MutableTreeNodeprivate DropTargetprivate static Class[]This to avoid excesive creation of objects in invocation.private static Object[]This to avoid excesive creation of objects in invocation.private static MethodThis to avoid excessive reflection to find the "getTransferable" method.private EventListenerListprivate PropertyChangeListenerprivate DnDCellRendererProxyFields inherited from class RadianceThemingWidget
jcomp -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidvoidInstalls listeners for the associated component.private static booleanisAncestorOf(TreeNode aPossibleParent, TreeNode aNode) See if aPossibleParent is ancestor of aNodeprivate booleanmayDropHere(String aSourceString, JTree aTargetTree, TreeNode aNode) Invoked to decide if a given String can be dropped in the last path component of the given path.private booleanmayDropHere(String aSourceString, JTree aTargetTree, TreePath aPath) Invoked to decide if a given String can be dropped in the last path component of the given path.private booleanmayDropHere(JTree aSourceTree, MutableTreeNode aSourceNode, TreeNode aNode) Invoked to decide if draggedNode can be dropped into aNode.private booleanmayDropHere(JTree aSourceTree, MutableTreeNode aSourceNode, TreePath aPath) Invoked to decide if draggedNode can be dropped in the last path component of the given path.private voidprivate voidvoidUninstalls listeners for the associated component.Methods inherited from class RadianceThemingWidget
installComponents, installDefaults, installUI, setComponent, uninstallComponents, uninstallDefaults, uninstallUI
-
Field Details
-
EMPTY_CLASS_ARRAY
This to avoid excesive creation of objects in invocation. -
getTransferableMethod
This to avoid excessive reflection to find the "getTransferable" method. -
EMPTY_OBJECT_ARRAY
This to avoid excesive creation of objects in invocation. -
rendererProxy
-
dragSource
-
dropTarget
-
dropNode
-
listeners
-
propertyChangeListener
-
cellRendererChangeListener
-
dropListener
-
gestureListener
-
dragGestureRecognizer
-
-
Constructor Details
-
TreeDragAndDropWidget
public TreeDragAndDropWidget()
-
-
Method Details
-
installListeners
public void installListeners()Description copied from class:RadianceThemingWidgetInstalls listeners for the associated component.- Overrides:
installListenersin classRadianceThemingWidget<JTree>
-
installDnDSupport
private void installDnDSupport() -
uninstallListeners
public void uninstallListeners()Description copied from class:RadianceThemingWidgetUninstalls listeners for the associated component.- Overrides:
uninstallListenersin classRadianceThemingWidget<JTree>
-
uninstallDnDSupport
private void uninstallDnDSupport() -
mayDropHere
Invoked to decide if a given String can be dropped in the last path component of the given path.- Parameters:
aSourceString- the String being dragged.aPath- the path to drop into.- Returns:
- true to allow the drop operation, false otherwise.
-
mayDropHere
Invoked to decide if a given String can be dropped in the last path component of the given path.- Parameters:
aSourceString- the String being dragged.aTargetTree- the tree to drop into.aNode- the node to drop into.- Returns:
- true to allow the drop operation, false otherwise.
-
mayDropHere
Invoked to decide if draggedNode can be dropped in the last path component of the given path.- Parameters:
aSourceTree- the source tree.aSourceNode- the source node.aPath- the path to drop into.- Returns:
- true to allow the drop operation, false otherwise.
-
mayDropHere
Invoked to decide if draggedNode can be dropped into aNode.- Parameters:
aSourceTree- the source tree.aSourceNode- the source node.aNode- the node to drop into.- Returns:
- true to allow the drop operation, false to avoid it.
-
isAncestorOf
-
resetDragAndDrop
private void resetDragAndDrop()
-