Changeset 6146 for trunk


Ignore:
Timestamp:
2003-12-08T14:20:09+13:00 (20 years ago)
Author:
jmt12
Message:

Changed how a collection name appears. It now displays the collection title, followed by the shorter filename in curved brackets. Accomplished this by removing crazy CollectionEntry class

Location:
trunk/gli/src/org/greenstone/gatherer/collection
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/collection/DeleteCollectionPrompt.java

    r6061 r6146  
    6161    extends ModalDialog {
    6262    /** The currently selected collection for deletion. */
    63     private CollectionEntry collection = null;
     63    private BasicCollectionConfiguration collection = null;
    6464    /** The model behind the list. */
    6565    private DefaultListModel list_model = null;
     
    228228            if (config_file != null) {
    229229            BasicCollectionConfiguration config = new BasicCollectionConfiguration(config_file);
    230             if (config != null) {
    231                 CollectionEntry col = new CollectionEntry(collections[i].getName(), config);
    232                 list_model.addElement(col);
     230            if(!config.getName().equals(StaticStrings.EMPTY_STR)) {
     231                list_model.addElement(config);
    233232            }   
    234233            }
     
    263262        if(!list.isSelectionEmpty()) {
    264263        confirmation.setEnabled(true);
    265         collection = (CollectionEntry) list.getSelectedValue();
     264        collection = (BasicCollectionConfiguration) list.getSelectedValue();
    266265        args = new String[5];
    267         args[0] = collection.getTitle();
    268         args[1] = collection.getName();
     266        args[0] = collection.getName();
     267        args[1] = collection.getShortName();
    269268        args[2] = collection.getCreator();
    270269        args[3] = collection.getMaintainer();
     
    308307        ///ystem.err.println("Local Library Found!");
    309308        //Gatherer.g_man.preview_pane.configServer(GSDLSiteConfig.RELEASE_COMMAND + collection.getName());
    310         Gatherer.self.configServer(GSDLSiteConfig.RELEASE_COMMAND + collection.getName());
    311         }
    312 
    313         File delete_me = new File(Utility.getCollectionDir(Gatherer.config.gsdl_path) + collection.getName() + File.separator);
     309        Gatherer.self.configServer(GSDLSiteConfig.RELEASE_COMMAND + collection.getShortName());
     310        }
     311
     312        File delete_me = new File(Utility.getCollectionDir(Gatherer.config.gsdl_path) + collection.getShortName() + File.separator);
    314313        if(Utility.delete(delete_me)) {
    315         if (Gatherer.c_man.getCollection() != null && collection.getName().equals(Gatherer.c_man.getCollection().getName())) {
     314        if (Gatherer.c_man.getCollection() != null && collection.getShortName().equals(Gatherer.c_man.getCollection().getName())) {
    316315            current_coll_deleted = true;
    317316        }
     
    333332    }
    334333    }
    335 
    336     private class CollectionEntry {
    337 
    338     private String name = null;
    339     private BasicCollectionConfiguration config = null;
    340 
    341     public CollectionEntry(String name, BasicCollectionConfiguration config) {
    342         this.name = name;
    343         this.config = config;
    344     }
    345 
    346     public String getName() {
    347         return name;
    348     }
    349 
    350     public String getTitle() {
    351         return config.getName();
    352     }
    353 
    354     public String getCreator() {
    355         return config.getCreator();
    356     }
    357 
    358     public String getDescription() {
    359         return config.getDescription();
    360     }
    361    
    362     public String getMaintainer() {
    363         return config.getMaintainer();
    364     }
    365 
    366     public String toString() {
    367         return name + " - \"" + config.getName() + "\"";       
    368     }
    369     }
    370334}
  • trunk/gli/src/org/greenstone/gatherer/collection/ExportCollectionPrompt.java

    r6089 r6146  
    7474    private CheckList list = null;
    7575    /** The currently selected collection for deletion. */
    76     private CollectionEntry collection = null;
     76    private BasicCollectionConfiguration collection = null;
    7777    /** The model behind the list. */
    7878    private DefaultListModel list_model = null;
     
    283283    }
    284284    for (int i=0; i<num_collections;i++,next_arg++) {
    285         args[next_arg] = ((CollectionEntry)selected_collections.get(i)).getName();
     285        args[next_arg] = ((BasicCollectionConfiguration)selected_collections.get(i)).getShortName();
    286286    }
    287287   
     
    308308        coll_names.append(", ");
    309309        }
    310         coll_names.append(((CollectionEntry)selected_collections.get(i)).getName());
     310        BasicCollectionConfiguration complete_collection = (BasicCollectionConfiguration)selected_collections.get(i);
     311        coll_names.append(complete_collection.getName() + StaticStrings.SPACE_CHAR + StaticStrings.OPEN_PARENTHESIS_CHAR + complete_collection.getShortName() + StaticStrings.CLOSE_PARENTHESIS_CHAR);
     312        complete_collection = null;
    311313    }
    312314   
     
    352354            if (config_file != null) {
    353355            BasicCollectionConfiguration config = new BasicCollectionConfiguration(config_file);
    354             if (config != null) {
    355                 CollectionEntry col = new CollectionEntry(collections[i].getName(), config);
    356                 //list_model.addElement(col);
    357                 all_collections.add(col);
     356            if (!config.getName().equals(StaticStrings.EMPTY_STR)) {
     357                all_collections.add(config);
    358358            }   
     359            config = null;
    359360            }
    360361        }
     
    419420        ok_button.setEnabled(false);
    420421        if(!list.isSelectionEmpty()) {
    421         collection = (CollectionEntry) ((Entry)list.getSelectedValue()).getObject();
     422        collection = (BasicCollectionConfiguration) ((Entry)list.getSelectedValue()).getObject();
    422423        args = new String[5];
    423         args[0] = collection.getTitle();
    424         args[1] = collection.getName();
     424        args[0] = collection.getName();
     425        args[1] = collection.getShortName();
    425426        args[2] = collection.getCreator();
    426427        args[3] = collection.getMaintainer();
     
    520521    }
    521522
    522     private class CollectionEntry {
    523 
    524     private String name = null;
    525     private BasicCollectionConfiguration config = null;
    526 
    527     public CollectionEntry(String name, BasicCollectionConfiguration config) {
    528         this.name = name;
    529         this.config = config;
    530     }
    531 
    532     public String getName() {
    533         return name;
    534     }
    535 
    536     public String getTitle() {
    537         return config.getName();
    538     }
    539 
    540     public String getCreator() {
    541         return config.getCreator();
    542     }
    543 
    544     public String getDescription() {
    545         return config.getDescription();
    546     }
    547    
    548     public String getMaintainer() {
    549         return config.getMaintainer();
    550     }
    551 
    552     public String toString() {
    553         return name + " - \"" + config.getName() + "\"";       
    554     }
    555     }
    556 
    557523    private class ResultDialog
    558524    extends ModalDialog {
Note: See TracChangeset for help on using the changeset viewer.