Changeset 2274 for trunk/java-client/org


Ignore:
Timestamp:
2001-04-03T22:01:12+12:00 (23 years ago)
Author:
daven
Message:

added integrity checking for boolean/ranked preference

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/SearchPanel.java

    r2273 r2274  
    142142    searchTextFieldPanel.add(searchTextField);
    143143
    144 
     144    //NzdlPreferences prefs = NzdlPreferences.getInstance();
    145145    String queryType = NzdlConstants.DEFAULT_QUERY_TYPE;
    146     System.err.println("default queryType = " + queryType);
    147146    if (NzdlPreferences.getInstance().isString(NzdlConstants.QUERYTYPE)) {
    148147    queryType = NzdlPreferences.getInstance().getString(NzdlConstants.QUERYTYPE);
    149148    }
    150     System.err.println("queryType = " + queryType);
     149    System.err.println(queryType);
     150    // check integrity of queryType
     151    if (!((queryType.equals(NzdlConstants.RANKED_STRING)) | (queryType.equals(NzdlConstants.BOOLEAN_STRING))))
     152    // preferences may have been corrupted!
     153    queryType = NzdlConstants.DEFAULT_QUERY_TYPE;
    151154    boolean stemming = NzdlConstants.DEFAULT_STEMMING;
    152155    if (NzdlPreferences.getInstance().isBoolean(NzdlConstants.STEMMING))
     
    160163    queryTypePanel = new JPanel();
    161164    queryTypePanel.setLayout(new GridLayout(2,1));
    162     rankedRadioButton = new JRadioButton("ranked");
    163     rankedRadioButton.setActionCommand(rankedRadioButton.getText());
     165    rankedRadioButton = new JRadioButton(NzdlConstants.RANKED_STRING);
     166    rankedRadioButton.setActionCommand(NzdlConstants.RANKED_STRING);
    164167    rankedRadioButton.setSelected(queryType.equals(rankedRadioButton.getText()));
    165168    rankedRadioButton.setToolTipText("Display results in a ranked list");
    166169   
    167     booleanRadioButton = new JRadioButton("boolean");
    168     booleanRadioButton.setActionCommand(booleanRadioButton.getText());
     170    booleanRadioButton = new JRadioButton(NzdlConstants.BOOLEAN_STRING);
     171    booleanRadioButton.setActionCommand(NzdlConstants.BOOLEAN_STRING);
    169172    booleanRadioButton.setSelected(queryType.equals(booleanRadioButton.getText()));
    170173    booleanRadioButton.setToolTipText("Allows the use of Boolean operators: AND(&) OR(|) and NOT(!)");
Note: See TracChangeset for help on using the changeset viewer.