use of org.knime.core.node.workflow.NodeOutPort in project knime-core by knime.
the class WrappedNodeDialog method runOK.
private void runOK(final boolean execute, final boolean openView) {
// send close action to underlying dialog pane
NodeContext.pushContext(m_nodeContainer);
try {
m_dialogPane.callOnClose();
buttonPressed(IDialogConstants.OK_ID);
if (execute) {
m_nodeContainer.getParent().executeUpToHere(m_nodeContainer.getID());
}
if (openView) {
final Rectangle knimeWindowBounds = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getBounds();
ViewUtils.invokeLaterInEDT(new Runnable() {
/**
* {inheritDoc}
*/
@Override
public void run() {
// show out-port view for nodes with at least
// one out-port (whereby the first is used as flow
// variable port for SingleNodeContainer), otherwise
// handle meta node (without flow variable port)
final int pIndex;
if (m_nodeContainer instanceof SingleNodeContainer) {
pIndex = 1;
} else {
pIndex = 0;
}
if (m_nodeContainer.getNrOutPorts() > pIndex) {
NodeOutPort port = m_nodeContainer.getOutPort(pIndex);
java.awt.Rectangle bounds = new java.awt.Rectangle(knimeWindowBounds.x, knimeWindowBounds.y, knimeWindowBounds.width, knimeWindowBounds.height);
port.openPortView(port.getPortName(), bounds);
}
}
});
}
} finally {
NodeContext.removeLastContext();
}
}
Aggregations