Search in sources :

Example 11 with IOpenable

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

the class SourceRefElement method getOpenableParent.

/**
 * Return the first instance of IOpenable in the hierarchy of this type
 * (going up the hierarchy from this type);
 */
@Override
public IOpenable getOpenableParent() {
    IParent parent = getParent();
    while (parent != null) {
        if (parent instanceof IOpenable) {
            return (IOpenable) parent;
        }
        if (parent instanceof IErlElement) {
            final IErlElement parentElement = (IErlElement) parent;
            parent = parentElement.getParent();
        } else {
            break;
        }
    }
    return null;
}
Also used : IErlElement(org.erlide.engine.model.IErlElement) IOpenable(org.erlide.engine.model.root.IOpenable) IParent(org.erlide.engine.model.IParent)

Aggregations

IOpenable (org.erlide.engine.model.root.IOpenable)11 IErlElement (org.erlide.engine.model.IErlElement)10 IParent (org.erlide.engine.model.IParent)8 ErlModelException (org.erlide.engine.model.ErlModelException)7 IErlModule (org.erlide.engine.model.root.IErlModule)5 IProject (org.eclipse.core.resources.IProject)2 IErlElementVisitor (org.erlide.engine.model.IErlElementVisitor)2 OtpErlangString (com.ericsson.otp.erlang.OtpErlangString)1 Stopwatch (com.google.common.base.Stopwatch)1 IFile (org.eclipse.core.resources.IFile)1 IResource (org.eclipse.core.resources.IResource)1 IPath (org.eclipse.core.runtime.IPath)1 IErlExternalRoot (org.erlide.engine.model.root.IErlExternalRoot)1 IErlModel (org.erlide.engine.model.root.IErlModel)1 IErlProject (org.erlide.engine.model.root.IErlProject)1