use of org.knime.workbench.editor2.commands.ReconnectConnectionCommand in project knime-core by knime.
the class PortGraphicalRoleEditPolicy method getReconnectTargetCommand.
/**
* {@inheritDoc}
*/
@Override
protected Command getReconnectTargetCommand(final ReconnectRequest req) {
// only connect to inports
if (!(getHost() instanceof NodeInPortEditPart || getHost() instanceof WorkflowOutPortEditPart)) {
return null;
}
// get new target in port
AbstractPortEditPart target = (AbstractPortEditPart) req.getTarget();
ReconnectConnectionCommand reconnectCmd = new ReconnectConnectionCommand((ConnectionContainerEditPart) req.getConnectionEditPart(), (AbstractPortEditPart) req.getConnectionEditPart().getSource(), target);
return reconnectCmd;
}
Aggregations