public void test_childContainingRoles() throws Exception {
   this.addNodeById("8758390115029078425");
   this.addNodeById("5815925154349132136");
   this.addNodeById("2166349271756548530");
   TestUtilities.assertEquals(
       Sequence.fromArray(
           new String[] {
             SPropertyOperations.getString(
                 SLinkOperations.findLinkDeclaration(
                     "jetbrains.mps.lang.smodelTests.structure.Root", "child_1_n"),
                 "role"),
             SPropertyOperations.getString(
                 SLinkOperations.findLinkDeclaration(
                     "jetbrains.mps.lang.smodelTests.structure.Root", "childSubConcept_0_n"),
                 "role")
           }),
       ListSequence.fromList(
               SNodeOperations.getChildren(
                   SNodeOperations.cast(
                       this.getNodeById("8758390115029078426"),
                       "jetbrains.mps.lang.smodelTests.structure.Root")))
           .select(
               new ISelector<SNode, String>() {
                 public String select(SNode it) {
                   return SNodeOperations.getContainingLinkRole(it);
                 }
               }));
 }
Beispiel #2
0
 private static boolean renderingCondition_wbyfib_a0a_0(SNode node, EditorContext editorContext) {
   return (SLinkOperations.getTarget(
               node,
               MetaAdapterFactory.getReferenceLink(
                   0xdcb5a83a19a844ffL,
                   0xa4cbfc7d324ecc63L,
                   0x1f6c736337b5e2d8L,
                   0x1f6c736337b5e2dcL,
                   "rule"))
           != null)
       && (isEmptyString(
               SPropertyOperations.getString(
                   SLinkOperations.getTarget(
                       node,
                       MetaAdapterFactory.getReferenceLink(
                           0xdcb5a83a19a844ffL,
                           0xa4cbfc7d324ecc63L,
                           0x1f6c736337b5e2d8L,
                           0x1f6c736337b5e2dcL,
                           "rule")),
                   MetaAdapterFactory.getProperty(
                       0xdcb5a83a19a844ffL,
                       0xa4cbfc7d324ecc63L,
                       0x1f6c736337b5e2f2L,
                       0x1f6c736337b5e2f9L,
                       "tagName")))
           || SPropertyOperations.getBoolean(
               node,
               MetaAdapterFactory.getProperty(
                   0xdcb5a83a19a844ffL,
                   0xa4cbfc7d324ecc63L,
                   0x1f6c736337b5e2d8L,
                   0x1f6c736337b5e2dbL,
                   "overrideTag")));
 }
 private Iterable<String> getEditorHints_fxz4pq_a9c0(SNode node, EditorContext editorContext) {
   if (SPropertyOperations.hasValue(
       node,
       MetaAdapterFactory.getProperty(
           0x7a80051c66e94bfcL,
           0x9698b12adfed3d9fL,
           0x51568a5db0cc3a79L,
           0x1b06bb955221551cL,
           "projectionType"),
       "rich",
       null)) {
     return Collections.singletonList(
         "jetbrains.mps.lang.editor.multiple.testLanguage.editor.MultipleEditorTestHints.rich");
   } else if (SPropertyOperations.hasValue(
       node,
       MetaAdapterFactory.getProperty(
           0x7a80051c66e94bfcL,
           0x9698b12adfed3d9fL,
           0x51568a5db0cc3a79L,
           0x1b06bb955221551cL,
           "projectionType"),
       "compact",
       null)) {
     return Collections.singletonList(
         "jetbrains.mps.lang.editor.multiple.testLanguage.editor.MultipleEditorTestHints.compact");
   }
   return Collections.emptyList();
 }
    public void execute(final SNode node, final EditorContext editorContext) {
      SNode templateNode =
          SNodeFactoryOperations.createNewRootNode(
              SNodeOperations.getModel(node),
              "jetbrains.mps.lang.generator.structure.TemplateDeclaration",
              null);
      SNode ruleNode =
          SNodeOperations.getAncestor(
              node, "jetbrains.mps.lang.generator.structure.BaseMappingRule", false, false);
      SLinkOperations.setTarget(
          templateNode,
          "applicableConcept",
          SLinkOperations.getTarget(ruleNode, "applicableConcept", false),
          false);
      SPropertyOperations.set(templateNode, "name", "template1");
      SLinkOperations.setTarget(
          templateNode, "contentNode", SLinkOperations.getTarget(node, "templateNode", true), true);
      SPropertyOperations.set(
          templateNode,
          "virtualPackage",
          SPropertyOperations.getString(SNodeOperations.getContainingRoot(node), "virtualPackage"));

      SNode templateRefNode =
          SNodeFactoryOperations.replaceWithNewChild(
              node, "jetbrains.mps.lang.generator.structure.TemplateDeclarationReference");
      SLinkOperations.setTarget(templateRefNode, "template", templateNode, false);

      SelectionUtil.selectNode(editorContext, templateNode);
    }
 public String getDescription(final SNode node, final EditorContext editorContext) {
   return (SPropertyOperations.getBoolean(
           node,
           MetaAdapterFactory.getProperty(
               0xcf935df46994e9cL,
               0xa132fa109541cba3L,
               0x4780308f5d333ebL,
               0x742675d05378e98dL,
               "compact"))
       ? "Unfold "
           + SPropertyOperations.getString(
               node,
               MetaAdapterFactory.getProperty(
                   0xceab519525ea4f22L,
                   0x9b92103b95ca8c0cL,
                   0x110396eaaa4L,
                   0x110396ec041L,
                   "name"))
       : "Fold "
           + SPropertyOperations.getString(
               node,
               MetaAdapterFactory.getProperty(
                   0xceab519525ea4f22L,
                   0x9b92103b95ca8c0cL,
                   0x110396eaaa4L,
                   0x110396ec041L,
                   "name")));
 }
