use of org.absmodels.abs.plugin.editor.reconciling.AbsModelManager in project abstools by abstools.
the class ABSEditor method initCompilationUnit.
private void initCompilationUnit() {
AbsNature absNature = UtilityFunctions.getAbsNature(getResource());
if (absNature != null) {
AbsModelManager modelManager = absNature.getModelManager();
compilationUnit = modelManager.getCompilationUnit(getAbsoluteFilePath());
} else {
// we are looking at abslang.abs or a file inside a jar-package
IURIEditorInput uriInput = (IURIEditorInput) getEditorInput().getAdapter(IURIEditorInput.class);
if (uriInput != null) {
// We're looking e.g. at abslang.abs which only exists in memory.
// create an empty model which only contains abslang.abs:
absNature = new AbsNature();
absNature.emptyModel();
File f = new File(uriInput.getURI());
String path = f.getAbsolutePath();
compilationUnit = absNature.getCompilationUnit(path);
}
}
}
Aggregations