Changeset 7484 for trunk/gli/src/org/greenstone/gatherer/gui/tree
- Timestamp:
- 2004-05-28T13:41:13+12:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer/gui/tree
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/tree/DragTree.java
r6249 r7484 58 58 static private final int AUTOSCROLL_MARGIN = 12; 59 59 60 static public int LIBRARY_CONTENTS_CHANGED= 0;60 static public int TREE_DISPLAY_CHANGED = 0; 61 61 static public int LOADED_COLLECTION_CHANGED = 1; 62 62 static public int COLLECTION_CONTENTS_CHANGED = 2; 63 static public int TREE_DISPLAY_CHANGED = 3;64 63 65 64 -
trunk/gli/src/org/greenstone/gatherer/gui/tree/WorkspaceTree.java
r7482 r7484 6 6 import org.greenstone.gatherer.Gatherer; 7 7 import org.greenstone.gatherer.file.FileNode; 8 import org.greenstone.gatherer.file.FileSystemModel;9 8 import org.greenstone.gatherer.file.WorkspaceTreeModel; 10 9 import org.greenstone.gatherer.util.Utility; … … 14 13 extends DragTree { 15 14 16 static public int MAPPED_DIRECTORIES_CHANGED = 11; 15 static public int LIBRARY_CONTENTS_CHANGED = 10; 16 static public int FOLDER_SHORTCUTS_CHANGED = 11; 17 17 18 18 … … 27 27 Gatherer.println("WorkspaceTree::refresh()... "); 28 28 29 // The collections in the library have changed - refresh the collect directory 30 if (refresh_reason == DragTree.LIBRARY_CONTENTS_CHANGED) { 31 Gatherer.println("...Reason: library contents changed."); 32 String collect_directory_str = Gatherer.config.gsdl_path + Utility.COL_DIR; 33 refreshEveryNodeShowingFolder(collect_directory_str); 34 WorkspaceTreeModel.refreshGreenstoneCollectionsMapping(); 35 } 29 // The method for displaying the tree has changed - redraw the tree 30 if (refresh_reason == DragTree.TREE_DISPLAY_CHANGED) { 31 Gatherer.println("...Reason: tree display changed."); 32 updateUI(); 33 } 36 34 37 // A collection has been opened/closed - reload the whole shebang35 // The loaded collection has changed - currently do nothing 38 36 if (refresh_reason == DragTree.LOADED_COLLECTION_CHANGED) { 39 37 Gatherer.println("...Reason: loaded collection changed."); 40 setModel(WorkspaceTreeModel.getWorkspaceTreeModel());41 38 } 42 39 … … 48 45 } 49 46 50 // The method for displaying the tree has changed - redraw the tree 51 if (refresh_reason == DragTree.TREE_DISPLAY_CHANGED) { 52 Gatherer.println("...Reason: tree display changed."); 53 updateUI(); 54 } 47 // The collections in the library have changed - refresh the collect directory 48 if (refresh_reason == WorkspaceTree.LIBRARY_CONTENTS_CHANGED) { 49 Gatherer.println("...Reason: library contents changed."); 50 String collect_directory_str = Gatherer.config.gsdl_path + Utility.COL_DIR; 51 refreshEveryNodeShowingFolder(collect_directory_str); 52 WorkspaceTreeModel.refreshGreenstoneCollectionsMapping(); 53 } 55 54 56 // The collection specific mapped directories have changed - refresh only them 57 if (refresh_reason == WorkspaceTree.MAPPED_DIRECTORIES_CHANGED) { 58 Gatherer.println("...Reason: mapped directories changed."); 59 WorkspaceTreeModel.refreshWebCacheMappings(); 60 WorkspaceTreeModel.refreshCollectionSpecificMappings(); 61 updateUI(); 55 // The folder shortcuts have changed - refresh only them 56 if (refresh_reason == WorkspaceTree.FOLDER_SHORTCUTS_CHANGED) { 57 Gatherer.println("...Reason: folder shortcuts changed."); 58 WorkspaceTreeModel.refreshFolderShortcuts(); 62 59 } 63 60 } … … 87 84 if (tree_node_path_str.equals(folder_path_str)) { 88 85 System.err.println("Must refresh node " + tree_node_path_str + "!"); 89 (( FileSystemModel) getModel()).refresh(expanded_tree_path);86 ((WorkspaceTreeModel) getModel()).refresh(expanded_tree_path); 90 87 } 91 88 }
Note:
See TracChangeset
for help on using the changeset viewer.