Search in sources :

Example 1 with NodeDialogPane

use of org.knime.core.node.NodeDialogPane in project knime-core by knime.

the class WorkflowManager method getDialogPaneWithSettings.

/**
 * {@inheritDoc}
 */
@Override
NodeDialogPane getDialogPaneWithSettings(final PortObjectSpec[] inSpecs, final PortObject[] inData) throws NotConfigurableException {
    NodeDialogPane dialogPane = getDialogPane();
    // find all quickform input nodes and update meta dialog
    Map<NodeID, MetaNodeDialogNode> nodes = findNodes(MetaNodeDialogNode.class, false);
    ((MetaNodeDialogPane) dialogPane).setQuickformNodes(nodes);
    NodeSettings settings = getNodeSettings();
    Node.invokeDialogInternalLoad(dialogPane, settings, inSpecs, inData, new FlowObjectStack(getID()), new CredentialsProvider(this, m_credentialsStore), getDirectNCParent().isWriteProtected());
    return dialogPane;
}
Also used : NodeSettings(org.knime.core.node.NodeSettings) MetaNodeDialogNode(org.knime.core.node.dialog.MetaNodeDialogNode) NodeDialogPane(org.knime.core.node.NodeDialogPane)

Example 2 with NodeDialogPane

use of org.knime.core.node.NodeDialogPane in project knime-core by knime.

the class SubNodeContainer method getDialogPaneWithSettings.

/**
 * {@inheritDoc}
 */
@Override
@SuppressWarnings("rawtypes")
NodeDialogPane getDialogPaneWithSettings(final PortObjectSpec[] inSpecs, final PortObject[] inData) throws NotConfigurableException {
    NodeDialogPane dialogPane = getDialogPane();
    // find all dialog nodes and update subnode dialog
    Map<NodeID, MetaNodeDialogNode> nodes = m_wfm.findNodes(MetaNodeDialogNode.class, new NodeModelFilter<MetaNodeDialogNode>() {

        @Override
        public boolean include(final MetaNodeDialogNode nodeModel) {
            return nodeModel instanceof DialogNode && !((DialogNode) nodeModel).isHideInDialog();
        }
    }, false);
    ((MetaNodeDialogPane) dialogPane).setQuickformNodes(nodes);
    NodeSettings settings = new NodeSettings("subnode_settings");
    saveSettings(settings);
    // remove the flow variable port from the specs and data
    PortObjectSpec[] correctedInSpecs = ArrayUtils.remove(inSpecs, 0);
    PortObject[] correctedInData = ArrayUtils.remove(inData, 0);
    // the next call will call dialogPane.internalLoadSettingsFrom()
    // dialogPane is a MetaNodeDialogPane and does not handle the flow variable port correctly
    // this is why we remove it first
    Node.invokeDialogInternalLoad(dialogPane, settings, correctedInSpecs, correctedInData, getFlowObjectStack(), new CredentialsProvider(this, m_wfm.getCredentialsStore()), getParent().isWriteProtected());
    return dialogPane;
}
Also used : DialogNode(org.knime.core.node.dialog.DialogNode) MetaNodeDialogNode(org.knime.core.node.dialog.MetaNodeDialogNode) NodeSettings(org.knime.core.node.NodeSettings) MetaNodeDialogNode(org.knime.core.node.dialog.MetaNodeDialogNode) NodeDialogPane(org.knime.core.node.NodeDialogPane) PortObjectSpec(org.knime.core.node.port.PortObjectSpec) FlowVariablePortObjectSpec(org.knime.core.node.port.flowvariable.FlowVariablePortObjectSpec) InactiveBranchPortObjectSpec(org.knime.core.node.port.inactive.InactiveBranchPortObjectSpec) FlowVariablePortObject(org.knime.core.node.port.flowvariable.FlowVariablePortObject) InactiveBranchPortObject(org.knime.core.node.port.inactive.InactiveBranchPortObject) PortObject(org.knime.core.node.port.PortObject)

Aggregations

NodeDialogPane (org.knime.core.node.NodeDialogPane)2 NodeSettings (org.knime.core.node.NodeSettings)2 MetaNodeDialogNode (org.knime.core.node.dialog.MetaNodeDialogNode)2 DialogNode (org.knime.core.node.dialog.DialogNode)1 PortObject (org.knime.core.node.port.PortObject)1 PortObjectSpec (org.knime.core.node.port.PortObjectSpec)1 FlowVariablePortObject (org.knime.core.node.port.flowvariable.FlowVariablePortObject)1 FlowVariablePortObjectSpec (org.knime.core.node.port.flowvariable.FlowVariablePortObjectSpec)1 InactiveBranchPortObject (org.knime.core.node.port.inactive.InactiveBranchPortObject)1 InactiveBranchPortObjectSpec (org.knime.core.node.port.inactive.InactiveBranchPortObjectSpec)1