Changeset 9458
- Timestamp:
- 2005-03-17T12:11:44+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTreeNode.java
r9045 r9458 98 98 { 99 99 // Special Case: "Documents in Greenstone Collections" -- map the collections installed in Greenstone 100 if (file == null && title.equals(Dictionary.get("Tree.World"))) { 101 // If this node has already been mapped, don't bother doing it again 100 if (file == null) { // a special mapping folder 102 101 if (child_nodes != null) { 102 // don't bother mapping again if we already have children 103 103 return; 104 104 } 105 105 child_nodes = new ArrayList(); 106 107 if (Gatherer.GS3) { 106 if (title.equals(Dictionary.get("Tree.World")) && Gatherer.GS3) { 108 107 // the Greenstone collections folder for GS3 - this contains a 109 108 // folder for each site 109 110 110 File start = new File(Utility.getSitesDir(Configuration.gsdl3_path)); 111 111 File sites[] = start.listFiles(); … … 119 119 WorkspaceTreeNode child = new WorkspaceTreeNode(null, sites[i].getName()); 120 120 child.is_gs3_site_node = true; 121 child.unmap(); 121 122 child.setModel(model); 122 123 child.setParent(this); 124 child.map(); 123 125 child_nodes.add(child); 124 126 } 125 } 126 else { 127 model.nodeStructureChanged(this); 128 129 } else if (title.equals(Dictionary.get("Tree.World")) || is_gs3_site_node) { 127 130 // For each of the children directories, which are collections... 128 131 File start; … … 159 162 model.nodeStructureChanged(this); 160 163 } 161 } 162 163 // Special Case: "Local Filespace" on Windows -- create a node for each filesystem root (drive letter) 164 else if (file == null && title.equals(Dictionary.get("Tree.Root"))) { 165 // If this node has already been mapped, don't bother doing it again 166 if (child_nodes != null) { 167 return; 168 } 169 child_nodes = new ArrayList(); 170 171 // Sort the roots into alphabetical order 172 File[] roots = File.listRoots(); 173 ArrayTools.sort(roots); 174 for (int i = 0; i < roots.length; i++) { 175 // Only add root if it isn't a floppy drive 176 if (!FileSystemView.getFileSystemView().isFloppyDrive(roots[i])) { 177 child_nodes.add(addChildNode(roots[i])); 164 else if (title.equals(Dictionary.get("Tree.Root"))) { 165 // Special Case: "Local Filespace" on Windows -- create a node for each filesystem root (drive letter) 166 167 // Sort the roots into alphabetical order 168 File[] roots = File.listRoots(); 169 ArrayTools.sort(roots); 170 for (int i = 0; i < roots.length; i++) { 171 // Only add root if it isn't a floppy drive 172 if (!FileSystemView.getFileSystemView().isFloppyDrive(roots[i])) { 173 child_nodes.add(addChildNode(roots[i])); 174 } 178 175 } 179 176 } 180 } 181 177 } // if file == null 178 182 179 // General case 183 180 else { … … 195 192 return super.toString(); 196 193 } 194 197 195 }
Note:
See TracChangeset
for help on using the changeset viewer.