use of org.eclipse.search.internal.ui.text.FileSearchPage in project eclipse.platform.text by eclipse.
the class SearchResultPageTest method testTableNavigation.
@Test
public void testTableNavigation() {
NewSearchUI.runQueryInForeground(null, fQuery1);
ISearchResultViewPart view = NewSearchUI.getSearchResultView();
FileSearchPage page = (FileSearchPage) view.getActivePage();
page.setLayout(AbstractTextSearchViewPage.FLAG_LAYOUT_FLAT);
Table table = ((TableViewer) page.getViewer()).getTable();
consumeEvents();
// select the first element.
table.setSelection(0);
table.showSelection();
consumeEvents();
// back from first match, goto last
page.gotoPreviousMatch();
consumeEvents();
assertEquals(1, table.getSelectionCount());
assertEquals(table.getItemCount() - 1, table.getSelectionIndex());
// and forward again, to the first match.
page.gotoNextMatch();
consumeEvents();
assertEquals(1, table.getSelectionCount());
assertEquals(0, table.getSelectionIndex());
}
use of org.eclipse.search.internal.ui.text.FileSearchPage in project eclipse.platform.text by eclipse.
the class SearchResultPageTest method testRemoveTreeMatches.
@Test
// checkElementDisplay(..) misses cases where one line contains multiple matches
@Ignore
public void testRemoveTreeMatches() throws Exception {
NewSearchUI.runQueryInForeground(null, fQuery1);
ISearchResultViewPart view = NewSearchUI.getSearchResultView();
FileSearchPage page = (FileSearchPage) view.getActivePage();
page.setLayout(AbstractTextSearchViewPage.FLAG_LAYOUT_TREE);
AbstractTreeViewer viewer = (AbstractTreeViewer) page.getViewer();
AbstractTextSearchResult result = (AbstractTextSearchResult) fQuery1.getSearchResult();
// make sure all elements have items.
viewer.expandAll();
Object[] elements = result.getElements();
// page.setUpdateTracing(true);
for (int i = 0; i < elements.length; i++) {
Match[] matches = result.getMatches(elements[i]);
viewer.reveal(elements[i]);
for (int j = 0; j < matches.length; j++) {
checkElementDisplay(viewer, result, elements[i]);
result.removeMatch(matches[j]);
consumeEvents(page);
}
}
// page.setUpdateTracing(false);
}
use of org.eclipse.search.internal.ui.text.FileSearchPage in project eclipse.platform.text by eclipse.
the class SearchResultPageTest method testBasicDisplay.
@Test
@Ignore
public void testBasicDisplay() throws Exception {
NewSearchUI.runQueryInForeground(null, fQuery1);
ISearchResultViewPart view = NewSearchUI.getSearchResultView();
FileSearchPage page = (FileSearchPage) view.getActivePage();
page.setLayout(AbstractTextSearchViewPage.FLAG_LAYOUT_TREE);
checkViewerDisplay(page);
page.setLayout(AbstractTextSearchViewPage.FLAG_LAYOUT_FLAT);
checkViewerDisplay(page);
}
Aggregations