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());
}
Aggregations