Search in sources :

Example 1 with CoreMessagesViewer

use of org.eclipse.linuxtools.internal.valgrind.ui.CoreMessagesViewer in project linuxtools by eclipse.

the class LinkedResourceDoubleClickTest method doDoubleClick.

private void doDoubleClick() {
    ValgrindViewPart view = ValgrindUIPlugin.getDefault().getView();
    CoreMessagesViewer viewer = view.getMessagesViewer();
    // get first leaf
    IValgrindMessage[] elements = (IValgrindMessage[]) viewer.getTreeViewer().getInput();
    IValgrindMessage element = elements[0];
    TreePath path = new TreePath(new Object[] { element });
    frame = null;
    while (element.getChildren().length > 0) {
        element = element.getChildren()[0];
        path = path.createChildPath(element);
        if (element instanceof ValgrindStackFrame) {
            frame = (ValgrindStackFrame) element;
        }
    }
    assertNotNull(frame);
    viewer.getTreeViewer().expandToLevel(frame, AbstractTreeViewer.ALL_LEVELS);
    TreeSelection selection = new TreeSelection(path);
    // do double click
    IDoubleClickListener listener = viewer.getDoubleClickListener();
    listener.doubleClick(new DoubleClickEvent(viewer.getTreeViewer(), selection));
}
Also used : ValgrindViewPart(org.eclipse.linuxtools.internal.valgrind.ui.ValgrindViewPart) IValgrindMessage(org.eclipse.linuxtools.valgrind.core.IValgrindMessage) TreePath(org.eclipse.jface.viewers.TreePath) TreeSelection(org.eclipse.jface.viewers.TreeSelection) ValgrindStackFrame(org.eclipse.linuxtools.internal.valgrind.core.ValgrindStackFrame) IDoubleClickListener(org.eclipse.jface.viewers.IDoubleClickListener) DoubleClickEvent(org.eclipse.jface.viewers.DoubleClickEvent) CoreMessagesViewer(org.eclipse.linuxtools.internal.valgrind.ui.CoreMessagesViewer)

Example 2 with CoreMessagesViewer

use of org.eclipse.linuxtools.internal.valgrind.ui.CoreMessagesViewer in project linuxtools by eclipse.

the class DoubleClickTest method doDoubleClick.

private void doDoubleClick() {
    ValgrindViewPart view = ValgrindUIPlugin.getDefault().getView();
    CoreMessagesViewer viewer = view.getMessagesViewer();
    // get first leaf
    IValgrindMessage[] elements = (IValgrindMessage[]) viewer.getTreeViewer().getInput();
    IValgrindMessage element = elements[0];
    TreePath path = new TreePath(new Object[] { element });
    frame = null;
    while (element.getChildren().length > 0) {
        element = element.getChildren()[0];
        path = path.createChildPath(element);
        if (element instanceof ValgrindStackFrame) {
            frame = (ValgrindStackFrame) element;
        }
    }
    assertNotNull(frame);
    viewer.getTreeViewer().expandToLevel(frame, AbstractTreeViewer.ALL_LEVELS);
    TreeSelection selection = new TreeSelection(path);
    // do double click
    IDoubleClickListener listener = viewer.getDoubleClickListener();
    listener.doubleClick(new DoubleClickEvent(viewer.getTreeViewer(), selection));
}
Also used : ValgrindViewPart(org.eclipse.linuxtools.internal.valgrind.ui.ValgrindViewPart) IValgrindMessage(org.eclipse.linuxtools.valgrind.core.IValgrindMessage) TreePath(org.eclipse.jface.viewers.TreePath) TreeSelection(org.eclipse.jface.viewers.TreeSelection) ValgrindStackFrame(org.eclipse.linuxtools.internal.valgrind.core.ValgrindStackFrame) IDoubleClickListener(org.eclipse.jface.viewers.IDoubleClickListener) DoubleClickEvent(org.eclipse.jface.viewers.DoubleClickEvent) CoreMessagesViewer(org.eclipse.linuxtools.internal.valgrind.ui.CoreMessagesViewer)

Aggregations

DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)2 IDoubleClickListener (org.eclipse.jface.viewers.IDoubleClickListener)2 TreePath (org.eclipse.jface.viewers.TreePath)2 TreeSelection (org.eclipse.jface.viewers.TreeSelection)2 ValgrindStackFrame (org.eclipse.linuxtools.internal.valgrind.core.ValgrindStackFrame)2 CoreMessagesViewer (org.eclipse.linuxtools.internal.valgrind.ui.CoreMessagesViewer)2 ValgrindViewPart (org.eclipse.linuxtools.internal.valgrind.ui.ValgrindViewPart)2 IValgrindMessage (org.eclipse.linuxtools.valgrind.core.IValgrindMessage)2