use of org.knime.core.node.interactive.DefaultReexecutionCallback in project knime-core by knime.
the class InteractiveHiLiteCollectorNodeView method appendAnnotation.
private void appendAnnotation(final String anno, final boolean newColumn) {
if (anno != null && !anno.isEmpty()) {
getNodeModel().appendAnnotation(anno, newColumn);
// FIXME: Put annotation map in view content
triggerReExecution(new InteractiveHiLiteCollectorViewContent(), false, new DefaultReexecutionCallback());
}
}
use of org.knime.core.node.interactive.DefaultReexecutionCallback in project knime-core by knime.
the class AbstractWizardNodeView method applyTriggered.
/**
* @param useAsDefault true if changed values are supposed to be applied as new node default, false otherwise
* @return true if apply was successful, false otherwise
* @since 3.4
*/
protected boolean applyTriggered(final boolean useAsDefault) {
if (!viewInteractionPossible() || !checkSettingsChanged()) {
return true;
}
boolean valid = validateCurrentValueInView();
if (valid) {
String jsonString = retrieveCurrentValueFromView();
try {
VAL viewValue = getModel().createEmptyViewValue();
viewValue.loadFromStream(new ByteArrayInputStream(jsonString.getBytes(Charset.forName("UTF-8"))));
setLastRetrievedValue(viewValue);
ValidationError error = getModel().validateViewValue(viewValue);
if (error != null) {
showValidationErrorInView(error.getError());
return false;
}
if (getModel() instanceof NodeModel) {
triggerReExecution(viewValue, useAsDefault, new DefaultReexecutionCallback());
} else {
getModel().loadViewValue(viewValue, useAsDefault);
}
return true;
} catch (Exception e) {
LOGGER.error("Could not set error message or trigger re-execution: " + e.getMessage(), e);
return false;
}
} else {
return false;
}
}
Aggregations