java.lang.Object
org.pushingpixels.radiance.theming.api.RadianceThemingWidget<JTree>
org.pushingpixels.radiance.theming.internal.widget.tree.dnd.TreeDragAndDropWidget

public class TreeDragAndDropWidget extends RadianceThemingWidget<JTree>
TreeWrapper is used to handle drag and drop and popup menus in any JTree.
  • Field Details

  • 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 class RadianceThemingWidget<JTree>
    • installDnDSupport

      private void installDnDSupport()
    • uninstallListeners

      public void uninstallListeners()
      Description copied from class: RadianceThemingWidget
      Uninstalls listeners for the associated component.
      Overrides:
      uninstallListeners in class RadianceThemingWidget<JTree>
    • uninstallDnDSupport

      private void uninstallDnDSupport()
    • mayDropHere

      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.
      Parameters:
      aSourceString - the String being dragged.
      aPath - the path to drop into.
      Returns:
      true to allow the drop operation, false otherwise.
    • mayDropHere

      private 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.
      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

      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.
      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

      private boolean mayDropHere(JTree aSourceTree, MutableTreeNode aSourceNode, TreeNode aNode)
      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

      private static boolean isAncestorOf(TreeNode aPossibleParent, TreeNode aNode)
      See if aPossibleParent is ancestor of aNode
    • resetDragAndDrop

      private void resetDragAndDrop()