Package org.erlide.engine.internal.model.cache

Examples of org.erlide.engine.internal.model.cache.ErlModelCache$DisabledErlModelCache


    }

    @Override
    public Collection<IErlModule> getModulesAndIncludes() throws ErlModelException {
        final List<IErlModule> result = new ArrayList<IErlModule>();
        final ErlModelCache erlModelCache = ErlModelCache.getDefault();
        final List<IErlModule> modulesForProject = erlModelCache
                .getModulesForProject(this);
        final List<IErlModule> includesForProject = erlModelCache
                .getIncludesForProject(this);
        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);
View Full Code Here


        return result;
    }

    @Override
    public Collection<IErlModule> getIncludes() throws ErlModelException {
        final ErlModelCache erlModelCache = ErlModelCache.getDefault();
        final List<IErlModule> cached = erlModelCache.getIncludesForProject(this);
        if (cached != null) {
            return cached;
        }
        final List<IErlModule> includes = getModulesOrIncludes(fProject, ErlangEngine
                .getInstance().getModel(), getProperties().getIncludeDirs(), false);
        erlModelCache.putIncludesForProject(this, includes);
        return includes;
    }
View Full Code Here

        // 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(project.getWorkspaceProject());
            final IOtpRpc backend = OtpRpcFactory.getOtpRpcForProject(project);
            if (externalModuleTree == null && externalModules.length() > 0) {
                if (pm != null) {
                    pm.worked(1);
                }
                externalModuleTree = ErlangEngine.getInstance()
                        .getService(OpenService.class)
                        .getExternalModuleTree(backend, externalModules, pathVars);
            }
            if (externalIncludeTree == null && externalIncludes.length() > 0) {
                if (pm != null) {
                    pm.worked(1);
                }
                externalIncludeTree = ErlangEngine.getInstance()
                        .getService(OpenService.class)
                        .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;
    }
View Full Code Here

    }

    private IErlProject createErlangProject(final IProject project) {
        final IErlProject ep = new ErlProject(this, project);
        addChild(ep);
        final ErlModelCache cache = getModelCache();
        cache.newProjectCreated();
        return ep;
    }
View Full Code Here

    }

    private static IErlModule getModuleFromCacheByNameOrPath(final ErlProject project,
            final String moduleName, final String modulePath,
            final IErlElementLocator.Scope scope) {
        final ErlModelCache erlModelCache = ErlModelCache.getDefault();
        if (modulePath != null) {
            final IErlModule module = erlModelCache.getModuleByPath(modulePath);
            if (module != null && (project == null || project.moduleInProject(module))) {
                return module;
            }
        }
        return null;
View Full Code Here

TOP

Related Classes of org.erlide.engine.internal.model.cache.ErlModelCache$DisabledErlModelCache

Copyright © 2018 www.massapicom. 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.