Changeset 7491
- Timestamp:
- 2004-05-28T16:47:01+12:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer/file
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/file/FileNode.java
r7326 r7491 476 476 } 477 477 478 479 public void refresh() 480 { 481 unmap(); 482 map(); 483 } 484 485 478 486 private class FileEnumeration 479 487 implements Enumeration { -
trunk/gli/src/org/greenstone/gatherer/file/FileQueue.java
r7482 r7491 528 528 // Don't worry about all this for true file move actions. 529 529 if(job.type == FileJob.DELETE) { 530 531 530 // queue all of its children, (both filtered and non-filtered), but for deleting only. Don't queue jobs for a current move event, as they would be queued as part of copying. I have no idea way, per sec, however the children within the origin node are always invalid during deletion (there are several copies of some nodes?!?). I'll check that each child is only added once. 531 ///ystem.err.println("Directory has " + origin_node.getChildCount() + " children."); 532 532 ///ystem.err.println("Directory actually has " + child_list.length + " children."); 533 origin_node.unmap(); 534 origin_node.map(); 535 ///atherer.println("Directory has " + origin_node.getChildCount() + " children."); 536 ///atherer.println("Directory actually has " + child_list.length + " children."); 537 for(int i = 0; i < origin_node.size(); i++) { 538 FileNode child_record = (FileNode) origin_node.get(i); 539 ///atherer.println("Queuing: " + child_record); 540 addJob(job.ID(), job.source, child_record, job.target, destination_node, FileJob.DELETE, job.undo, false, false, position); 541 //if(recycle_folder_record != null) { 542 // recycle_folder_mappings.put(child_record, recycle_folder_record); 543 //} 544 } 533 origin_node.refresh(); 534 ///atherer.println("Directory has " + origin_node.getChildCount() + " children."); 535 ///atherer.println("Directory actually has " + child_list.length + " children."); 536 for(int i = 0; i < origin_node.size(); i++) { 537 FileNode child_record = (FileNode) origin_node.get(i); 538 ///atherer.println("Queuing: " + child_record); 539 addJob(job.ID(), job.source, child_record, job.target, destination_node, FileJob.DELETE, job.undo, false, false, position); 540 //if(recycle_folder_record != null) { 541 // recycle_folder_mappings.put(child_record, recycle_folder_record); 542 //} 543 } 545 544 } 546 545 // Requeue a delete job -after- the children have been dealt with. Remember I've reversed the direction of the queue so sooner is later. Te-he. Also have to remember that we have have followed this path to get here for a move job: Copy Directory -> Queue Child Files -> Delete Directory (must occur after child files) -> Queue Directory. -
trunk/gli/src/org/greenstone/gatherer/file/FileSystemModel.java
r7489 r7491 147 147 // Map and unmap the node to refresh its contents 148 148 FileNode node = (FileNode) path.getLastPathComponent(); 149 node.unmap(); 150 node.map(); 149 node.refresh(); 151 150 152 151 // Fire the appropriate event -
trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTreeModel.java
r7484 r7491 56 56 static public void refreshGreenstoneCollectionsMapping() 57 57 { 58 greenstone_collections_mapping.unmap(); 59 greenstone_collections_mapping.map(); 58 greenstone_collections_mapping.refresh(); 60 59 } 61 60 … … 90 89 91 90 92 public void refresh(TreePath path)93 {94 // If we're not refreshing the whole tree just refresh a certain path95 if (path != null) {96 super.refresh(path);97 }98 99 // Refresh each of the nodes in the workspace tree100 for (int i = 0; i < workspace_tree_root.getChildCount(); i++) {101 FileNode child_node = (FileNode) workspace_tree_root.getChildAt(i);102 super.refresh(new TreePath(child_node.getPath()));103 }104 105 // Refresh the local filespace tree specially (it is not unmapped so not refreshed)106 for (int i = 0; i < local_filespace_mapping.getChildCount(); i++) {107 FileNode child_node = (FileNode) local_filespace_mapping.getChildAt(i);108 super.refresh(new TreePath(child_node.getPath()));109 }110 }111 112 113 91 static private boolean doesArrayContain(Object[] array, Object item) 114 92 {
Note:
See TracChangeset
for help on using the changeset viewer.