Search in sources :

Example 31 with TreeSelection

use of org.eclipse.jface.viewers.TreeSelection in project linuxtools by eclipse.

the class ExpandCollapseTest method testCollapse.

@Test
public void testCollapse() throws Exception {
    // Expand the element first
    testExpand();
    // Then collapse it
    IValgrindMessage[] messages = (IValgrindMessage[]) viewer.getTreeViewer().getInput();
    IValgrindMessage element = messages[0];
    TreeSelection selection = new TreeSelection(new TreePath(new Object[] { element }));
    viewer.getTreeViewer().setSelection(selection);
    contextMenu.notifyListeners(SWT.Show, null);
    contextMenu.getItem(1).notifyListeners(SWT.Selection, null);
    checkExpanded(element, false);
}
Also used : IValgrindMessage(org.eclipse.linuxtools.valgrind.core.IValgrindMessage) TreePath(org.eclipse.jface.viewers.TreePath) TreeSelection(org.eclipse.jface.viewers.TreeSelection) Test(org.junit.Test)

Aggregations

TreeSelection (org.eclipse.jface.viewers.TreeSelection)31 TreePath (org.eclipse.jface.viewers.TreePath)12 ISelection (org.eclipse.jface.viewers.ISelection)7 TreeViewer (org.eclipse.jface.viewers.TreeViewer)6 Test (org.junit.Test)6 DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)4 IDoubleClickListener (org.eclipse.jface.viewers.IDoubleClickListener)4 ITreeSelection (org.eclipse.jface.viewers.ITreeSelection)4 IValgrindMessage (org.eclipse.linuxtools.valgrind.core.IValgrindMessage)4 ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)3 ValgrindViewPart (org.eclipse.linuxtools.internal.valgrind.ui.ValgrindViewPart)3 UiModelSession (org.eclipse.linuxtools.oprofile.ui.model.UiModelSession)3 ISchemaNode (com.cubrid.common.ui.spi.model.ISchemaNode)2 ArrayList (java.util.ArrayList)2 Iterator (java.util.Iterator)2 List (java.util.List)2 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)2 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)2 CachegrindViewPart (org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart)2 CachegrindOutput (org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindOutput)2