Changeset 10528


Ignore:
Timestamp:
2005-08-19T11:34:33+12:00 (19 years ago)
Author:
kjdon
Message:

changed isMGPPEnabled to isSearchTypeEnabled, added isMGPP() and isLucene() - need to differentiate between the two so that when you preview a lucene collection you get the args right

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/SearchTypeManager.java

    r10237 r10528  
    5454    static final private Dimension LABEL_SIZE = new Dimension(150, 25);
    5555
     56    static final public String BUILD_TYPE_LUCENE = "lucene";
     57    static final public String BUILD_TYPE_MGPP = "mgpp";
     58   
    5659    static final public String[] SEARCH_TYPES = {  "plain" , "form"};
    57     static final public String[] BUILD_TYPES = {  "lucene", "mgpp" };
     60    static final public String[] BUILD_TYPES = {  BUILD_TYPE_LUCENE, BUILD_TYPE_MGPP };
    5861   
    5962    /** the buildtype element in the config file  - searchtypemanager looks
     
    105108     * @return true if MGPP is enabled, false otherwise
    106109     */
    107     public boolean isMGPPEnabled() {
     110    public boolean isSearchTypeEnabled() {
    108111    return root.getAttribute(CollectionConfiguration.ASSIGNED_ATTRIBUTE).equals(CollectionConfiguration.TRUE_STR);
     112    }
     113   
     114    public boolean isMGPP() {
     115    return isSearchTypeEnabled() && build_type.getValue(CollectionMeta.TEXT).equals(BUILD_TYPE_MGPP);
     116    }
     117
     118    public boolean isLucene() {
     119    return isSearchTypeEnabled() && build_type.getValue(CollectionMeta.TEXT).equals(BUILD_TYPE_LUCENE);
    109120    }
    110121   
     
    212223        } else {
    213224        build_type.setValue((String)build_type_combobox.getSelectedItem());
    214         build_type.setAssigned(isMGPPEnabled());
     225        build_type.setAssigned(isSearchTypeEnabled());
    215226
    216227        }
     
    340351    public void gainFocus() {
    341352        instructions_textarea.setCaretPosition(0);
    342         validateControls(isMGPPEnabled());
     353        validateControls(isSearchTypeEnabled());
    343354    }
    344355
Note: See TracChangeset for help on using the changeset viewer.