use of org.knime.core.node.workflow.FlowVariable in project knime-core by knime.
the class VariableLoopEndNodeDialog method loadSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final PortObjectSpec[] specs) throws NotConfigurableException {
FlowVariableFilterConfiguration config = new FlowVariableFilterConfiguration("selection");
Map<String, FlowVariable> variables = getAvailableFlowVariables();
config.loadConfigurationInDialog(settings, variables);
m_selection.loadConfiguration(config, variables);
}
use of org.knime.core.node.workflow.FlowVariable in project knime-core by knime.
the class ParameterizedDBQueryPanel method onSelectionInFlowVariableList.
private void onSelectionInFlowVariableList() {
final FlowVariable selected = m_flowVariablesList.getSelectedValue();
if (selected != null) {
m_editor.replaceSelection(FlowVariableResolver.getPlaceHolderForVariable(selected));
m_flowVariablesList.clearSelection();
m_editor.requestFocus();
}
}
use of org.knime.core.node.workflow.FlowVariable in project knime-core by knime.
the class DBSQLExecutorNodeDialog method loadSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final PortObjectSpec[] specs) throws NotConfigurableException {
m_text.setText(settings.getString(DBSQLExecutorNodeModel.CFG_STATEMENT, ""));
DefaultListModel<FlowVariable> listModel = (DefaultListModel<FlowVariable>) m_variables.getModel();
listModel.removeAllElements();
for (FlowVariable var : getAvailableFlowVariables().values()) {
listModel.addElement(var);
}
}
use of org.knime.core.node.workflow.FlowVariable in project knime-core by knime.
the class SQLInjectNodeDialog method loadAdditionalSettingsFrom.
/**
* List of available string flow variables must be updated since it could
* have changed.
*
* {@inheritDoc}
*/
@Override
public void loadAdditionalSettingsFrom(final NodeSettingsRO settings, final PortObjectSpec[] specs) throws NotConfigurableException {
super.loadAdditionalSettingsFrom(settings, specs);
Map<String, FlowVariable> flowVars = getAvailableFlowVariables();
// check for selected value
String flowVar = "";
try {
flowVar = ((SettingsModelString) m_flowVarSettingsModel.createCloneWithValidatedValue(settings)).getStringValue();
} catch (InvalidSettingsException e) {
LOGGER.debug("Settings model could not be cloned with given settings!");
} finally {
m_flowVarSelection.replaceListItems(flowVars.values(), flowVar);
}
}
use of org.knime.core.node.workflow.FlowVariable in project knime-core by knime.
the class FeatureSelectionLoopEndNodeDialogPane method loadSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final PortObjectSpec[] specs) throws NotConfigurableException {
final FeatureSelectionLoopEndSettings cfg = new FeatureSelectionLoopEndSettings();
cfg.loadInDialog(settings);
final Collection<FlowVariable> flowVars = getAvailableFlowVariables().values();
m_scoreVariableComboBox.removeAllItems();
FlowVariable selected = null;
final String scoreVariableName = cfg.getScoreVariableName();
boolean compatibleFVexists = false;
for (FlowVariable flowVar : flowVars) {
FlowVariable.Type flowvarType = flowVar.getType();
if (flowvarType == FlowVariable.Type.DOUBLE) {
if (flowVar.getName().equals(scoreVariableName)) {
selected = flowVar;
}
m_scoreVariableComboBox.addItem(flowVar);
compatibleFVexists = true;
}
}
if (!compatibleFVexists) {
throw new NotConfigurableException("There is no compatible Flow Variable (Double) at the inport.");
}
m_scoreVariableComboBox.setSelectedItem(selected);
}
Aggregations