Beispiel #6
0
 public static void addVariablePattern(EditorContext context) {
   EditorCell contextCell = context.getSelectedCell();
   SNode node = contextCell.getSNode();
   SNode linkDeclaration =
       SNodeOperations.cast(
           contextCell.getLinkDeclaration(),
           "jetbrains.mps.lang.structure.structure.LinkDeclaration");
   SNode genuineLinkDeclaration = SModelUtil.getGenuineLinkDeclaration(linkDeclaration);
   if (linkDeclaration != null
       && SPropertyOperations.hasValue(
           genuineLinkDeclaration, "metaClass", "reference", "reference")) {
     String role = SPropertyOperations.getString(genuineLinkDeclaration, "role");
     AttributeOperations.createAndSetAttrbiute(
         node,
         new IAttributeDescriptor.LinkAttribute(
             SConceptOperations.findConceptDeclaration(
                 "jetbrains.mps.lang.pattern.structure.LinkPatternVariableDeclaration"),
             role),
         "jetbrains.mps.lang.pattern.structure.LinkPatternVariableDeclaration");
   } else {
     AttributeOperations.createAndSetAttrbiute(
         node,
         new IAttributeDescriptor.NodeAttribute(
             SConceptOperations.findConceptDeclaration(
                 "jetbrains.mps.lang.pattern.structure.Pattern")),
         "jetbrains.mps.lang.pattern.structure.PatternVariableDeclaration");
   }
 }
Beispiel #7
0
 @Override
 public String getName() {
   String functionAlias =
       SPropertyOperations.getString(
           SNodeOperations.cast(
               ListSequence.fromList(
                       SLinkOperations.getTargets(smodelFunctionConcept, "conceptProperty", true))
                   .findFirst(
                       new IWhereFilter<SNode>() {
                         public boolean accept(SNode it) {
                           return SPropertyOperations.getString(
                                   SLinkOperations.getTarget(
                                       it, "conceptPropertyDeclaration", false),
                                   "name")
                               .equals("alias");
                         }
                       }),
               "jetbrains.mps.lang.structure.structure.StringConceptProperty"),
           "value");
   return "Migrate "
       + functionAlias
       + "("
       + SPropertyOperations.getString(sourceConcept, "name")
       + ") usages";
 }
