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) class
Internal class that implements DragGestureListener.(package private) class
Internal class that implements DragSourceListener.(package private) class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PropertyChangeListener
private DragGestureRecognizer
private DragSource
private MutableTreeNode
private DropTarget
private 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 Method
This to avoid excessive reflection to find the "getTransferable" method.private EventListenerList
private PropertyChangeListener
private DnDCellRendererProxy
Fields inherited from class org.pushingpixels.radiance.theming.api.RadianceThemingWidget
jcomp
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
void
Installs listeners for the associated component.private static boolean
isAncestorOf
(TreeNode aPossibleParent, TreeNode aNode) See if aPossibleParent is ancestor of aNodeprivate boolean
mayDropHere
(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 boolean
mayDropHere
(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 boolean
mayDropHere
(JTree aSourceTree, MutableTreeNode aSourceNode, TreeNode aNode) Invoked to decide if draggedNode can be dropped into aNode.private boolean
mayDropHere
(JTree aSourceTree, MutableTreeNode aSourceNode, TreePath aPath) Invoked to decide if draggedNode can be dropped in the last path component of the given path.private void
private void
void
Uninstalls listeners for the associated component.Methods inherited from class org.pushingpixels.radiance.theming.api.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:RadianceThemingWidget
Installs listeners for the associated component.- Overrides:
installListeners
in classRadianceThemingWidget<JTree>
-
installDnDSupport
private void installDnDSupport() -
uninstallListeners
public void uninstallListeners()Description copied from class:RadianceThemingWidget
Uninstalls listeners for the associated component.- Overrides:
uninstallListeners
in 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
See if aPossibleParent is ancestor of aNode -
resetDragAndDrop
private void resetDragAndDrop()
-