Changeset 4378 for trunk/gli/src/org/greenstone/gatherer/gui/tree
- Timestamp:
- 2003-05-28T11:19:56+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/tree/DragTree.java
r4366 r4378 191 191 setSelectionPath(path); 192 192 } 193 if (!isValidDrag()) { 194 return; 195 } 193 196 // Now update the selection stored as far as the group is concerned. 194 197 group.setSelection(getSelectionPaths()); … … 575 578 Gatherer.g_man.menu_bar.setMetaAuditSuffix(getSelectionDetails()); 576 579 } 580 581 /** returns false for dummy nodes (ones without files), and system root 582 * nodes */ 583 private boolean isValidDrag() { 584 //because you cant select nodes that are children of another selection, and we use a contiguous selection model, we just test the first selection path 585 TreePath node_path = getSelectionPath(); 586 FileNode node = (FileNode) node_path.getLastPathComponent(); 587 588 if (node.getFile() == null) { 589 return false; 590 } 591 if (node.isFileSystemRoot()) { 592 return false; 593 } 594 return true; 595 } 577 596 578 597 private boolean isValidDrop(TreePath target_path) { … … 580 599 if(target_path != null) { 581 600 FileNode target_node = (FileNode) target_path.getLastPathComponent(); 582 601 // We can only continue testing if the node is a folder. 583 602 if(!target_node.isLeaf()) { 584 603 // Now we check if the node is readonly.
Note:
See TracChangeset
for help on using the changeset viewer.