Search in sources :

Example 1 with EditorUISettingsDialog

use of org.knime.workbench.editor2.EditorUISettingsDialog in project knime-core by knime.

the class ChangeEditorUIAction method runOnNodes.

/**
 * {@inheritDoc}
 */
@Override
public void runOnNodes(final NodeContainerEditPart[] nodeParts) {
    EditorUISettingsDialog dlg = new EditorUISettingsDialog(Display.getCurrent().getActiveShell(), getEditor().getCurrentEditorSettings());
    if (dlg.open() == Window.OK) {
        // store settings with the workflow (workflow is marked dirty)
        getEditor().markDirty();
        getEditor().applyEditorSettings(dlg.getSettings());
        getEditor().getWorkflowManager().get().setEditorUIInformation(dlg.getSettings());
        // refresh workflow editor
        // TODO this doesn't work - it doesn't refresh the ConnectionContainerEditParts
        // WorkflowRootEditPart editorPart = (WorkflowRootEditPart)
        // provider.getRootEditPart().getChildren().get(0);
        // editorPart.refresh();
        // workaround to refresh all connection container edit parts
        getEditor().getWorkflowManager().get().getConnectionContainers().forEach(cc -> cc.setUIInfo(cc.getUIInfo()));
    }
}
Also used : EditorUISettingsDialog(org.knime.workbench.editor2.EditorUISettingsDialog)

Aggregations

EditorUISettingsDialog (org.knime.workbench.editor2.EditorUISettingsDialog)1