Search in sources :

Example 1 with MassifTreeViewer

use of org.eclipse.linuxtools.internal.valgrind.massif.MassifTreeViewer in project linuxtools by eclipse.

the class DoubleClickTest method doDoubleClick.

private void doDoubleClick() {
    MassifViewPart view = (MassifViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
    MassifTreeViewer treeViewer = view.getTreeViewer();
    MassifSnapshot[] snapshots = view.getSnapshots();
    // first detailed
    node = snapshots[1].getRoot();
    TreePath path = new TreePath(new Object[] { node });
    while (node.getChildren().length > 0 && !node.hasSourceFile()) {
        node = node.getChildren()[0];
        path = path.createChildPath(node);
    }
    assertTrue(node.hasSourceFile());
    treeViewer.getViewer().expandToLevel(node, AbstractTreeViewer.ALL_LEVELS);
    TreeSelection selection = new TreeSelection(path);
    // do double click
    IDoubleClickListener listener = treeViewer.getDoubleClickListener();
    listener.doubleClick(new DoubleClickEvent(treeViewer.getViewer(), selection));
}
Also used : MassifTreeViewer(org.eclipse.linuxtools.internal.valgrind.massif.MassifTreeViewer) TreePath(org.eclipse.jface.viewers.TreePath) TreeSelection(org.eclipse.jface.viewers.TreeSelection) IDoubleClickListener(org.eclipse.jface.viewers.IDoubleClickListener) MassifSnapshot(org.eclipse.linuxtools.internal.valgrind.massif.MassifSnapshot) DoubleClickEvent(org.eclipse.jface.viewers.DoubleClickEvent) MassifViewPart(org.eclipse.linuxtools.internal.valgrind.massif.MassifViewPart)

Aggregations

DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)1 IDoubleClickListener (org.eclipse.jface.viewers.IDoubleClickListener)1 TreePath (org.eclipse.jface.viewers.TreePath)1 TreeSelection (org.eclipse.jface.viewers.TreeSelection)1 MassifSnapshot (org.eclipse.linuxtools.internal.valgrind.massif.MassifSnapshot)1 MassifTreeViewer (org.eclipse.linuxtools.internal.valgrind.massif.MassifTreeViewer)1 MassifViewPart (org.eclipse.linuxtools.internal.valgrind.massif.MassifViewPart)1