Search in sources :

Example 1 with TreeElement

use of org.eclipse.linuxtools.internal.gcov.model.TreeElement in project linuxtools by eclipse.

the class CovFolderContentProvider method getChildren.

@Override
public Object[] getChildren(Object parentElement) {
    if (parentElement instanceof TreeElement) {
        TreeElement elem = (TreeElement) parentElement;
        LinkedList<? extends TreeElement> list = elem.getChildren();
        if (list != null)
            return list.toArray();
    }
    return null;
}
Also used : TreeElement(org.eclipse.linuxtools.internal.gcov.model.TreeElement)

Example 2 with TreeElement

use of org.eclipse.linuxtools.internal.gcov.model.TreeElement in project linuxtools by eclipse.

the class CovFunctionContentProvider method getElementChildrenList.

@Override
protected LinkedList<? extends TreeElement> getElementChildrenList(CovRootTreeElement root) {
    LinkedList<? extends TreeElement> list = super.getElementChildrenList(root);
    LinkedList<TreeElement> ret = new LinkedList<>();
    for (TreeElement histTreeElem : list) {
        LinkedList<? extends TreeElement> partialList = histTreeElem.getChildren();
        ret.addAll(partialList);
    }
    return ret;
}
Also used : LinkedList(java.util.LinkedList) CovRootTreeElement(org.eclipse.linuxtools.internal.gcov.model.CovRootTreeElement) TreeElement(org.eclipse.linuxtools.internal.gcov.model.TreeElement) CovFileTreeElement(org.eclipse.linuxtools.internal.gcov.model.CovFileTreeElement)

Example 3 with TreeElement

use of org.eclipse.linuxtools.internal.gcov.model.TreeElement in project linuxtools by eclipse.

the class FieldCoveragePercentage method compare.

@Override
public int compare(Object obj1, Object obj2) {
    TreeElement e1 = (TreeElement) obj1;
    TreeElement e2 = (TreeElement) obj2;
    float f1 = e1.getCoveragePercentage();
    float f2 = e2.getCoveragePercentage();
    return Float.compare(f1, f2);
}
Also used : CovRootTreeElement(org.eclipse.linuxtools.internal.gcov.model.CovRootTreeElement) TreeElement(org.eclipse.linuxtools.internal.gcov.model.TreeElement)

Example 4 with TreeElement

use of org.eclipse.linuxtools.internal.gcov.model.TreeElement in project linuxtools by eclipse.

the class FieldName method getValue.

@Override
public String getValue(Object obj) {
    if (obj instanceof TreeElement) {
        TreeElement e = (TreeElement) obj;
        String nm = e.getName();
        nm = nm.substring(nm.lastIndexOf('/') + 1);
        nm = nm.substring(nm.lastIndexOf('\\') + 1);
        return nm;
    }
    // $NON-NLS-1$
    return "";
}
Also used : TreeElement(org.eclipse.linuxtools.internal.gcov.model.TreeElement)

Example 5 with TreeElement

use of org.eclipse.linuxtools.internal.gcov.model.TreeElement in project linuxtools by eclipse.

the class CovFileContentProvider method getElementChildrenList.

protected LinkedList<? extends TreeElement> getElementChildrenList(CovRootTreeElement root) {
    LinkedList<TreeElement> ret = new LinkedList<>();
    LinkedList<? extends TreeElement> list = root.getChildren();
    for (TreeElement folderlist : list) {
        LinkedList<? extends TreeElement> partialList = folderlist.getChildren();
        ret.addAll(partialList);
    }
    return ret;
}
Also used : LinkedList(java.util.LinkedList) CovFolderTreeElement(org.eclipse.linuxtools.internal.gcov.model.CovFolderTreeElement) CovRootTreeElement(org.eclipse.linuxtools.internal.gcov.model.CovRootTreeElement) TreeElement(org.eclipse.linuxtools.internal.gcov.model.TreeElement)

Aggregations

TreeElement (org.eclipse.linuxtools.internal.gcov.model.TreeElement)8 CovRootTreeElement (org.eclipse.linuxtools.internal.gcov.model.CovRootTreeElement)5 LinkedList (java.util.LinkedList)2 CovFileTreeElement (org.eclipse.linuxtools.internal.gcov.model.CovFileTreeElement)2 IFile (org.eclipse.core.resources.IFile)1 IProject (org.eclipse.core.resources.IProject)1 IWorkspaceRoot (org.eclipse.core.resources.IWorkspaceRoot)1 IPath (org.eclipse.core.runtime.IPath)1 Path (org.eclipse.core.runtime.Path)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 CovFolderTreeElement (org.eclipse.linuxtools.internal.gcov.model.CovFolderTreeElement)1 CovFunctionTreeElement (org.eclipse.linuxtools.internal.gcov.model.CovFunctionTreeElement)1 CovManager (org.eclipse.linuxtools.internal.gcov.parser.CovManager)1 SourceFile (org.eclipse.linuxtools.internal.gcov.parser.SourceFile)1