added getDocApplication() that tries to find a DocApplication object among the parents of the element

This commit is contained in:
stefanp 2003-03-14 11:35:19 +00:00
parent 52405fe405
commit 744b24e34c

View file

@ -250,6 +250,21 @@ public abstract class DocElement implements IPathElement {
return arr; return arr;
} }
/**
* walks up the tree and tries to find a DocApplication object
*/
public DocApplication getDocApplication () {
DocElement el = this;
while (el != null) {
if (el instanceof DocApplication) {
return (DocApplication) el;
}
el = (DocElement) el.getParentElement ();
}
return null;
}
/** /**
* from helma.framework.IPathElement. Elements are named * from helma.framework.IPathElement. Elements are named
* like this: typename_name * like this: typename_name