use of org.knime.core.node.workflow.SubNodeContainer in project knime-core by knime.
the class ReconfigureMetaNodeCommand method canExecute.
/**
* {@inheritDoc}
*/
@Override
public boolean canExecute() {
if (!super.canExecute()) {
return false;
}
if (m_metanodeID == null) {
return false;
}
NodeContainer nc = getHostWFM().getNodeContainer(m_metanodeID);
boolean isWriteProtected;
if (nc instanceof WorkflowManager) {
isWriteProtected = ((WorkflowManager) nc).isWriteProtected();
} else if (nc instanceof SubNodeContainer) {
isWriteProtected = ((SubNodeContainer) nc).isWriteProtected();
} else {
return false;
}
if (!(nc instanceof WorkflowManager) && !(nc instanceof SubNodeContainer)) {
return false;
}
if (isWriteProtected) {
return false;
}
// at least one thing to change should be set
return (m_inPorts != null || m_outPorts != null || m_name != null);
}
Aggregations