public void dragGestureRecognized (DragGestureEvent dge) { super.dragGestureRecognized (dge); // notify tree cell editor that DnD operationm is active if (exDnD.isDnDActive ()) { TreeCellEditor tce = ((JTree)tree).getCellEditor (); if (tce instanceof TreeViewCellEditor) ((TreeViewCellEditor)tce).setDnDActive (true); } }
@Override public void dragGestureRecognized(DragGestureEvent dge) { super.dragGestureRecognized(dge); // notify tree cell editor that DnD operationm is active if (exDnD.isDnDActive()) { TreeCellEditor tce = tree.getCellEditor(); if (tce instanceof TreeViewCellEditor) { ((TreeViewCellEditor) tce).setDnDActive(true); } } }
public void dragGestureRecognized (DragGestureEvent dge) { super.dragGestureRecognized (dge); // notify tree cell editor that DnD operationm is active if (exDnD.isDnDActive ()) { TreeCellEditor tce = ((JTree)tree).getCellEditor (); if (tce instanceof TreeViewCellEditor) ((TreeViewCellEditor)tce).setDnDActive (true); } }
public void valueChanged(TreeSelectionEvent ev) { TreePath[] paths = tree.getSelectionPaths (); storeSelectedPaths = Arrays.asList (paths == null ? new TreePath[0] : paths); if (paths == null) { // part of bugfix #37279, if DnD is active then is useless select a nearby node if (ExplorerDnDManager.getDefault().isDnDActive()) { return ; } callSelectionChanged (new Node[0]); } else { // we need to force no changes to nodes hierarchy => // we are requesting read request, but it is not necessary // to execute the next action immediatelly, so postReadRequest // should be enough readAccessPaths = paths; Children.MUTEX.postReadRequest(this); } }
public void valueChanged(TreeSelectionEvent ev) { TreePath[] paths = tree.getSelectionPaths (); storeSelectedPaths = Arrays.asList (paths == null ? new TreePath[0] : paths); if (paths == null) { // part of bugfix #37279, if DnD is active then is useless select a nearby node if (ExplorerDnDManager.getDefault().isDnDActive()) { return ; } callSelectionChanged (new Node[0]); } else { // we need to force no changes to nodes hierarchy => // we are requesting read request, but it is not necessary // to execute the next action immediatelly, so postReadRequest // should be enough readAccessPaths = paths; Children.MUTEX.postReadRequest(this); } }
@Override public void valueChanged(TreeSelectionEvent ev) { TreePath[] paths = tree.getSelectionPaths(); if (paths == null) { // part of bugfix #37279, if DnD is active then is useless select a nearby node if (ExplorerDnDManager.getDefault().isDnDActive()) { return; } callSelectionChanged(new Node[0]); } else { // we need to force no changes to nodes hierarchy => // we are requesting read request, but it is not necessary // to execute the next action immediatelly, so postReadRequest // should be enough readAccessPaths = paths; Children.MUTEX.postReadRequest(this); } }
public void treeNodesRemoved (TreeModelEvent e) { // called to removed from JTree.expandedState super.treeNodesRemoved (e); // part of bugfix #37279, if DnD is active then is useless select a nearby node if (ExplorerDnDManager.getDefault ().isDnDActive ()) { return ; } if (storeSelectedPaths == null || storeSelectedPaths.size () == tree.getSelectionCount ()) { // selection not changed => it's redundant to change selection return ; } if (tree.getSelectionCount () == 0) { TreePath path = findSiblingTreePath (e.getTreePath (), e.getChildIndices ()); // bugfix #39564, don't select again the same object if (path == null || path.equals (e.getTreePath ())) { return ; } else if (path.getPathCount () > 0) { tree.setSelectionPath (path); } } } }
public void treeNodesRemoved (TreeModelEvent e) { // called to removed from JTree.expandedState super.treeNodesRemoved (e); // part of bugfix #37279, if DnD is active then is useless select a nearby node if (ExplorerDnDManager.getDefault ().isDnDActive ()) { return ; } if (storeSelectedPaths == null || storeSelectedPaths.size () == tree.getSelectionCount ()) { // selection not changed => it's redundant to change selection return ; } if (tree.getSelectionCount () == 0) { TreePath path = findSiblingTreePath (e.getTreePath (), e.getChildIndices ()); // bugfix #39564, don't select again the same object if (path == null || path.equals (e.getTreePath ())) { return ; } else if (path.getPathCount () > 0) { tree.setSelectionPath (path); } } } }
@Override public void treeNodesRemoved(TreeModelEvent e) { // called to removed from JTree.expandedState super.treeNodesRemoved(e); boolean wasSelected = removedNodeWasSelected; removedNodeWasSelected = false; // part of bugfix #37279, if DnD is active then is useless select a nearby node if (ExplorerDnDManager.getDefault().isDnDActive()) { return; } if (wasSelected && tree.getSelectionCount() == 0) { TreePath path = findSiblingTreePath(e.getTreePath(), e.getChildIndices()); // bugfix #39564, don't select again the same object if ((path == null) || e.getChildIndices().length == 0) { return; } else if (path.getPathCount() > 0) { tree.setSelectionPath(path); } } } }