Ignore:
Timestamp:
2001-03-16T13:47:02+13:00 (23 years ago)
Author:
say1
Message:

added NzdlPreferences.java and hooked it up in all the necessary places. The PreferencesDialog doesn"t save \(yet\).

Location:
trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient
Files:
2 edited

Legend:

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

    r2144 r2188  
    1 CLASSES = CSFrame.class \
     1CLASSES = PreferencesDialog.class\
     2  CSFrame.class \
    23  CSModel.class\
    34  Constants.class\
  • trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/PreferencesDialog.java

    r2185 r2188  
    3737package org.nzdl.gsdl.SimpleGraphicalClient;
    3838
     39import org.nzdl.gsdl.util.NzdlPreferences;
    3940import javax.swing.*;
    4041import java.awt.*;
     
    6970
    7071    //contentBox.add();
     72    String preferanceName = null;
    7173    // the preferences themselves ...
    7274
    73     JCheckBox showFirstDocCheckBox = new JCheckBox("Automatically display the document contents of the first result", true); //should read initial value from preferences data structure
     75    preferanceName = "Automatically display the first document";
     76    JCheckBox showFirstDocCheckBox =
     77      new JCheckBox(preferanceName, NzdlPreferences.getBoolean(preferanceName));
    7478    showFirstDocCheckBox.setHorizontalAlignment(SwingConstants.LEFT);
    7579
    76     JCheckBox showAsTextCheckBox = new JCheckBox("Always display raw text (don't interpret HTML)", false); //should read initial value from preferences data structure
     80    preferanceName = "Always display raw text (don't interpret HTML)";
     81    JCheckBox showAsTextCheckBox =
     82      new JCheckBox(preferanceName, NzdlPreferences.getBoolean(preferanceName));
    7783    showAsTextCheckBox.setHorizontalAlignment(SwingConstants.LEFT);
    7884
     85    preferanceName = "Connect to multiple servers";
     86    JCheckBox connectToMultipleCheckBox =
     87      new JCheckBox(preferanceName, NzdlPreferences.getBoolean(preferanceName));
     88    connectToMultipleCheckBox.setHorizontalAlignment(SwingConstants.LEFT);
     89
     90    preferanceName = "Log at the NzdlService level";
     91    JCheckBox logNetworkLevelCheckBox =
     92      new JCheckBox(preferanceName, NzdlPreferences.getBoolean(preferanceName));
     93    logNetworkLevelCheckBox.setHorizontalAlignment(SwingConstants.LEFT);
     94
     95    preferanceName = "Cache corba requests";
     96    JCheckBox useCacheCheckBox =
     97      new JCheckBox(preferanceName, NzdlPreferences.getBoolean(preferanceName));
     98    useCacheCheckBox.setHorizontalAlignment(SwingConstants.LEFT);
     99
     100    preferanceName = "Save documents";
     101    JCheckBox saveDocsCheckBox =
     102      new JCheckBox(preferanceName, NzdlPreferences.getBoolean(preferanceName));
     103    saveDocsCheckBox.setHorizontalAlignment(SwingConstants.LEFT);
    79104
    80105
     
    84109    contentBox.add(showFirstDocCheckBox);
    85110    contentBox.add(showAsTextCheckBox);
     111    contentBox.add(connectToMultipleCheckBox);
     112    contentBox.add(logNetworkLevelCheckBox);
     113    contentBox.add(useCacheCheckBox);
     114    contentBox.add(saveDocsCheckBox);
    86115
    87116    okButton = new JButton("Ok");
     
    115144        //System.err.println("ok button pressed!");
    116145
    117         dispose(); //close window
     146      NzdlPreferences.getInstance().save();
     147      dispose(); //close window
    118148    }
    119149    else
Note: See TracChangeset for help on using the changeset viewer.