Search in sources :

Example 6 with SubNodeContainerUI

use of org.knime.core.ui.node.workflow.SubNodeContainerUI in project knime-core by knime.

the class DynamicNodeDescriptionCreator method addSubWorkflowDescription.

private void addSubWorkflowDescription(final NodeContainerUI nc, final boolean useSingleLine, final StringBuilder bld) {
    WorkflowManagerUI wfm;
    if (nc instanceof SubNodeContainerUI) {
        wfm = ((SubNodeContainerUI) nc).getWorkflowManager();
    } else {
        wfm = (WorkflowManagerUI) nc;
    }
    if (!useSingleLine) {
        bld.append(getHeader());
        bld.append("<h1>");
        bld.append(nc.getName());
        bld.append("</h1>");
        if (nc.getCustomDescription() != null) {
            bld.append("<h2>Description:</h2>");
            bld.append("<p>" + nc.getCustomDescription() + "</p>");
        }
        bld.append("<h2>Contained nodes: </h2>");
        for (NodeContainerUI child : wfm.getNodeContainers()) {
            addDescription(child, true, bld);
        }
        bld.append("</body></html>");
    } else {
        bld.append("<dt><b>");
        bld.append(nc.getName() + " contained nodes:");
        bld.append("</b></dt>");
        bld.append("<dd>");
        bld.append("<dl>");
        for (NodeContainerUI child : wfm.getNodeContainers()) {
            addDescription(child, true, bld);
        }
        bld.append("</dl>");
        bld.append("</dd>");
    }
}
Also used : NodeContainerUI(org.knime.core.ui.node.workflow.NodeContainerUI) SubNodeContainerUI(org.knime.core.ui.node.workflow.SubNodeContainerUI) SingleNodeContainerUI(org.knime.core.ui.node.workflow.SingleNodeContainerUI) WorkflowManagerUI(org.knime.core.ui.node.workflow.WorkflowManagerUI) SubNodeContainerUI(org.knime.core.ui.node.workflow.SubNodeContainerUI)

Example 7 with SubNodeContainerUI

use of org.knime.core.ui.node.workflow.SubNodeContainerUI in project knime-core by knime.

the class NodeContainerEditPart method updateFigureFromUIinfo.

private void updateFigureFromUIinfo(final NodeUIInformation uiInfo) {
    NodeContainerFigure fig = (NodeContainerFigure) getFigure();
    setBoundsFromUIinfo(uiInfo);
    // update tooltip
    fig.setCustomDescription(getNodeContainer().getCustomDescription());
    // check status of node
    updateNodeMessage();
    // reset the tooltip text of the outports
    for (Object part : getChildren()) {
        if (part instanceof NodeOutPortEditPart) {
            NodeOutPortEditPart outPortPart = (NodeOutPortEditPart) part;
            outPortPart.rebuildTooltip();
        }
    }
    // for sub node refresh all tooltips
    if (getNodeContainer() instanceof SubNodeContainerUI) {
        for (Object part : getChildren()) {
            if (part instanceof NodeInPortEditPart) {
                NodeInPortEditPart inPortPart = (NodeInPortEditPart) part;
                inPortPart.rebuildTooltip();
            }
            if (part instanceof NodeOutPortEditPart) {
                NodeOutPortEditPart outPortPart = (NodeOutPortEditPart) part;
                outPortPart.rebuildTooltip();
            }
        }
    }
    // always refresh visuals
    refreshVisuals();
}
Also used : SubNodeContainerUI(org.knime.core.ui.node.workflow.SubNodeContainerUI) NodeContainerFigure(org.knime.workbench.editor2.figures.NodeContainerFigure)

Aggregations

SubNodeContainerUI (org.knime.core.ui.node.workflow.SubNodeContainerUI)7 NodeContainerUI (org.knime.core.ui.node.workflow.NodeContainerUI)4 WorkflowManagerUI (org.knime.core.ui.node.workflow.WorkflowManagerUI)4 NodeContainerEditPart (org.knime.workbench.editor2.editparts.NodeContainerEditPart)3 EditPart (org.eclipse.gef.EditPart)2 SingleNodeContainerUI (org.knime.core.ui.node.workflow.SingleNodeContainerUI)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 UpdateAction (org.eclipse.gef.ui.actions.UpdateAction)1 IAction (org.eclipse.jface.action.IAction)1 IMenuManager (org.eclipse.jface.action.IMenuManager)1 Separator (org.eclipse.jface.action.Separator)1 Point (org.eclipse.swt.graphics.Point)1 IEditorPart (org.eclipse.ui.IEditorPart)1 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)1 PartInitException (org.eclipse.ui.PartInitException)1 SingleNodeContainer (org.knime.core.node.workflow.SingleNodeContainer)1 SubNodeContainer (org.knime.core.node.workflow.SubNodeContainer)1 WorkflowCipherPrompt (org.knime.core.node.workflow.WorkflowCipherPrompt)1 WorkflowManager (org.knime.core.node.workflow.WorkflowManager)1