private void addNewModels() { Set<SModelReference> modelsInProps = new HashSet<SModelReference>(getImportedModels()); SModel smodel = myModelDescriptor; modelsInProps.removeAll(SModelOperations.getImportedModelUIDs(smodel)); for (SModelReference modelReference : modelsInProps) { ((SModelInternal) smodel).addModelImport(modelReference, false); } }
private void removeUnusedModels() { SModel smodel = myModelDescriptor; Set<SModelReference> modelsInModel = new HashSet<SModelReference>(SModelOperations.getImportedModelUIDs(smodel)); modelsInModel.removeAll(getImportedModels()); for (SModelReference modelReference : modelsInModel) { ((SModelInternal) smodel).deleteModelImport(modelReference); } }
private static void addImportIfNeed(SModel model, SModel toImport) { if (model == null || toImport == null) { return; } SModelReference ref = toImport.getReference(); if (model == toImport || SModelOperations.getImportedModelUIDs(model).contains(ref)) { return; } ((SModelInternal) model).addModelImport(ref, false); }
public ModelProperties(SModel modelDescriptor) { myModelDescriptor = modelDescriptor; SModel model = myModelDescriptor; myImportedModels.addAll(SModelOperations.getImportedModelUIDs(model)); myUsedLanguages.addAll(((SModelInternal) model).importedLanguageIds()); myUsedDevKits.addAll(((SModelInternal) model).importedDevkits()); myLanguagesEngagedOnGeneration.addAll(((SModelInternal) model).engagedOnGenerationLanguages()); myDoNotGenerate = myModelDescriptor instanceof GeneratableSModel && ((GeneratableSModel) myModelDescriptor).isDoNotGenerate(); myGenerateIntoModelFolder = myModelDescriptor instanceof GeneratableSModel && ((GeneratableSModel) myModelDescriptor).isGenerateIntoModelFolder(); }
private static void assertSameModelImports(SModel expectedModel, SModel actualModel) { assertListsEqual( SModelOperations.getImportedModelUIDs(expectedModel), SModelOperations.getImportedModelUIDs(actualModel), "model import"); }