APISonar


jetbrains.mps.smodel.LanguageID.JAVA

> jetbrains > mps > smodel > LanguageID > JAVA
jetbrains APIs mps APIs smodel APIs LanguageID APIs JAVA APIs

Example 1
public Iterable<SModel> loadModels() {
    List<SModel> result = ListSequence.fromList(new ArrayList<SModel>());
    IClassPathItem cp = create(getPath());
    getModelDescriptors(result, getPath(), cp, "", LanguageID.JAVA, getModule());
    return result;
  }
Example 2
private SModelReference modelReferenceFromBinaryClassBinding(BinaryTypeBinding binaryTypeBinding) {
    String classFQName = TypesProvider.getClassifierIdPrefix(binaryTypeBinding);
    String packageName = NodeNameUtil.getNamespace(classFQName);
    SModelReference modelReference = StubHelper.uidForPackageInStubs(packageName, LanguageID.JAVA, null, true);
    return modelReference;
  }
Example 3
public SModelDescriptor getModelDescriptor(@NotNull SModelReference reference) {
    String stereotype = reference.getStereotype();
    SModelDescriptor descriptor = null;
    if (eq_otn35i_a0c0e(stereotype, SModelStereotype.getStubStereotypeForId(LanguageID.JAVA))) {
      if (EvaluationAuxModule.JAVA_STUBS) {
        descriptor = myModelRepository.getModelDescriptor(new SModelFqName(myModule.getModuleFqName(), reference.getLongName(), SModelStereotype.getStubStereotypeForId(LanguageID.JAVA)));
      } else {
        descriptor = super.getModelDescriptor(new SModelReference(reference.getLongName(), SModelStereotype.getStubStereotypeForId(EvaluationAuxModule.DEBUGGER_JAVA_ID)));
      }
    }
    if (descriptor != null) {
      return descriptor;
    }
    return super.getModelDescriptor(reference);
  }
Example 4
public Collection<SModelDescriptor> load(@NotNull ModelRoot root, IModule module) {
    List<SModelDescriptor> result = ListSequence.fromList(new ArrayList<SModelDescriptor>());
    IClassPathItem cp = AllMembersJavaStubs.this.create(root.getPath());
    AllMembersJavaStubs.this.getModelDescriptors(result, root.getPath(), cp, "", LanguageID.JAVA, module);
    return result;
  }
Example 5
public boolean isApplicable(AnActionEvent event, final Map<String, Object> _params) {
    SNode targetNode = APICellAdapter.getSNodeWRTReference(((EditorCell) MapSequence.fromMap(_params).get("cell")));
    if (targetNode == null) {
      return false;
    }
    if (targetNode == ((EditorCell) MapSequence.fromMap(_params).get("cell")).getSNode()) {
      return false;
    }
    String targetSter = SNodeOperations.getModelStereotype(jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations.getModel(targetNode));
    String stubSter = SModelStereotype.getStubStereotypeForId(LanguageID.JAVA);
    return eq_xgilk9_a0f0d(stubSter, targetSter);
  }
Example 6
public SModelReference getModelReferenceFor(String packageName, SModel model) {
    ModuleReference module = myModule.getModuleFor(packageName, LanguageID.JAVA);
    if (module == null) {
      Pair<String, String> p = new Pair<String, String>(packageName, myModule.getModuleFqName());
      if (!(reported.contains(p))) {
        reported.add(p);
        if (IdeMain.getTestMode() == IdeMain.TestMode.NO_TEST) {
          LOG.warning("no module found for: " + packageName + " in " + myModule.getModuleFqName());
        }
      }
    }
    SModelReference ref = StubHelper.uidForPackageInStubs(packageName, LanguageID.JAVA, module);
    model.addModelImport(ref, false);
    return ref;
  }
Example 7
public static SModelReference uidForPackageInStubs(String pack) {
    String javaStubStereotype = SModelStereotype.getStubStereotypeForId(LanguageID.JAVA);
    SModelFqName fqName = new SModelFqName(pack, javaStubStereotype);
    SModelId id = SModelId.foreign(javaStubStereotype, pack);
    return new SModelReference(fqName, id);
  }
