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;
}
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);
}
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;
}
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;
}
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;
}
Aggregations