Package org.knime.core.webui.node.dialog
Interface NodeSettingsService
- All Known Implementing Classes:
DefaultNodeSettingsServiceWithVariables
public interface NodeSettingsService
Functionality around
NodeSettings as required by the NodeDialog.
Translates text-based settings (strings) used on the frontend-side from and to the backend-side settings
representation (i.e. NodeSettings).
Also provides default node settings.- Author:
- Martin Horn, KNIME GmbH, Konstanz, Germany, Marc Bux, KNIME GmbH, Berlin, Germany
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidTODO UIEXT-1376 rethink if this method is necessary and if we can avoid the use of singletons here.fromNodeSettings(Map<SettingsType, NodeAndVariableSettingsRO> settings, org.knime.core.node.port.PortObjectSpec[] specs) Called when a dialog is initialized.voidtoNodeSettings(String textSettings, Map<SettingsType, NodeAndVariableSettingsWO> settings) Called when dialog settings are applied.default voidAn optional validation method which is meant to be called beforefromNodeSettings(java.util.Map<org.knime.core.webui.node.dialog.SettingsType, org.knime.core.webui.node.dialog.NodeAndVariableSettingsRO>, org.knime.core.node.port.PortObjectSpec[])in order to adjust the node settings (e.g.
-
Method Details
-
fromNodeSettings
String fromNodeSettings(Map<SettingsType, NodeAndVariableSettingsRO> settings, org.knime.core.node.port.PortObjectSpec[] specs) Called when a dialog is initialized. Infers a single text-based settings representation from possibly multipleNodeAndVariableSettingsRO-instances (one perSettingsType).- Parameters:
settings- the settings to read from; if there are no settings with the node stored, yet, the default node settings will be supplied (see#getDefaultNodeSettings(Map, PortObjectSpec[]))specs- the specs for configuring the settings (includes the flow variable port). NOTE: can containnull-values, e.g., in case an input port is not connected- Returns:
- a new text-based settings representation
-
toNodeSettings
Called when dialog settings are applied. Translates text-based settings toNodeAndVariableSettingsWO-instances of certainSettingsType.- Parameters:
textSettings- the text-based settings objectsettings- the settings instances to write into
-
validateNodeSettingsAndVariables
default void validateNodeSettingsAndVariables(Map<SettingsType, NodeAndVariableSettingsRO> settings) throws org.knime.core.node.InvalidSettingsExceptionAn optional validation method which is meant to be called beforefromNodeSettings(java.util.Map<org.knime.core.webui.node.dialog.SettingsType, org.knime.core.webui.node.dialog.NodeAndVariableSettingsRO>, org.knime.core.node.port.PortObjectSpec[])in order to adjust the node settings (e.g. to not overwrite with flow variables when the overwritten settings do not validate). Per default, there is no validation.- Parameters:
settings- the settings to read from- Throws:
org.knime.core.node.InvalidSettingsException- in case the validation fails
-
deactivate
default void deactivate()TODO UIEXT-1376 rethink if this method is necessary and if we can avoid the use of singletons here. Method called on deactivation of the dialog. TheNodeContextprovides the current node container here.
-