Beispiel #8
0
  public SNode convertField(PsiField x, SNode parentConcept) {
    SNode field;
    if (isStatic(x)
        || SConceptOperations.isSubConceptOf(
            parentConcept, "jetbrains.mps.baseLanguage.structure.Interface")) {
      field =
          SConceptOperations.createNewNode(
              "jetbrains.mps.baseLanguage.structure.StaticFieldDeclaration", null);
    } else {
      field =
          SConceptOperations.createNewNode(
              "jetbrains.mps.baseLanguage.structure.FieldDeclaration", null);
      SPropertyOperations.set(
          SNodeOperations.cast(field, "jetbrains.mps.baseLanguage.structure.FieldDeclaration"),
          "isVolatile",
          "" + (x.hasModifierProperty(PsiModifier.VOLATILE)));
      SPropertyOperations.set(
          SNodeOperations.cast(field, "jetbrains.mps.baseLanguage.structure.FieldDeclaration"),
          "isTransient",
          "" + (x.hasModifierProperty(PsiModifier.TRANSIENT)));
    }

    SPropertyOperations.set(field, "name", x.getName());
    SLinkOperations.setTarget(
        SNodeOperations.cast(field, "jetbrains.mps.baseLanguage.structure.ClassifierMember"),
        "visibility",
        getVisibility(x),
        true);
    SPropertyOperations.set(field, "isFinal", "" + (isFinal(x)));
    SLinkOperations.setTarget(field, "type", convertType(x.getType()), true);
    addAnnotations(x, field);

    return field;
  }
Beispiel #9
0
 public void execute(final SNode node, final EditorContext editorContext) {
   String name = CreateFromUsageUtil.getText(editorContext);
   if (name == null || name.length() == 0) {
     name = "default_" + SPropertyOperations.getString(node, "name");
   }
   SNode t =
       SNodeFactoryOperations.createNewRootNode(
           SNodeOperations.getModel(node),
           "jetbrains.mps.lang.generator.structure.TemplateDeclaration",
           null);
   SPropertyOperations.set(t, "name", name);
   t.setProperty(
       SModelTreeNode.PACK,
       SPropertyOperations.getString(
           SNodeOperations.cast(
               SNodeOperations.getContainingRoot(node),
               "jetbrains.mps.lang.core.structure.BaseConcept"),
           "virtualPackage"));
   // make reference
   SNode tr =
       SNodeFactoryOperations.createNewNode(
           "jetbrains.mps.lang.generator.structure.TemplateDeclarationReference", null);
   SLinkOperations.setTarget(tr, "template", t, false);
   SLinkOperations.setTarget(node, "defaultConsequence", tr, true);
 }
 public void execute(final SNode node, final EditorContext editorContext) {
   EditorCell selectedCell = editorContext.getSelectedCell();
   if (!(selectedCell.isReferenceCell())) {
     return;
   }
   SNode contextNode =
       SNodeOperations.cast(
           selectedCell.getSNode(), "jetbrains.mps.lang.core.structure.BaseConcept");
   if (contextNode == null) {
     return;
   }
   String role = selectedCell.getRole();
   if (SNodeOperations.isInstanceOf(
       contextNode, "jetbrains.mps.lang.quotation.structure.ReferenceAntiquotation")) {
     SNode attributedNode =
         SNodeOperations.cast(
             SNodeOperations.getParent(contextNode),
             "jetbrains.mps.lang.core.structure.BaseConcept");
     assert attributedNode != null;
     AttributeOperations.setAttribute(
         attributedNode,
         new IAttributeDescriptor.LinkAttribute(
             SConceptOperations.findConceptDeclaration(
                 "jetbrains.mps.lang.quotation.structure.ReferenceAntiquotation"),
             role),
         null);
     return;
   }
   if (AttributeOperations.getAttribute(
           contextNode,
           new IAttributeDescriptor.LinkAttribute(
               SConceptOperations.findConceptDeclaration(
                   "jetbrains.mps.lang.quotation.structure.ReferenceAntiquotation"),
               role))
       != null) {
     AttributeOperations.setAttribute(
         contextNode,
         new IAttributeDescriptor.LinkAttribute(
             SConceptOperations.findConceptDeclaration(
                 "jetbrains.mps.lang.quotation.structure.ReferenceAntiquotation"),
             role),
         null);
   } else {
     SNode referenceAntiquotation =
         SNodeFactoryOperations.setNewAttribute(
             contextNode,
             new IAttributeDescriptor.LinkAttribute(
                 SConceptOperations.findConceptDeclaration(
                     "jetbrains.mps.lang.quotation.structure.ReferenceAntiquotation"),
                 role),
             "jetbrains.mps.lang.quotation.structure.ReferenceAntiquotation");
     if (selectedCell.isSingleNodeCell()) {
       SPropertyOperations.set(
           referenceAntiquotation,
           "label",
           SPropertyOperations.getString(
               SNodeOperations.getConceptDeclaration(contextNode), "name"));
     }
   }
 }
