[SOLVED] Default value not used?
My operator has an Int parameter for which I set a default value (in the getParameterTypes() method):
But once the operator is instantiated in the GUI, the parameter's edit box remains empty and the GUI displays the problem "The mandatory parameter "exampleset chunk size" is undefined." What am I doing wrong?
type = new ParameterTypeInt(PARAMETER_CHUNK_SIZE,
I18N.getMessage(I18N.getGUIBundle(), "gui.label.rmx_LTFDataReader.parameter.chunk_size.description"), 1, Integer.MAX_VALUE, false);
type.setDefaultValue(IndexCachedLTFExampleTable.DEFAULT_BATCH_SIZE);
types.add(type);
...
0
Answers
-
Hi,
your right. If you use the constructor you have posted setting the default value with setDefaultValue() will not change the default value.
This is indeed a bug that I've just fixed. To avoid the problem with your current version I would recommend you to use the ParameterType declartion this way:
Best,
type = new ParameterTypeInt(PARAMETER_CHUNK_SIZE,
I18N.getMessage(I18N.getGUIBundle(), "gui.label.rmx_LTFDataReader.parameter.chunk_size.description"), 1, Integer.MAX_VALUE, IndexCachedLTFExampleTable.DEFAULT_BATCH_SIZE);
type.setOptional(false);
types.add(type);
Nils0