Search in sources :

Example 1 with CachegrindLabelProvider

use of org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindLabelProvider in project linuxtools by eclipse.

the class CModelLabelsTest method checkLabelProvider.

private static void checkLabelProvider(TreeViewer viewer, TreePath path, ICachegrindElement element) {
    // expand only the interesting item
    viewer.expandToLevel(element, AbstractTreeViewer.ALL_LEVELS);
    TreeSelection selection = new TreeSelection(path);
    viewer.setSelection(selection);
    TreeItem item = viewer.getTree().getSelection()[0];
    // ensure the CElementLabelProvider is called correctly
    CElementLabelProvider provider = ((CachegrindLabelProvider) viewer.getLabelProvider(0)).getCLabelProvider();
    assertEquals(provider.getText(element.getModel()), item.getText());
    assertEquals(provider.getImage(element.getModel()), item.getImage());
}
Also used : CachegrindLabelProvider(org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindLabelProvider) TreeItem(org.eclipse.swt.widgets.TreeItem) TreeSelection(org.eclipse.jface.viewers.TreeSelection) CElementLabelProvider(org.eclipse.cdt.ui.CElementLabelProvider)

Aggregations

CElementLabelProvider (org.eclipse.cdt.ui.CElementLabelProvider)1 TreeSelection (org.eclipse.jface.viewers.TreeSelection)1 CachegrindLabelProvider (org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindLabelProvider)1 TreeItem (org.eclipse.swt.widgets.TreeItem)1