Beispiel #1
0
  private void updateUsedLanguages() {
    Set<SLanguage> languagesInModel =
        new HashSet<SLanguage>(((SModelInternal) myModelDescriptor).importedLanguageIds());
    Set<SLanguage> languagesInProps = new HashSet<SLanguage>(getUsedLanguages());
    languagesInProps.removeAll(languagesInModel);

    for (SLanguage lang : languagesInProps) {
      ((SModelInternal) myModelDescriptor).addLanguage(lang);
    }

    languagesInModel.removeAll(getUsedLanguages());
    for (SLanguage lang : languagesInModel) {
      ((SModelInternal) myModelDescriptor).deleteLanguageId(lang);
    }
  }
Beispiel #2
0
 protected void validateImports() {
   SModelInternal modelInternal = (SModelInternal) myModel;
   for (SModuleReference devKit :
       ListSequence.fromListWithValues(
           new ArrayList<SModuleReference>(), modelInternal.importedDevkits())) {
     modelInternal.deleteDevKit(devKit);
   }
   for (SLanguage language :
       ListSequence.fromListWithValues(
           new ArrayList<SLanguage>(), modelInternal.importedLanguageIds())) {
     modelInternal.deleteLanguageId(language);
   }
   for (jetbrains.mps.smodel.SModel.ImportElement model :
       ListSequence.fromListWithValues(
           new ArrayList<jetbrains.mps.smodel.SModel.ImportElement>(),
           modelInternal.importedModels())) {
     modelInternal.deleteModelImport(model.getModelReference());
   }
   addBuiltInImports();
   TemporaryModels.getInstance().addMissingImports(myModel);
 }