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>");
}
}
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();
}
Aggregations