Changeset 7633


Ignore:
Timestamp:
2004-06-23T14:35:58+12:00 (20 years ago)
Author:
mdewsnip
Message:

Some function and variable name changes, and added the web cache/downloaded files mapping back in.

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  
    77import org.greenstone.gatherer.file.FileNode;
    88import org.greenstone.gatherer.util.ArrayTools;
     9import org.greenstone.gatherer.util.Utility;
    910
    1011
    1112public class FileSystem
    1213{
    13     static public FileNode getLocalFileSystem(FileSystemModel model)
    14     // static public FileNode getLocalFileSystem()
     14    static public FileNode getLocalFilespaceNode(FileSystemModel model)
    1515    {
    1616    FileNode file_system_root = null;
     
    4646
    4747
    48     static public FileNode getUserHomeMapping()
     48    static public FileNode getHomeFolderNode()
    4949    {
    5050    // Get the name of the OS we're running on
     
    6969    // Generate a special mapping to the user home folder
    7070    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");
    7478    }
    7579}
  • trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTreeModel.java

    r7494 r7633  
    1515    static private WorkspaceTreeModel workspace_tree_model = null;
    1616
    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;
    2020    static private FileNode[] folder_shortcuts = null;
    2121
     
    3333    workspace_tree_model = new WorkspaceTreeModel(workspace_tree_root);
    3434
    35     // Add the Greenstone Collections mapping
    36     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);
    3838
    39     // Add the local filespace
    40     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);
    4242
    43     // Add a mapping to the user home folder
    44     workspace_tree_root.insert(FileSystem.getUserHomeMapping());
     43    // Add the "Home Folder" node
     44    workspace_tree_root.insert(FileSystem.getHomeFolderNode());
    4545
    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    }
    4851
    4952    // Add any folder shortcuts the user has created
     
    5457
    5558
    56     static public void refreshGreenstoneCollectionsMapping()
     59    static public void refreshGreenstoneCollectionsNode()
    5760    {
    58     greenstone_collections_mapping.refresh();
     61    greenstone_collections_node.refresh();
    5962    }
    6063
     
    105108
    106109    // 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);
    109112        super.refresh(new TreePath(child_node.getPath()));
    110113    }
  • trunk/gli/src/org/greenstone/gatherer/gui/tree/WorkspaceTree.java

    r7484 r7633  
    5050        String collect_directory_str = Gatherer.config.gsdl_path + Utility.COL_DIR;
    5151        refreshEveryNodeShowingFolder(collect_directory_str);
    52         WorkspaceTreeModel.refreshGreenstoneCollectionsMapping();
     52        WorkspaceTreeModel.refreshGreenstoneCollectionsNode();
    5353    }
    5454
Note: See TracChangeset for help on using the changeset viewer.