package jetbrains.mps.editor.contextActionsTool.pluginSolution.plugin;
/*Generated by MPS */
import org.jetbrains.mps.openapi.model.SNode;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import org.jetbrains.mps.openapi.language.SContainmentLink;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
public class ConceptInstanceActionHelper {
public static boolean isApplicable(SNode selectedNode, SAbstractConcept contextContecpt, SContainmentLink contextRole, boolean availableInChildren) {
SNode contextNode = SNodeOperations.getNodeAncestor(selectedNode, SNodeOperations.asSConcept(contextContecpt), true, false);
if ((contextNode != null)) {
if ((selectedNode == contextNode || SNodeOperations.getParent(selectedNode) == contextNode) || availableInChildren) {
return true;
} else if (availableInChildren) {
return true;
}
}
return false;
}
}