use of org.eclipse.linuxtools.internal.gprof.view.histogram.HistRoot 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.HistRoot in project linuxtools by eclipse.
the class CallGraphContentProvider method getElements.
@Override
public Object[] getElements(Object inputElement) {
if (inputElement instanceof GmonDecoder) {
GmonDecoder obj = (GmonDecoder) inputElement;
HistRoot root = obj.getRootNode();
return new Object[] { root };
}
return new Object[0];
}
use of org.eclipse.linuxtools.internal.gprof.view.histogram.HistRoot in project linuxtools by eclipse.
the class FileHistogramContentProvider method getElements.
@Override
public Object[] getElements(Object inputElement) {
if (inputElement instanceof GmonDecoder) {
GmonDecoder obj = (GmonDecoder) inputElement;
HistRoot root = obj.getRootNode();
return new Object[] { root };
}
return new Object[0];
}
use of org.eclipse.linuxtools.internal.gprof.view.histogram.HistRoot in project linuxtools by eclipse.
the class HistogramDecoder method addBucket.
private void addBucket(Bucket b, ISymbol s) {
HistRoot root = this.decoder.getRootNode();
root.addBucket(b, s, decoder.getProgram());
}
use of org.eclipse.linuxtools.internal.gprof.view.histogram.HistRoot 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