Package org.erlide.engine.model.root

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


    @Override
    public boolean isOnSourcePath() {
        final IErlElement parent = getParent();
        if (parent instanceof IErlFolder) {
            final IErlFolder folder = (IErlFolder) parent;
            return folder.isOnSourcePath();
        }
        if (checkPath(modelUtilService.getProject(this).getProperties().getSourceDirs())) {
            return true;
        }
        return false;
View Full Code Here


    @Override
    public boolean isOnIncludePath() {
        final IErlElement parent = getParent();
        if (parent instanceof IErlFolder) {
            final IErlFolder folder = (IErlFolder) parent;
            return folder.isOnIncludePath();
        }
        if (checkPath(modelUtilService.getProject(this).getProperties().getIncludeDirs())) {
            return true;
        }
        return false;
View Full Code Here

    public IErlFolder createFolder(final IFolder folder, final IErlElement parent) {
        if (folder == null) {
            return null;
        }
        final IErlFolder f = new ErlFolder(parent, folder);
        final IErlElement p = parent;
        if (p != null) {
            p.addChild(f);
        } else {
            // ErlLogger.warn("creating folder %s in null parent?!", folder
View Full Code Here

    public IErlModule findIncludeFromModule(final IErlModule module,
            final String includeName, final String includePath,
            final IErlElementLocator.Scope scope) throws ErlModelException {
        final IErlElement parent = module.getParent();
        if (parent instanceof IErlFolder) {
            final IErlFolder folder = (IErlFolder) parent;
            folder.open(null);
            final IErlModule include = folder.findInclude(includeName, includePath);
            if (include != null) {
                return include;
            }
        }
        return findIncludeFromProject(ErlangEngine.getInstance().getModelUtilService()
View Full Code Here

            // ErlLogger.debug("childcount %d", children.size());
            final IErlModel model = ErlangEngine.getInstance().getModel();
            for (final IResource element : elems) {
                if (element instanceof IFolder) {
                    final IFolder folder = (IFolder) element;
                    final IErlFolder erlFolder = (IErlFolder) model.create(folder);
                    children.add(erlFolder);
                } else if (element instanceof IFile) {
                    final IFile file = (IFile) element;
                    if (CommonUtils.isErlangFileContentFileName(file.getName())) {
                        final IErlModule m = (IErlModule) model.create(file);
View Full Code Here

        final List<IErlModule> result = Lists.newArrayList();
        for (final IPath dir : dirs) {
            final IFolder folder = project.getFolder(dir);
            final IErlElement element = model.findElement(folder, true);
            if (element instanceof IErlFolder) {
                final IErlFolder erlFolder = (IErlFolder) element;
                erlFolder.open(null);
                for (final IErlElement e : erlFolder
                        .getChildrenOfKind(ErlElementKind.MODULE)) {
                    if (e instanceof IErlModule) {
                        final IErlModule m = (IErlModule) e;
                        final boolean isModule = SourceKind.nameToModuleKind(m.getName()) != SourceKind.HRL;
                        if (isModule == getModules) {
View Full Code Here

                // 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

        final IErlModel model = ErlangEngine.getInstance().getModel();
        final IErlElement childWithResource = model
                .getChildWithResource(workspaceProject);
        final IResource resource = module.getResource();
        final IErlElement childWithResource2 = model.getChildWithResource(resource);
        final IErlFolder folder = (IErlFolder) project.getChildNamed("src");
        final IErlElement childWithResource3 = folder.getChildWithResource(resource);
        assertEquals(project, childWithResource);
        assertNull(childWithResource2);
        assertEquals(module, childWithResource3);
    }
View Full Code Here

    }

    // boolean isSourcePathParent();
    @Test
    public void isSourcePathParent() throws Exception {
        final IErlFolder srcFolder2 = (IErlFolder) project2.getChildNamed("src");
        assertTrue(srcFolder2.isSourcePathParent());
        final IErlFolder includeFolder2 = (IErlFolder) project2.getChildNamed("include");
        assertFalse(includeFolder2.isSourcePathParent());
        final IErlFolder ebinFolder2 = (IErlFolder) project2.getChildNamed("ebin");
        assertFalse(ebinFolder2.isSourcePathParent());
    }
View Full Code Here

        final IErlElement element = model.findElement(resource, true);
        if (element == null) {
            return result;
        }
        if (element instanceof IErlFolder) {
            final IErlFolder folder = (IErlFolder) element;
            folder.open(null);
            result.addAll(folder.getModules());
        } else if (element instanceof IErlModule) {
            final IErlModule module = (IErlModule) element;
            result.add(module);
        } else if (element instanceof IErlProject) {
            final IErlProject project = (IErlProject) element;
View Full Code Here

TOP

Related Classes of org.erlide.engine.model.root.IErlFolder

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.