Search in sources :

Example 1 with ConfigEditTreeNode

use of org.knime.core.node.config.ConfigEditTreeModel.ConfigEditTreeNode in project knime-core by knime.

the class ConfigEditTreeRenderer method setValue.

/**
 * Called whenever a new value is to be renderer, updates underlying
 * component.
 * @param tree The associated tree (get the flow object stack from.)
 * @param value to be renderer, typically a <code>ConfigEditTreeNode</code>
 */
public void setValue(final JTree tree, final Object value) {
    ConfigEditTreeNode node;
    if (value instanceof ConfigEditTreeNode) {
        node = (ConfigEditTreeNode) value;
        m_active = node.isLeaf() ? m_panelFull : m_panelPlain;
    } else {
        node = null;
        m_active = m_panelPlain;
    }
    FlowObjectStack stack = null;
    if (tree instanceof ConfigEditJTree) {
        stack = ((ConfigEditJTree) tree).getFlowObjectStack();
    }
    m_active.setFlowObjectStack(stack);
    m_active.setTreeNode(node);
    setLeafIcon(m_active.getIcon());
    setOpenIcon(m_active.getIcon());
    setClosedIcon(m_active.getIcon());
    setToolTipText(m_active.getToolTipText());
}
Also used : ConfigEditTreeNode(org.knime.core.node.config.ConfigEditTreeModel.ConfigEditTreeNode) FlowObjectStack(org.knime.core.node.workflow.FlowObjectStack)

Example 2 with ConfigEditTreeNode

use of org.knime.core.node.config.ConfigEditTreeModel.ConfigEditTreeNode in project knime-core by knime.

the class ConfigEditTreeRenderer method setValue.

/**
 * Called whenever a new value is to be renderer, updates underlying component.
 *
 * @param tree The associated tree (get the flow object stack from.)
 * @param value to be renderer, typically a <code>ConfigEditTreeNode</code>
 * @param nodeDepth the depth of this node in the tree
 * @since 4.2
 */
public void setValue(final JTree tree, final Object value, final int nodeDepth) {
    final ConfigEditTreeNode node;
    if (value instanceof ConfigEditTreeNode) {
        node = (ConfigEditTreeNode) value;
        m_active = node.isLeaf() ? m_panelFull : m_panelPlain;
    } else {
        node = null;
        m_active = m_panelPlain;
    }
    FlowObjectStack stack = null;
    if (tree instanceof ConfigEditJTree) {
        stack = ((ConfigEditJTree) tree).getFlowObjectStack();
    }
    m_active.setFlowObjectStack(stack);
    m_active.setTreeNode(node);
    m_active.setTreePathDepth(nodeDepth);
    setLeafIcon(m_active.getIcon());
    setOpenIcon(m_active.getIcon());
    setClosedIcon(m_active.getIcon());
    setToolTipText(m_active.getToolTipText());
}
Also used : ConfigEditTreeNode(org.knime.core.node.config.ConfigEditTreeModel.ConfigEditTreeNode) FlowObjectStack(org.knime.core.node.workflow.FlowObjectStack)

Example 3 with ConfigEditTreeNode

use of org.knime.core.node.config.ConfigEditTreeModel.ConfigEditTreeNode in project knime-core by knime.

the class NodeDialogPane method initFlowVariablesTab.

/**
 * Sets the settings from the second argument into the flow variables tab. The parameter tree is supposed to follow
 * the node settings argument.
 *
 * @param nodeSettings The (user) settings of the node.
 * @param variableSettings The flow variable settings.
 */
private void initFlowVariablesTab(final NodeSettingsRO nodeSettings, final NodeSettingsRO viewSettings, final NodeSettingsRO variableSettings, final NodeSettingsRO viewVariableSettings) {
    m_flowVariableTab.setErrorLabel("");
    m_flowVariableTab.setVariableSettings(nodeSettings, viewSettings, variableSettings, viewVariableSettings, m_flowObjectStack, Collections.emptySet());
    for (final FlowVariableModel m : m_flowVariablesModelList) {
        final ConfigEditTreeNode configNode = m_flowVariableTab.findTreeNodeForChild(m.getKeys());
        if (configNode != null) {
            m.setInputVariableName(configNode.getUseVariableName());
            m.setOutputVariableName(configNode.getExposeVariableName());
        }
    }
    m_flowVariablesModelChanged = false;
}
Also used : ConfigEditTreeNode(org.knime.core.node.config.ConfigEditTreeModel.ConfigEditTreeNode)

Aggregations

ConfigEditTreeNode (org.knime.core.node.config.ConfigEditTreeModel.ConfigEditTreeNode)3 FlowObjectStack (org.knime.core.node.workflow.FlowObjectStack)2