Example 8
public static boolean call_isSame_4855996797771684010(SNode thisNode, SNode that) {
    if (SNodeOperations.getConceptDeclaration(thisNode) != SNodeOperations.getConceptDeclaration(that)) {
      return false;
    }
    // ignore model defferences for java_stub models 
    String javastub = SModelStereotype.getStubStereotypeForId(LanguageID.JAVA);
    if (javastub.equals(SNodeOperations.getModel(thisNode).getStereotype()) && javastub.equals(SNodeOperations.getModel(that).getStereotype())) {
      return INamedConcept_Behavior.call_getFqName_1213877404258(thisNode).equals(INamedConcept_Behavior.call_getFqName_1213877404258(that));
    }
    return thisNode == that;
  }
Example 9
/*package*/ static boolean isSame_id4dzXPK1BpyE(@NotNull SNode __thisNode__, SNode that) {
    if (SNodeOperations.getConceptDeclaration(__thisNode__) != SNodeOperations.getConceptDeclaration(that)) {
      return false;
    }
    // ignore model defferences for java_stub models 
    String javastub = SModelStereotype.getStubStereotypeForId(LanguageID.JAVA);
    if (javastub.equals(jetbrains.mps.util.SNodeOperations.getModelStereotype(SNodeOperations.getModel(__thisNode__))) && javastub.equals(jetbrains.mps.util.SNodeOperations.getModelStereotype(SNodeOperations.getModel(that)))) {
      return INamedConcept__BehaviorDescriptor.getFqName_idhEwIO9y.invoke(__thisNode__).equals(INamedConcept__BehaviorDescriptor.getFqName_idhEwIO9y.invoke(that));
    }
    return __thisNode__ == that;
  }
Example 10
public void doExecute(@NotNull final AnActionEvent event) {
    try {
      SNode targetNode = GoByCurrentReference_Action.this.cell.getSNodeWRTReference();
      if (SModelStereotype.getStubStereotypeForId(LanguageID.JAVA).equals(SNodeOperations.getModel(targetNode).getStereotype()) && GoByCurrentReference_Action.this.getHandlerFor(GoByCurrentReference_Action.this.project) != null) {
        if (GoByCurrentReference_Action.this.navigateToJavaStub(targetNode)) {
          return;
        }
      }
      GoByCurrentReference_Action.this.getEditorOpener().openNode(targetNode, GoByCurrentReference_Action.this.context, true, !(targetNode.isRoot()));
    } catch (Throwable t) {
      if (log.isErrorEnabled()) {
        log.error("User's action execute method failed. Action:" + "GoByCurrentReference", t);
      }
    }
  }
Example 11
public static void iterateClassPath(final ModuleReference module, final IClassPathItem item, Set<NodeDescriptor> result, final String pName) {
    final SModelReference model = StubHelper.uidForPackageInStubs(pName, LanguageID.JAVA, module, false);
    for (final String cls : item.getRootClasses(pName)) {
      result.add(new JavaStubNodeDescriptor(item, pName, cls, model));
    }
    for (String subpack : item.getSubpackages(pName)) {
      iterateClassPath(module, item, result, subpack);
    }
  }
Example 12
public static SModelReference uidForPackageInStubs(@NotNull SModuleReference moduleRef, String name){
    String stereo = SModelStereotype.getStubStereotypeForId(LanguageID.JAVA);
    SModelId modelId = jetbrains.mps.smodel.SModelId.foreign(stereo, moduleRef.getModuleId().toString(), name);
    return new jetbrains.mps.smodel.SModelReference(moduleRef, modelId, name + "@" + stereo);
  }
Example 13
public static SNode findClassifier(String packageName, String shortClassName, boolean reportErrors) {
    String modelName = packageName + "@" + SModelStereotype.getStubStereotypeForId(LanguageID.JAVA);
    SModel modelDescriptor = SModelRepository.getInstance().getModelDescriptor(modelName);
    if (modelDescriptor == null) {
      if (reportErrors) LOG.error("couldn't find model `" + modelName + "'");
      return null;
    }
    SModel model = modelDescriptor;
    SNode rootByName = SModelOperations.getRootByName(model, shortClassName);
    if (rootByName == null && reportErrors) {
      LOG.error("couldn't find root '" + shortClassName + "' in model `" + modelName + "'");
    }
    return rootByName;
  }
Example 14
public ASMModelLoader(StubLocation location, IClassPathItem classPathItem, SModel model) {
    // during fix of MPS-10626 would be changed to true 
    // but do not touch it before that 
    this(location, classPathItem, model, LanguageID.JAVA, false);
  }