Changeset 8041
- Timestamp:
- 2004-08-24T16:09:45+12:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/file/FileManager.java
r7647 r8041 43 43 import org.greenstone.gatherer.file.FileNode; 44 44 import org.greenstone.gatherer.file.FileQueue; 45 import org.greenstone.gatherer.file.RecycleBin; 45 46 import org.greenstone.gatherer.gui.LongProgressBar; 46 47 import org.greenstone.gatherer.gui.NewFolderPrompt; 47 48 import org.greenstone.gatherer.gui.tree.DragTree; 48 import org.greenstone.gatherer.undo.UndoManager;49 49 import org.greenstone.gatherer.util.DragComponent; 50 50 import org.greenstone.gatherer.util.SynchronizedTreeModelTools; … … 87 87 // If source and target are different 88 88 else { 89 // If target is the UndoManager, we're deleting 90 if(target instanceof UndoManager) { 91 // If the source is the workspace then display an error message. Workspace is read only. 92 93 // ...except for files from the "Downloaded Files" folder 89 // If target is the RecycleBin, we're deleting 90 if (target instanceof RecycleBin) { 91 // The workspace tree is read only. 92 // ... except for files from the "Downloaded Files" folder 94 93 boolean from_downloaded_files_folder = false; 95 94 if (source_nodes != null) { -
trunk/gli/src/org/greenstone/gatherer/file/FileQueue.java
r8022 r8041 39 39 import org.greenstone.gatherer.gui.LongProgressBar; 40 40 import org.greenstone.gatherer.gui.tree.DragTree; 41 import org.greenstone.gatherer.undo.UndoManager;42 41 import org.greenstone.gatherer.util.ArrayTools; 43 42 import org.greenstone.gatherer.util.DragComponent; … … 196 195 * @see org.greenstone.gatherer.file.FileNode 197 196 * @see org.greenstone.gatherer.gui.LongProgressBar 198 * @see org.greenstone.gatherer.undo.UndoManager199 197 * @see org.greenstone.gatherer.util.Utility 200 198 */ … … 373 371 if(job.type == FileJob.COPY) { 374 372 // A copy is undone with a delete, so it doesn't really matter where the file originally came from (we're not moving it back there, but into the recycle bin). You may also notice we don't make use of the target parent record. This is because no undo action needs this information, and even if it did it could simply ask for records parent! 375 Gatherer.c_man.undo.addUndo(job.ID(), UndoManager.FILE_COPY, null, null, job.target, new_record, job.undo);373 // Gatherer.c_man.undo.addUndo(job.ID(), UndoManager.FILE_COPY, null, null, job.target, new_record, job.undo); 376 374 } 377 375 else { 378 376 // Movements however do need a source and source parent so the file can be moved back to the correct place. 379 Gatherer.c_man.undo.addUndo(job.ID(), UndoManager.FILE_MOVE, job.source, (FileNode)origin_node.getParent(), job.target, new_record, job.undo);377 // Gatherer.c_man.undo.addUndo(job.ID(), UndoManager.FILE_MOVE, job.source, (FileNode)origin_node.getParent(), job.target, new_record, job.undo); 380 378 } 381 379 } … … 400 398 if(job.type == FileJob.COPY) { 401 399 // A copy is undone with a delete, so it doesn't really matter where the file originally came from (we're not moving it back there, but into the recycle bin). You may also notice we don't make use of the target parent record. This is because no undo action needs this information, and even if it did it could simply ask for records parent! 402 Gatherer.c_man.undo.addUndo(job.ID(), UndoManager.FILE_COPY, null, null, job.target, directory_record, job.undo);400 // Gatherer.c_man.undo.addUndo(job.ID(), UndoManager.FILE_COPY, null, null, job.target, directory_record, job.undo); 403 401 } 404 402 else { 405 403 // Movements however do need a source and source parent so the file can be moved back to the correct place. 406 Gatherer.c_man.undo.addUndo(job.ID(), UndoManager.FILE_MOVE, job.source, (FileNode)origin_node.getParent(), job.target, directory_record, job.undo);404 // Gatherer.c_man.undo.addUndo(job.ID(), UndoManager.FILE_MOVE, job.source, (FileNode)origin_node.getParent(), job.target, directory_record, job.undo); 407 405 } 408 406 } … … 453 451 } 454 452 // If it came from the recycle bin retrieve the metadata from there, once again remembering to account for inherited metadata 455 else if (job.source.toString().equals("Undo")) {456 // Retrieve metadata from the recycle bin457 ArrayList existing_metadata = Gatherer.c_man.undo.getMetadata(source_file);458 // then assign this remainder to the new folder.459 Gatherer.c_man.getCollection().gdm.addMetadata(new_node, existing_metadata);460 existing_metadata = null;461 }453 // else if (job.source.toString().equals("Undo")) { 454 // // Retrieve metadata from the recycle bin 455 // ArrayList existing_metadata = Gatherer.c_man.undo.getMetadata(source_file); 456 // // then assign this remainder to the new folder. 457 // Gatherer.c_man.getCollection().gdm.addMetadata(new_node, existing_metadata); 458 // existing_metadata = null; 459 // } 462 460 // Otherwise if it came from the workspace use the MSMs parsers to search for folder level metadata (such as metadata.xml or marc records). 463 461 else if (job.source.toString().equals("Workspace")) { … … 497 495 // Remove its metadata 498 496 ArrayList metadatum = null; 499 if(job.source == Gatherer.c_man.undo) {500 Gatherer.c_man.undo.addMetadata(target_file, metadatum);501 }502 else {503 504 497 // if(job.source == Gatherer.c_man.undo) { 498 // Gatherer.c_man.undo.addMetadata(target_file, metadatum); 499 // } 500 // else { 501 metadatum = Gatherer.c_man.getCollection().gdm.removeMetadata(origin_node.getFile()); 502 // } 505 503 // determine its parent node 506 504 FileNode parent_record = (FileNode)origin_node.getParent(); -
trunk/gli/src/org/greenstone/gatherer/gui/GatherPane.java
r7499 r8041 51 51 import org.greenstone.gatherer.file.FileQueue; 52 52 import org.greenstone.gatherer.file.FileSystemModel; 53 import org.greenstone.gatherer.file.RecycleBin; 53 54 import org.greenstone.gatherer.gui.Filter; 54 55 import org.greenstone.gatherer.gui.GComboBox; … … 56 57 import org.greenstone.gatherer.gui.tree.DragTree; 57 58 import org.greenstone.gatherer.gui.tree.WorkspaceTree; 58 import org.greenstone.gatherer.undo.UndoManager;59 59 import org.greenstone.gatherer.util.DragComponent; 60 60 import org.greenstone.gatherer.util.DragGroup; … … 110 110 private TreeSynchronizer collection_tree_sync = null; 111 111 /** The button used to delete files, which also doubles as a drop target for files from the Trees. */ 112 private UndoManagerbin_button = null;112 private RecycleBin bin_button = null; 113 113 /** The default size of a special mapping dialog. */ 114 114 static final Dimension DIALOG_SIZE = new Dimension(400, 120); … … 364 364 JPanel button_pane = new JPanel(); 365 365 366 bin_button = Gatherer.c_man.undo;366 bin_button = new RecycleBin(); 367 367 bin_button.addActionListener(this); 368 368 bin_button.setEnabled(false);
Note:
See TracChangeset
for help on using the changeset viewer.