Search in sources :

Example 1 with IParent

use of org.erlide.engine.model.IParent in project erlide_eclipse by erlang.

the class ErlModel method createFolder.

public IErlFolder createFolder(final IFolder folder, final IParent parent) {
    if (folder == null) {
        return null;
    }
    final IErlFolder f = new ErlFolder(folder, parent);
    final IParent p = parent;
    if (p != null) {
        p.addChild(f);
    } else {
    // ErlLogger.warn("creating folder %s in null parent?!", folder
    // .getName());
    }
    return f;
}
Also used : IParent(org.erlide.engine.model.IParent) ErlFolder(org.erlide.engine.internal.model.root.ErlFolder) IErlFolder(org.erlide.engine.model.root.IErlFolder) IErlFolder(org.erlide.engine.model.root.IErlFolder)

Example 2 with IParent

use of org.erlide.engine.model.IParent in project erlide_eclipse by erlang.

the class ErlModel method findIncludeFromModule.

@Override
public IErlModule findIncludeFromModule(final IErlModule module, final String includeName, final String includePath, final IErlElementLocator.Scope scope) throws ErlModelException {
    final IParent 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().getProject(module), includeName, includePath, true, scope);
}
Also used : IParent(org.erlide.engine.model.IParent) IErlFolder(org.erlide.engine.model.root.IErlFolder) IErlModule(org.erlide.engine.model.root.IErlModule)

Example 3 with IParent

use of org.erlide.engine.model.IParent in project erlide_eclipse by erlang.

the class ModelInternalUtils method isOtpModule.

@Override
public boolean isOtpModule(final IErlModule module) {
    IParent parent = module.getParent();
    while (parent instanceof IErlExternal) {
        final IErlExternal external = (IErlExternal) parent;
        if (external.isOTP()) {
            return true;
        }
        parent = external.getParent();
    }
    return false;
}
Also used : IErlExternal(org.erlide.engine.model.root.IErlExternal) IParent(org.erlide.engine.model.IParent)

Example 4 with IParent

use of org.erlide.engine.model.IParent in project erlide_eclipse by erlang.

the class ModelInternalUtils method getIncludeLibPath.

private String getIncludeLibPath(final IErlModule module) {
    String s = module.getName();
    String prevS = s;
    IErlElement e = module;
    for (; ; ) {
        final IParent p = e.getParent();
        if (p instanceof IErlProject) {
            break;
        }
        e = (IErlElement) p;
        prevS = s;
        s = e.getName() + "/" + s;
    }
    return prevS;
}
Also used : IErlElement(org.erlide.engine.model.IErlElement) IErlProject(org.erlide.engine.model.root.IErlProject) IParent(org.erlide.engine.model.IParent)

Example 5 with IParent

use of org.erlide.engine.model.IParent in project erlide_eclipse by erlang.

the class ErlStructureCreator method recursiveMakeErlNodes.

private ErlNode recursiveMakeErlNodes(final IErlElement element, final ErlNode parent, final IDocument doc) throws ErlModelException {
    final ErlNode n = ErlNode.createErlNode(parent, element, doc);
    if (element instanceof IOpenable) {
        final IOpenable o = (IOpenable) element;
        o.open(null);
    }
    if (element instanceof IParent) {
        final IParent p = (IParent) element;
        final Collection<IErlElement> children = p.getChildren();
        for (final IErlElement child : children) {
            recursiveMakeErlNodes(child, n, doc);
        }
    }
    return n;
}
Also used : IErlElement(org.erlide.engine.model.IErlElement) IOpenable(org.erlide.engine.model.root.IOpenable) IParent(org.erlide.engine.model.IParent)

Aggregations

IParent (org.erlide.engine.model.IParent)24 IErlElement (org.erlide.engine.model.IErlElement)18 IErlModule (org.erlide.engine.model.root.IErlModule)10 IOpenable (org.erlide.engine.model.root.IOpenable)8 IResource (org.eclipse.core.resources.IResource)5 ErlModelException (org.erlide.engine.model.ErlModelException)5 IErlProject (org.erlide.engine.model.root.IErlProject)3 OtpErlangObject (com.ericsson.otp.erlang.OtpErlangObject)2 HashSet (java.util.HashSet)2 IFile (org.eclipse.core.resources.IFile)2 IProject (org.eclipse.core.resources.IProject)2 IPath (org.eclipse.core.runtime.IPath)2 IErlExternal (org.erlide.engine.model.root.IErlExternal)2 IErlFolder (org.erlide.engine.model.root.IErlFolder)2 ErlSearchScope (org.erlide.engine.services.search.ErlSearchScope)2 OtpErlangString (com.ericsson.otp.erlang.OtpErlangString)1 Stopwatch (com.google.common.base.Stopwatch)1 IFileInfo (org.eclipse.core.filesystem.IFileInfo)1 IFileStore (org.eclipse.core.filesystem.IFileStore)1 IContainer (org.eclipse.core.resources.IContainer)1