Examples of IErlElementLocator


Examples of org.erlide.engine.model.root.IErlElementLocator

    public static boolean openExternalFunction(final String moduleName,
            final ErlangFunction function, final String modulePath,
            final IErlModule module, final IErlProject project,
            final IErlElementLocator.Scope scope) throws CoreException {
        final IErlElementLocator model = ErlangEngine.getInstance().getModel();
        final IErlModule module2 = ErlangEngine.getInstance().getModelFindService()
                .findModule(model, project, moduleName, modulePath, scope);
        if (module2 != null) {
            final IEditorPart editor = EditorUtility.openInEditor(module2);
            return openFunctionInEditor(function, editor);
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

        }
        final String path = getPathForInput(editorInput);
        if (path == null) {
            return null;
        }
        final IErlElementLocator model = ErlangEngine.getInstance().getModel();
        final IErlModule module = ErlangEngine
                .getInstance()
                .getModelFindService()
                .findModule(model, null, null, path,
                        IErlElementLocator.Scope.ALL_PROJECTS);
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

            throws CoreException {
        openMFA(module, function, ErlangFunction.ANY_ARITY);
    }

    public static void openModule(final String moduleName) throws CoreException {
        final IErlElementLocator model = ErlangEngine.getInstance().getModel();
        final IErlModule module = ErlangEngine
                .getInstance()
                .getModelFindService()
                .findModule(model, null, moduleName, null,
                        IErlElementLocator.Scope.ALL_PROJECTS);
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

            assertEquals(0, markers.length);
            // when
            // putting a dialyzer warning on it
            final int lineNumber = 3;
            final String message = "test message";
            final IErlElementLocator model = ErlangEngine.getInstance().getModel();
            DialyzerMarkerUtils.addDialyzerWarningMarker(model, erlModule.getResource()
                    .getLocation().toPortableString(), lineNumber, message);
            // then
            // there should be a marker with proper file name and the proper
            // line number
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

            DialyzerMarkerUtils.removeDialyzerMarkersFor(root);
            // when
            // putting dialyzer warning markers on the external file
            final String message = "test message";
            final int lineNumber = 2;
            final IErlElementLocator model = ErlangEngine.getInstance().getModel();
            DialyzerMarkerUtils.addDialyzerWarningMarker(model,
                    externalFile.getAbsolutePath(), lineNumber, message);
            // then
            // the marker should have the proper file name and the include file
            // should appear in External Files
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

        if (modulesForProject != null && includesForProject != null) {
            result.addAll(modulesForProject);
            result.addAll(includesForProject);
        } else {
            final List<IErlModule> cached = erlModelCache.getModulesForProject(this);
            final IErlElementLocator model = ErlangEngine.getInstance().getModel();
            if (cached == null) {
                final List<IErlModule> modules = getModulesOrIncludes(fProject, model,
                        getProperties().getSourceDirs(), true);
                result.addAll(modules);
            } else {
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

                return getErlResourceImageDescriptor(file, flags);
                // image for a CU not on the build path
            }
            return getWorkbenchImageDescriptor(file, flags);
        } else if (element instanceof IFolder) {
            final IErlElementLocator model = ErlangEngine.getInstance().getModel();
            final IErlFolder ef = (IErlFolder) model.findElement((IResource) element);
            if (ef != null && (ef.isOnSourcePath() || ef.isOnIncludePath())) {
                return getErlImageDescriptor(ef, flags);
            }
        } else if (element instanceof IAdaptable) {
            return getWorkbenchImageDescriptor((IAdaptable) element, flags);
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

    public void getCorrespondingResource() throws Exception {
        project.open(null);
        final IProject workspaceProject = project.getWorkspaceProject();
        final IFolder srcFolder = workspaceProject.getFolder("src");
        final IFile file = srcFolder.getFile("xx.erl");
        final IErlElementLocator model = ErlangEngine.getInstance().getModel();
        final IErlModule otpFile = model.findModuleFromProject(project, "file.erl", null,
                IErlElementLocator.Scope.PROJECT_ONLY);
        module.open(null);
        final IErlElement element = module.getElementAtLine(3);
        assertEquals(file, module.getCorrespondingResource());
        assertNull(otpFile.getCorrespondingResource());
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

    // IErlModel getModel();
    @Test
    public void getModelTest() throws Exception {
        module.open(null);
        final IErlElementLocator model = ErlangEngine.getInstance().getModel();
        assertEquals(model, ErlangEngine.getInstance().getModel());
    }
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

    public void getResource() throws Exception {
        project.open(null);
        final IProject workspaceProject = project.getWorkspaceProject();
        final IFolder srcFolder = workspaceProject.getFolder("src");
        final IFile file = srcFolder.getFile("xx.erl");
        final IErlElementLocator model = ErlangEngine.getInstance().getModel();
        final IErlModule otpFile = model.findModuleFromProject(project, "file.erl", null,
                IErlElementLocator.Scope.PROJECT_ONLY);
        module.open(null);
        final IErlElement element = module.getElementAtLine(3);
        assertEquals(file, module.getResource());
        assertNull(otpFile.getResource());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.