Beispiel #11
0
 public static Object propertyMacro_GetPropertyValue_1216862267927(
     final PropertyMacroContext _context) {
   if (SPropertyOperations.getString(
           _context.getNode(),
           MetaAdapterFactory.getProperty(
               0xd7706f639be2479cL,
               0xa3daae92af1e64d5L,
               0x11b5282d0d6L,
               0x11b6b106ad8L,
               "labelName_intern"))
       != null) {
     // operation has been preprocessed by mapping script in TLBase
     return SPropertyOperations.getString(
         _context.getNode(),
         MetaAdapterFactory.getProperty(
             0xd7706f639be2479cL,
             0xa3daae92af1e64d5L,
             0x11b5282d0d6L,
             0x11b6b106ad8L,
             "labelName_intern"));
   }
   return SPropertyOperations.getString(
       SLinkOperations.getTarget(
           _context.getNode(),
           MetaAdapterFactory.getReferenceLink(
               0xd7706f639be2479cL, 0xa3daae92af1e64d5L, 0x11b5282d0d6L, 0x11b5282d0d7L, "label")),
       MetaAdapterFactory.getProperty(
           0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"));
 }
 public List<String> getPostfixes(
     SNode node, IOperationContext operationContext, EditorContext editorContext) {
   List<String> result;
   SNode nodeType = ActionParameter__BehaviorDescriptor.getType_id112RIkggjzD.invoke(node);
   if (nodeType != null) {
     result = Type__BehaviorDescriptor.getVariableSuffixes_idhEwIzNo.invoke(nodeType);
   } else {
     result = ListSequence.fromList(new ArrayList<String>());
   }
   // we need this because of smart input
   // DO NOT REMOVE IT
   if (SPropertyOperations.getString(
           node,
           MetaAdapterFactory.getProperty(
               0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"))
       != null) {
     ListSequence.fromList(result)
         .addElement(
             SPropertyOperations.getString(
                 node,
                 MetaAdapterFactory.getProperty(
                     0xceab519525ea4f22L,
                     0x9b92103b95ca8c0cL,
                     0x110396eaaa4L,
                     0x110396ec041L,
                     "name")));
   }
   return result;
 }
 /*package*/ static void setupCaretAndSelection_id7TYU6fNl1yz(
     @NotNull SNode __thisNode__, EditorCell cellWithId) {
   if (cellWithId instanceof EditorCell_Label) {
     EditorCell_Label label = (EditorCell_Label) cellWithId;
     label.setCaretPosition(
         ((int)
             AnonymousCellAnnotation__BehaviorDescriptor.getCaretPosition_id5rZKa_fUlry.invoke(
                 __thisNode__, label)));
     label.setSelectionStart(
         SPropertyOperations.getInteger(
             __thisNode__,
             MetaAdapterFactory.getProperty(
                 0x8585453e6bfb4d80L,
                 0x98deb16074f1d86cL,
                 0x11e31babe12L,
                 0x56ffc0a94fe5fc33L,
                 "selectionStart")));
     label.setSelectionEnd(
         SPropertyOperations.getInteger(
             __thisNode__,
             MetaAdapterFactory.getProperty(
                 0x8585453e6bfb4d80L,
                 0x98deb16074f1d86cL,
                 0x11e31babe12L,
                 0x56ffc0a94fe5fc35L,
                 "selectionEnd")));
   }
 }
Beispiel #14
0
 public void doGenerateText(SNode node) {
   this.append("@ECHO OFF");
   this.appendNewLine();
   this.append("SETLOCAL ENABLEDELAYEDEXPANSION");
   this.appendNewLine();
   this.append("REM ");
   this.append(SPropertyOperations.getString(node, "name"));
   this.appendNewLine();
   this.append("REM ");
   this.append(SPropertyOperations.getString(node, "description"));
   this.appendNewLine();
   this.appendNewLine();
   TextGenManager.instance()
       .appendNodeText(
           this.getContext(),
           this.getBuffer(),
           SLinkOperations.getTarget(node, "code", true),
           this.getSNode());
   this.appendNewLine();
   this.appendNewLine();
   this.append("GOTO :EOF");
   this.appendNewLine();
   TextGenManager.instance()
       .appendNodeText(
           this.getContext(),
           this.getBuffer(),
           SLinkOperations.getTarget(node, "functions", true),
           this.getSNode());
 }
 public void test_roles() throws Exception {
   this.addNodeById("2906110183022219846");
   this.addNodeById("2906110183022219807");
   this.addNodeById("2906110183022219843");
   this.addNodeById("2906110183022354865");
   this.addNodeById("2906110183022432276");
   TestUtilities.assertEquals(
       Sequence.fromArray(
           new String[] {
             SPropertyOperations.getString(
                 SLinkOperations.findLinkDeclaration(
                     "jetbrains.mps.lang.smodelTests.structure.ReferenceContainer", "root"),
                 "role"),
             SPropertyOperations.getString(
                 SLinkOperations.findLinkDeclaration(
                     "jetbrains.mps.lang.smodelTests.structure.ReferenceContainer", "leftChild"),
                 "role"),
             SPropertyOperations.getString(
                 SLinkOperations.findLinkDeclaration(
                     "jetbrains.mps.lang.smodelTests.structure.ReferenceContainer",
                     "rightChild"),
                 "role")
           }),
       Sequence.fromIterable(
               SNodeOperations.getReferences(
                   SNodeOperations.cast(
                       this.getNodeById("2906110183022219844"),
                       "jetbrains.mps.lang.smodelTests.structure.ReferenceContainer")))
           .select(
               new ISelector<SReference, String>() {
                 public String select(SReference it) {
                   return SLinkOperations.getRole(it);
                 }
               }));
 }
  public static void virtual_unpack_7128123785277710736(
      SNode thisNode, UnpackHelper helper, Iterable<Object> artifacts) {
    SNode parent = helper.parent(thisNode);
    String parentLocation = helper.contentLocations().get(parent);
    String zipLocation =
        parentLocation
            + "/"
            + BuildString_Behavior.call_getText_4380385936562005550(
                SLinkOperations.getTarget(thisNode, "containerName", true),
                helper.getMacroHelper());
    helper.locations().put(thisNode, zipLocation);

    if (helper.isContentRequired(thisNode)) {
      String tempPath =
          helper
              .getPathProvider()
              .createTempPath(
                  SPropertyOperations.getString(thisNode, "name"),
                  "deps",
                  SPropertyOperations.getString(
                      SNodeOperations.getAncestor(
                          thisNode, "jetbrains.mps.build.structure.BuildProject", false, false),
                      "name"));
      helper.emit(_quotation_createNode_20awhq_a0a1a5a0(tempPath));
      helper.emit(_quotation_createNode_20awhq_a0a2a5a0(zipLocation, tempPath));
      helper.contentLocations().put(thisNode, tempPath);
    }
  }
Beispiel #17
0
 public static Object propertyMacro_GetPropertyValue_2059109515400317575(
     final PropertyMacroContext _context) {
   return (isNotEmptyString(SPropertyOperations.getString(_context.getNode(), "compiler"))
           && SPropertyOperations.getString(_context.getNode(), "compiler").equals("IntelliJ")
       ? "javac2"
       : "javac");
 }
Beispiel #18
0
 public static Object propertyMacro_GetPropertyValue_6896005762093594421(
     final PropertyMacroContext _context) {
   if (SPropertyOperations.getBoolean(_context.getNode(), "exportToProperiesFile")) {
     return "${" + SPropertyOperations.getString(_context.getNode(), "name") + ".relative}";
   }
   return SPropertyOperations.getString(_context.getNode(), "defaultValue");
 }
 /*package*/ static SNode toBaseLanguageType_idhEwI9ym(@NotNull SNode __thisNode__) {
   if (Primitives.INTEGER_TYPE.equals(
       SPropertyOperations.getString(
           __thisNode__,
           MetaAdapterFactory.getProperty(
               0xceab519525ea4f22L,
               0x9b92103b95ca8c0cL,
               0x110396eaaa4L,
               0x110396ec041L,
               "name")))) {
     return _quotation_createNode_qjn9ch_a0a0a0();
   }
   if (Primitives.BOOLEAN_TYPE.equals(
       SPropertyOperations.getString(
           __thisNode__,
           MetaAdapterFactory.getProperty(
               0xceab519525ea4f22L,
               0x9b92103b95ca8c0cL,
               0x110396eaaa4L,
               0x110396ec041L,
               "name")))) {
     return _quotation_createNode_qjn9ch_a0a1a0();
   }
   return _quotation_createNode_qjn9ch_a2a0();
 }
Beispiel #20
0
 private SNode convertLanguage(LanguageDescriptor source) {
   SNode result =
       SConceptOperations.createNewNode("jetbrains.mps.lang.project.structure.Language", null);
   result.setId(SNodeId.fromString("~root"));
   SModelOperations.addRootNode(myModel, result);
   fill(result, source);
   SPropertyOperations.set(result, "doNotGenerateAdapters", "" + source.isDoNotGenerateAdapters());
   SPropertyOperations.set(result, "genPath", source.getGenPath());
   SPropertyOperations.set(result, "languagePath", myFile.getPath());
   for (SModelReference ref : source.getAccessoryModels()) {
     SLinkOperations.getTargets(result, "accessoryModels", true).add(convert(ref));
   }
   for (GeneratorDescriptor descriptor : source.getGenerators()) {
     SLinkOperations.getTargets(result, "generator", true).add(convert(descriptor));
   }
   for (ModuleReference ref : source.getExtendedLanguages()) {
     SLinkOperations.getTargets(result, "extendedLanguages", true).add(convert(ref));
   }
   for (Dependency dep : source.getRuntimeModules()) {
     SLinkOperations.getTargets(result, "runtimeModules", true).add(convert(dep));
   }
   for (ModelRoot entry : source.getRuntimeStubModels()) {
     SLinkOperations.getTargets(result, "runtimeStubModels", true).add(convert(entry));
   }
   for (StubSolution sol : source.getStubSolutions()) {
     SLinkOperations.getTargets(result, "stubSolutions", true).add(convert(sol));
   }
   collectModels(result, source);
   return result;
 }
 public String getDescriptionText_internal(SNode parameterObject) {
   if (isNotEmptyString(
       SPropertyOperations.getString(parameterObject, "conceptShortDescription"))) {
     return SPropertyOperations.getString(parameterObject, "conceptShortDescription");
   } else {
     return SPropertyOperations.getString(parameterObject, "conceptAlias");
   }
 }
 @Nullable
 public static IModule call_getModule_4040588429969043137(SNode thisNode) {
   if (SPropertyOperations.getString(thisNode, "moduleId") == null) {
     return null;
   }
   return MPSModuleRepository.getInstance()
       .getModuleById(ModuleId.fromString(SPropertyOperations.getString(thisNode, "moduleId")));
 }
Beispiel #23
0
 private SNode convert(StubSolution source) {
   SNode result =
       SModelOperations.createNewNode(
           myModel, "jetbrains.mps.lang.project.structure.StubSolution", null);
   SPropertyOperations.set(result, "name", source.getName());
   SPropertyOperations.set(result, "uuid", source.getId().toString());
   return result;
 }
Beispiel #24
0
 private SNode convert(ModuleReference ref) {
   SNode result =
       SModelOperations.createNewNode(
           myModel, "jetbrains.mps.lang.project.structure.ModuleReference", null);
   SPropertyOperations.set(result, "uuid", ref.getModuleId().toString());
   SPropertyOperations.set(result, "qualifiedName", ref.getModuleFqName());
   return result;
 }
 public static int call_getCaretPosition_6268941039745717986(
     SNode thisNode, EditorCell_Label label) {
   if (SPropertyOperations.getBoolean(thisNode, "isLastPosition")) {
     return label.getText().length();
   } else {
     return SPropertyOperations.getInteger(thisNode, "caretPosition");
   }
 }
 public static boolean virtual_hasNewLineAfter_3080189811177340429(SNode thisNode) {
   if ((SPropertyOperations.getString(thisNode, "text") == null
           || SPropertyOperations.getString(thisNode, "text").length() == 0)
       && (SNodeOperations.getNextSibling(thisNode) != null)) {
     return !(XmlValuePart_Behavior.call_onNewLine_3080189811177340422(thisNode));
   }
   return false;
 }
Beispiel #27
0
 private SNode convert(SModelReference source) {
   SNode result =
       SModelOperations.createNewNode(
           myModel, "jetbrains.mps.lang.project.structure.ModelReference", null);
   SPropertyOperations.set(result, "uuid", source.getSModelId().toString());
   SPropertyOperations.set(result, "qualifiedName", source.getSModelFqName().getLongName());
   SPropertyOperations.set(result, "stereotype", source.getSModelFqName().getStereotype());
   return result;
 }
Beispiel #28
0
 public static String virtual_getPresentation_1213877396640(SNode thisNode) {
   if (SNodeOperations.isInstanceOf(
       thisNode,
       MetaAdapterFactory.getInterfaceConcept(
           0xceab519525ea4f22L,
           0x9b92103b95ca8c0cL,
           0x110396eaaa4L,
           "jetbrains.mps.lang.core.structure.INamedConcept"))) {
     String name =
         SPropertyOperations.getString(
             SNodeOperations.cast(
                 thisNode,
                 MetaAdapterFactory.getInterfaceConcept(
                     0xceab519525ea4f22L,
                     0x9b92103b95ca8c0cL,
                     0x110396eaaa4L,
                     "jetbrains.mps.lang.core.structure.INamedConcept")),
             MetaAdapterFactory.getProperty(
                 0xceab519525ea4f22L,
                 0x9b92103b95ca8c0cL,
                 0x110396eaaa4L,
                 0x110396ec041L,
                 "name"));
     if (name != null) {
       return name;
     }
     return "<no name>["
         + SPropertyOperations.getString(
             SNodeOperations.getConceptDeclaration(thisNode),
             MetaAdapterFactory.getProperty(
                 0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"))
         + "]";
   }
   // --
   String smartRefPresentation = ReferenceConceptUtil.getPresentation(thisNode);
   if (smartRefPresentation != null) {
     return smartRefPresentation;
   }
   // --
   String conceptAlias =
       SPropertyOperations.getString(
           SNodeOperations.getConceptDeclaration(thisNode),
           MetaAdapterFactory.getProperty(
               0xc72da2b97cce4447L,
               0x8389f407dc1158b7L,
               0x1103553c5ffL,
               0x46ab0ad5826c74caL,
               "conceptAlias"));
   if (conceptAlias != null) {
     return conceptAlias;
   }
   // --
   return SPropertyOperations.getString(
       SNodeOperations.getConceptDeclaration(thisNode),
       MetaAdapterFactory.getProperty(
           0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"));
 }
Beispiel #29
0
 private SNode convert(ModelRoot source) {
   SNode result =
       SModelOperations.createNewNode(
           myModel, "jetbrains.mps.lang.project.structure.ModelRoot", null);
   SPropertyOperations.set(result, "path", source.getPath());
   SPropertyOperations.set(result, "prefix", source.getPrefix());
   SLinkOperations.setTarget(result, "manager", convert(source.getManager()), true);
   return result;
 }
Beispiel #30
0
 public static Object propertyMacro_GetPropertyValue_1217882311150(
     final IOperationContext operationContext, final PropertyMacroContext _context) {
   if (SPropertyOperations.getString(_context.getNode(), "labelName_intern") != null) {
     // operation has been preprocessed by mapping script in TLBase
     return SPropertyOperations.getString(_context.getNode(), "labelName_intern");
   }
   return SPropertyOperations.getString(
       SLinkOperations.getTarget(_context.getNode(), "label", false), "name");
 }