Skip to content
This repository was archived by the owner on Nov 23, 2023. It is now read-only.

Commit 115a523

Browse files
committed
Save/load count from settings
1 parent 97bff3d commit 115a523

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

src/main/resources/archetype-resources/plugin/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Require-Bundle: org.eclipse.core.runtime,
1414
org.knime.workbench.core,
1515
org.knime.workbench.repository,
1616
org.knime.base,
17-
nl.esciencecenter.e3dchem.python.plugin;bundle-version="[2.0.0,3.0.0)",
17+
nl.esciencecenter.e3dchem.python.plugin;bundle-version="[2.0.1,3.0.0)",
1818
nl.esciencecenter.e3dchem.plugin;bundle-version="[1.0.0,2.0.0)"
1919
Bundle-ActivationPolicy: lazy
2020
Bundle-ClassPath: .

src/main/resources/archetype-resources/plugin/src/java/__node__Dialog.java

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
*/
2323
public 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

Comments
 (0)