private static Map<String, String> getNestedClassifiers(SNode classifier) { // returns map from simpleName to fqName Map<String, String> nestedClassifiers = new HashMap<String, String>(); // todo: classifiers with same names in different supertypes? for (SNode superClassifier : Classifier_Behavior.call_getAllExtendedClassifiers_2907982978864985482( SNodeOperations.cast(classifier, "jetbrains.mps.baseLanguage.structure.Classifier"))) { for (SNode nestedClassifier : Classifier_Behavior.call_nestedClassifiers_5292274854859193142(superClassifier)) { addClassifierToBindingMap(nestedClassifiers, nestedClassifier); } } return nestedClassifiers; }
private boolean isApplicableToNode(final SNode node, final EditorContext editorContext) { if (!(SNodeOperations.isInstanceOf( SLinkOperations.getTarget(node, "visibility", true), "jetbrains.mps.baseLanguage.structure.PublicVisibility"))) { return false; } SNode classifierType = SNodeOperations.as( SLinkOperations.getTarget(node, "type", true), "jetbrains.mps.baseLanguage.structure.ClassifierType"); if (classifierType == null && SLinkOperations.getTarget(classifierType, "classifier", false) == null) { return false; } Set<SNode> allExtendedClassifiers = Classifier_Behavior.call_getAllExtendedClassifiers_2907982978864985482( SLinkOperations.getTarget(classifierType, "classifier", false)); return SetSequence.fromSet(allExtendedClassifiers) .contains( SNodeOperations.getNode( "f:java_stub#67b3c41d-58b3-4756-b971-30bf8a9d63e6#jetbrains.jetpad.projectional.view(jetbrains.jetpad/jetbrains.jetpad.projectional.view@java_stub)", "~ViewPropertySpec")); }