Ignore:
Timestamp:
2003-12-02T17:18:37+13:00 (20 years ago)
Author:
jmt12
Message:

Extended arguments so they could be given a minimum and maximum range. Then if they are INTEGER type controls, the spinner control generated will honour any range information. Range information is supplied via the perl -xml type mechanism, using the tag form <Range>0,3</Range>

File:
1 edited

Legend:

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

    r5873 r6087  
    311311        case Argument.INTEGER:
    312312        // Build a spinner
    313         JSpinner spinner = new JSpinner();
     313        JSpinner spinner = new JSpinner(new SpinnerNumberModel(0, argument.getMinimum(), argument.getMaximum(), 1));
     314        try {
     315            int default_value = Integer.parseInt(argument.getDefaultValue());
     316            spinner.setValue(new Integer(default_value));
     317        }
     318        catch (Exception exception) {
     319        }
    314320        spinner.setEnabled(enable);
    315321        spinner.setPreferredSize(SPINNER_SIZE);
Note: See TracChangeset for help on using the changeset viewer.