Ignore:
Timestamp:
2005-02-22T15:40:26+13:00 (19 years ago)
Author:
kjdon
Message:

a colleciton now has build_options and import_options instead of just one

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/OptionsPane.java

    r9045 r9137  
    4949import org.greenstone.gatherer.Gatherer;
    5050import org.greenstone.gatherer.cdm.Argument;
    51 import org.greenstone.gatherer.collection.BuildOptions;
     51import org.greenstone.gatherer.collection.ScriptOptions;
    5252import org.greenstone.gatherer.collection.Collection;
    5353import org.greenstone.gatherer.collection.CollectionManager;
     
    8383    private ArrayList current_controls;
    8484
    85     /** The <strong>BuildOptions</strong> data object contains all the option settings we wish to persist between Gatherer sessions (and thus is stored in <strong>Collection</strong>). */
    86     private BuildOptions build_options = null;
     85    /** The <strong>ScriptOptions</strong> data object contains all the option settings we wish to persist between Gatherer sessions (and thus is stored in <strong>Collection</strong>). */
     86    private ScriptOptions build_options = null;
     87    private ScriptOptions import_options = null;
    8788
    8889    private FileEntry file_entry = null;
     
    9697
    9798    /** The default constructor creates the few session length options, but either retrieves the rest from the current collection, or creates a default set of options. */
    98     public OptionsPane(BuildOptions build_options) {
     99    public OptionsPane(ScriptOptions import_options, ScriptOptions build_options) {
    99100    this.build_options = build_options;
     101    this.import_options = import_options;
    100102    this.current_controls = new ArrayList();
    101103    this.writing_documents = new Vector();
     
    127129    ArrayList build_arguments = new ArrayList();
    128130    int current_mode = Configuration.getMode();
    129     int total_build_argument_count = build_options.getBuildArgumentCount();       
     131    int total_build_argument_count = build_options.getArgumentCount();
     132       
    130133    for(int i = 0; i < total_build_argument_count; i++) {
    131134        // Retrieve the argument so we know how to format the control.
    132         Argument argument = build_options.getBuildArgument(i);
     135        Argument argument = build_options.getArgument(i);
    133136        if(!argument.isHiddenGLI() && argument.getModeLevel() <= current_mode) {
    134137        // Now attempt to retrieve any existing value for this argument.
    135         boolean enabled = build_options.getBuildValueEnabled(argument.getName());
    136         String value = build_options.getBuildValue(argument.getName());
     138        boolean enabled = build_options.getValueEnabled(argument.getName());
     139        String value = build_options.getValue(argument.getName());
    137140        ArgumentControl argument_control = new ArgumentControl(BUILD, argument, enabled, value);
    138141        build_arguments.add(argument_control);
     
    187190    ArrayList import_arguments = new ArrayList();
    188191    int current_mode = Configuration.getMode();
    189     int total_import_argument_count = build_options.getImportArgumentCount();       
     192    int total_import_argument_count = import_options.getArgumentCount();       
    190193    for(int i = 0; i < total_import_argument_count; i++) {
    191194        // Retrieve the argument so we know how to format the control.
    192         Argument argument = build_options.getImportArgument(i);
     195        Argument argument = import_options.getArgument(i);
    193196        if(!argument.isHiddenGLI() && argument.getModeLevel() <= current_mode) {
    194197        // Now attempt to retrieve any existing value for this argument.
    195         boolean enabled = build_options.getImportValueEnabled(argument.getName());
    196         String value = build_options.getImportValue(argument.getName());
     198        boolean enabled = import_options.getValueEnabled(argument.getName());
     199        String value = import_options.getValue(argument.getName());
    197200        ArgumentControl argument_control = new ArgumentControl(IMPORT, argument, enabled, value);
    198201        import_arguments.add(argument_control);
     
    573576        if(!enable && value == null) {
    574577        if(type == BUILD) {
    575             build_options.removeBuildValue(name);
     578            build_options.removeValue(name);
    576579        }
    577580        else {
    578             build_options.removeImportValue(name);
     581            import_options.removeValue(name);
    579582        }
    580583        }
     
    582585        else {
    583586        if(type == BUILD) {
    584             build_options.setBuildValue(name, enable, value);
     587            build_options.setValue(name, enable, value);
    585588        }
    586589        else {
    587             build_options.setImportValue(name, enable, value);
     590            import_options.setValue(name, enable, value);
    588591        }
    589592        }
Note: See TracChangeset for help on using the changeset viewer.