Changeset 7633
- Timestamp:
- 2004-06-23T14:35:58+12:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/file/FileSystem.java
r7112 r7633 7 7 import org.greenstone.gatherer.file.FileNode; 8 8 import org.greenstone.gatherer.util.ArrayTools; 9 import org.greenstone.gatherer.util.Utility; 9 10 10 11 11 12 public class FileSystem 12 13 { 13 static public FileNode getLocalFileSystem(FileSystemModel model) 14 // static public FileNode getLocalFileSystem() 14 static public FileNode getLocalFilespaceNode(FileSystemModel model) 15 15 { 16 16 FileNode file_system_root = null; … … 46 46 47 47 48 static public FileNode get UserHomeMapping()48 static public FileNode getHomeFolderNode() 49 49 { 50 50 // Get the name of the OS we're running on … … 69 69 // Generate a special mapping to the user home folder 70 70 File home_folder = new File(home_folder_str); 71 String[] args = new String[1]; 72 args[0] = home_folder.getName(); 73 return new FileNode(home_folder, Dictionary.get("Tree.Home", args)); 71 return new FileNode(home_folder, Dictionary.get("Tree.Home", home_folder.getName())); 72 } 73 74 75 static public FileNode getDownloadedFilesNode() 76 { 77 return new FileNode(Utility.getCacheDir(), "Downloaded Files"); 74 78 } 75 79 } -
trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTreeModel.java
r7494 r7633 15 15 static private WorkspaceTreeModel workspace_tree_model = null; 16 16 17 static private FileNode greenstone_collections_ mapping= null;18 static private FileNode local_filespace_ mapping= null;19 // static private FileNode web_cache_mapping= null;17 static private FileNode greenstone_collections_node = null; 18 static private FileNode local_filespace_node = null; 19 static private FileNode downloaded_files_node = null; 20 20 static private FileNode[] folder_shortcuts = null; 21 21 … … 33 33 workspace_tree_model = new WorkspaceTreeModel(workspace_tree_root); 34 34 35 // Add the Greenstone Collections mapping36 greenstone_collections_ mapping= CollectionManager.getGreenstoneCollectionsMapping();37 workspace_tree_root.insert(greenstone_collections_ mapping);35 // Add the "Documents in Greenstone Collections" node 36 greenstone_collections_node = CollectionManager.getGreenstoneCollectionsMapping(); 37 workspace_tree_root.insert(greenstone_collections_node); 38 38 39 // Add the local filespace40 local_filespace_ mapping = FileSystem.getLocalFileSystem(workspace_tree_model);41 workspace_tree_root.insert(local_filespace_ mapping);39 // Add the "Local Filespace" node 40 local_filespace_node = FileSystem.getLocalFilespaceNode(workspace_tree_model); 41 workspace_tree_root.insert(local_filespace_node); 42 42 43 // Add a mapping to the user home folder44 workspace_tree_root.insert(FileSystem.get UserHomeMapping());43 // Add the "Home Folder" node 44 workspace_tree_root.insert(FileSystem.getHomeFolderNode()); 45 45 46 // Add public and private web caches if applicable 47 // loadWebCacheMappings(); 46 // Add the "Downloaded Files" node, if Mirroring is enabled 47 if (Gatherer.g_man.mirror_pane != null) { 48 downloaded_files_node = FileSystem.getDownloadedFilesNode(); 49 workspace_tree_root.insert(downloaded_files_node); 50 } 48 51 49 52 // Add any folder shortcuts the user has created … … 54 57 55 58 56 static public void refreshGreenstoneCollections Mapping()59 static public void refreshGreenstoneCollectionsNode() 57 60 { 58 greenstone_collections_ mapping.refresh();61 greenstone_collections_node.refresh(); 59 62 } 60 63 … … 105 108 106 109 // Refresh the local filespace tree specially (it is not unmapped so not refreshed) 107 for (int i = 0; i < local_filespace_ mapping.getChildCount(); i++) {108 FileNode child_node = (FileNode) local_filespace_ mapping.getChildAt(i);110 for (int i = 0; i < local_filespace_node.getChildCount(); i++) { 111 FileNode child_node = (FileNode) local_filespace_node.getChildAt(i); 109 112 super.refresh(new TreePath(child_node.getPath())); 110 113 } -
trunk/gli/src/org/greenstone/gatherer/gui/tree/WorkspaceTree.java
r7484 r7633 50 50 String collect_directory_str = Gatherer.config.gsdl_path + Utility.COL_DIR; 51 51 refreshEveryNodeShowingFolder(collect_directory_str); 52 WorkspaceTreeModel.refreshGreenstoneCollections Mapping();52 WorkspaceTreeModel.refreshGreenstoneCollectionsNode(); 53 53 } 54 54
Note:
See TracChangeset
for help on using the changeset viewer.