Changeset 5884
- Timestamp:
- 2003-11-19T10:49:27+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/file/FileNode.java
r5860 r5884 2 2 3 3 import java.io.*; 4 import java.util.*; 4 import java.util.ArrayList; 5 import java.util.Enumeration; 5 6 import javax.swing.*; 6 7 import javax.swing.filechooser.*; … … 8 9 import org.greenstone.gatherer.Dictionary; 9 10 import org.greenstone.gatherer.Gatherer; 11 import org.greenstone.gatherer.collection.Collection; 10 12 import org.greenstone.gatherer.file.FileFilter; 11 13 import org.greenstone.gatherer.file.FileSystemModel; … … 23 25 private ArrayList children; 24 26 private boolean children_readonly = true; 27 private boolean current_collection = false; 25 28 private boolean readonly = true; 26 29 private File file; … … 215 218 error.printStackTrace(); 216 219 } 220 } 221 222 /** Is this file node within the currently open collection? */ 223 public boolean isInCurrentCollection() { 224 if(current_collection) { 225 return true; 226 } 227 else { 228 FileNode parent = (FileNode) getParent(); 229 if(parent != null) { 230 return parent.isInCurrentCollection(); 231 } 232 } 233 return false; 217 234 } 218 235 … … 254 271 collection_root.setParent(this); 255 272 collection_root.setModel(model); 273 // One last piece of magic so we can determine the current collection 274 Collection collection = Gatherer.c_man.getCollection(); 275 if(collection != null) { 276 collection_root.setCurrentCollection(cols[i].getName().equals(collection.getName())); 277 } 256 278 children.add(collection_root); 257 279 collection_root = null; … … 330 352 } 331 353 354 public void setCurrentCollection(boolean current_collection) { 355 this.current_collection = current_collection; 356 } 357 332 358 /* private void setChildrenReadOnly(boolean children_readonly) { 333 359 this.children_readonly = children_readonly;
Note:
See TracChangeset
for help on using the changeset viewer.