use of org.eclipse.linuxtools.internal.gprof.view.histogram.HistFunction in project linuxtools by eclipse.
the class CallGraphContentProvider method hasChildren.
@Override
public boolean hasChildren(Object parentElement) {
if (parentElement instanceof HistRoot) {
HistRoot root = (HistRoot) parentElement;
LinkedList<? extends TreeElement> ret = getFunctionChildrenList(root);
return !ret.isEmpty();
}
if (parentElement instanceof HistFunction) {
HistFunction function = (HistFunction) parentElement;
CGCategory parents = function.getParentsFunctions();
CGCategory children = function.getChildrenFunctions();
return (parents != null || children != null);
}
if (parentElement instanceof CGCategory) {
CGCategory cat = (CGCategory) parentElement;
return !cat.getChildren().isEmpty();
}
return false;
}
use of org.eclipse.linuxtools.internal.gprof.view.histogram.HistFunction in project linuxtools by eclipse.
the class CallGraphContentProvider method getChildren.
@Override
public Object[] getChildren(Object parentElement) {
if (parentElement instanceof HistRoot) {
HistRoot root = (HistRoot) parentElement;
LinkedList<? extends TreeElement> ret = getFunctionChildrenList(root);
return ret.toArray();
}
if (parentElement instanceof HistFunction) {
HistFunction function = (HistFunction) parentElement;
CGCategory parents = function.getParentsFunctions();
CGCategory children = function.getChildrenFunctions();
if (parents == null) {
if (children == null)
return new Object[0];
return new Object[] { children };
} else if (children == null) {
return new Object[] { parents };
} else {
return new Object[] { parents, children };
}
}
if (parentElement instanceof CGCategory) {
CGCategory cat = (CGCategory) parentElement;
return cat.getChildren().toArray();
}
return null;
}
Aggregations