use of org.erlide.engine.model.root.IErlModel in project erlide_eclipse by erlang.
the class ParsingTest method setUp.
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
final IErlModel model = ErlangEngine.getInstance().getModel();
module = model.getModuleFromText(model, "testing", "", null);
}
use of org.erlide.engine.model.root.IErlModel in project erlide_eclipse by erlang.
the class DefaultErlangFoldingStructureProvider method install.
@Override
public void install(final ITextEditor editor, final ProjectionViewer viewer) {
if (editor instanceof ErlangEditor) {
fFirstTimeInitialCollapse = true;
fEditor = editor;
fViewer = viewer;
fViewer.addProjectionListener(this);
final IErlModel mdl = ErlangEngine.getInstance().getModel();
mdl.addModelChangeListener(this);
}
}
use of org.erlide.engine.model.root.IErlModel in project erlide_eclipse by erlang.
the class DebugTab method getModulesFromAddModulesDialog.
public static List<IErlModule> getModulesFromAddModulesDialog(final Shell shell) {
final List<IErlModule> result = Lists.newArrayList();
final AddInterpretedModulesSelectionDialog dialog = new AddInterpretedModulesSelectionDialog(shell);
final int resultCode = dialog.open();
if (resultCode != IDialogConstants.OK_ID) {
return result;
}
final Object[] dialogResult = dialog.getResult();
if (dialogResult == null || dialogResult.length == 0) {
return result;
}
final IErlModel model = ErlangEngine.getInstance().getModel();
for (final Object o : dialogResult) {
if (o instanceof IFile) {
final IFile file = (IFile) o;
result.add(model.findModule(file));
}
}
return result;
}
use of org.erlide.engine.model.root.IErlModel in project erlide_eclipse by erlang.
the class SearchCoreUtil method getProjectsScope.
public static ErlSearchScope getProjectsScope(final Collection<IProject> projects, final boolean addExternals, final boolean addOtp) throws CoreException {
final ErlSearchScope result = new ErlSearchScope();
final Set<String> externalModulePaths = new HashSet<>();
final IErlModel model = ErlangEngine.getInstance().getModel();
for (final IProject project : projects) {
SearchCoreUtil.addProjectToScope(project, result);
if (NatureUtil.hasErlangNature(project)) {
final IErlProject erlProject = model.getErlangProject(project);
SearchCoreUtil.addExternalModules(erlProject, result, externalModulePaths, addExternals, addOtp);
}
}
return result;
}
use of org.erlide.engine.model.root.IErlModel in project erlide_eclipse by erlang.
the class ErlExternalReferenceEntryList method buildStructure.
@Override
public boolean buildStructure(final IProgressMonitor pm) throws ErlModelException {
// TODO some code duplication within this function
// ErlLogger.debug("ErlExternalReferenceEntryList.buildStructure %s",
// getName());
final IErlProject project = ErlangEngine.getInstance().getModelUtilService().getProject(this);
final ErlModelCache cache = ErlModelCache.getDefault();
List<ExternalTreeEntry> externalModuleTree = cache.getExternalTree(externalModules);
List<ExternalTreeEntry> externalIncludeTree = cache.getExternalTree(externalIncludes);
if (externalModuleTree == null || externalIncludeTree == null) {
final OtpErlangList pathVars = ErlangEngine.getInstance().getModel().getPathVars();
final IOtpRpc backend = OtpRpcFactory.getOtpRpcForProject(project);
if (externalModuleTree == null && !externalModules.isEmpty()) {
if (pm != null) {
pm.worked(1);
}
externalModuleTree = ErlangEngine.getInstance().getOpenService().getExternalModuleTree(backend, externalModules, pathVars);
}
if (externalIncludeTree == null && !externalIncludes.isEmpty()) {
if (pm != null) {
pm.worked(1);
}
externalIncludeTree = ErlangEngine.getInstance().getOpenService().getExternalModuleTree(backend, externalIncludes, pathVars);
}
}
setChildren(null);
final IErlModel model = ErlangEngine.getInstance().getModel();
if (externalModuleTree != null && !externalModuleTree.isEmpty()) {
addExternalEntries(pm, externalModuleTree, model, "modules", null, false);
cache.putExternalTree(externalModules, project, externalModuleTree);
}
if (externalIncludeTree != null && !externalIncludeTree.isEmpty() || !projectIncludes.isEmpty()) {
addExternalEntries(pm, externalIncludeTree, model, "includes", projectIncludes, true);
if (externalIncludeTree != null) {
cache.putExternalTree(externalIncludes, project, externalIncludeTree);
}
}
return true;
}
Aggregations