2222 */
2323public class $ {node }Dialog extends DefaultNodeSettingsPane {
2424 private PythonOptionsPanel <$ {node }Config > pythonOptions ;
25+ $ {node }Config config ;
2526
2627 /**
2728 * New pane for configuring ${node} node dialog.
@@ -30,7 +31,7 @@ public class ${node}Dialog extends DefaultNodeSettingsPane {
3031 */
3132 protected $ {node }Dialog () {
3233 super ();
33- $ { node } Config config = new $ {node }Config ();
34+ config = new $ {node }Config ();
3435
3536 SettingsModelIntegerBounded count = config .getCount ();
3637 addDialogComponent (new DialogComponentNumber (count , "Counter" , 1 , 5 ));
@@ -43,33 +44,22 @@ public class ${node}Dialog extends DefaultNodeSettingsPane {
4344 public void loadAdditionalSettingsFrom (NodeSettingsRO settings , PortObjectSpec [] specs )
4445 throws NotConfigurableException {
4546 super .loadAdditionalSettingsFrom (settings , specs );
46- $ {node }Config config = new $ {node }Config ();
47- try {
48- config .loadFrom (settings );
49- } catch (InvalidSettingsException e ) {
50- throw new NotConfigurableException ("Unable to load" , e );
51- }
47+ config .loadFromInDialog (settings );
5248 pythonOptions .loadSettingsFrom (config );
5349 }
5450
5551 @ Override
5652 public void loadAdditionalSettingsFrom (NodeSettingsRO settings , DataTableSpec [] specs )
5753 throws NotConfigurableException {
5854 super .loadAdditionalSettingsFrom (settings , specs );
59- $ {node }Config config = new $ {node }Config ();
60- try {
61- config .loadFrom (settings );
62- } catch (InvalidSettingsException e ) {
63- throw new NotConfigurableException ("Unable to load" , e );
64- }
55+ config .loadFromInDialog (settings );
6556 pythonOptions .loadSettingsFrom (config );
6657 }
6758
6859 @ Override
6960 public void saveAdditionalSettingsTo (NodeSettingsWO settings ) throws InvalidSettingsException {
7061 super .saveAdditionalSettingsTo (settings );
71- $ {node }Config config = new $ {node }Config ();
7262 pythonOptions .saveSettingsTo (config );
73- config .saveTo (settings );
63+ config .saveToInDialog (settings );
7464 }
7565}
0 commit comments