Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 56b71b8e35c24cfb114128812d720eea52456bfe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*******************************************************************************
 * Copyright (c) 2009 STMicroelectronics.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Xavier Raynaud <xavier.raynaud@st.com> - initial API and implementation
 *******************************************************************************/
package org.eclipse.linuxtools.internal.gcov.view;

import java.util.LinkedList;

import org.eclipse.linuxtools.internal.gcov.model.CovFileTreeElement;
import org.eclipse.linuxtools.internal.gcov.model.CovRootTreeElement;
import org.eclipse.linuxtools.internal.gcov.model.TreeElement;




public class CovFunctionContentProvider extends CovFileContentProvider {

    public static final CovFunctionContentProvider sharedInstance = new CovFunctionContentProvider();

    /**
     * Constructor
     */
    protected CovFunctionContentProvider() {
    }

    @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;
    }


    @Override
    public Object getParent(Object element) {
        Object o = super.getParent(element);
        if (o instanceof CovFileTreeElement) {
            o = super.getParent(o);
        }
        return o;
    }

}

Back to the top