Eclipse-plugin: Can't see my results in AbstractTextSearchViewPage
- by Jason Kealey
I've implemented a ISearchQuery and ISearchResult. They get loaded into my class that extends AbstractTextSearchViewPage. I'm using some code taken from the FileSearchPage to show the results in both a TreeViewer and a TableViewer.
protected void configureTableViewer(TableViewer viewer)
{
viewer.setUseHashlookup(true);
FileLabelProvider innerLabelProvider = new FileLabelProvider(this, FileLabelProvider.SHOW_LABEL_PATH);
viewer.setLabelProvider(new DecoratingLabelProvider(innerLabelProvider, PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()));
viewer.setContentProvider(new UrnTableContentProvider(this));
viewer.setComparator(new DecoratorIgnoringViewerSorter(innerLabelProvider));
fContentProvider = (IFileSearchContentProvider) viewer.getContentProvider();
}
protected void configureTreeViewer(TreeViewer viewer)
{
viewer.setUseHashlookup(true);
FileLabelProvider innerLabelProvider = new FileLabelProvider(this, FileLabelProvider.SHOW_LABEL_PATH);
viewer.setLabelProvider(new DecoratingLabelProvider(innerLabelProvider, PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()));
viewer.setContentProvider(new UrnTreeContentProvider(this, viewer));
viewer.setComparator(new DecoratorIgnoringViewerSorter(innerLabelProvider));
fContentProvider = (IFileSearchContentProvider) viewer.getContentProvider();
}
When searching using the regular file search, each individual result is visible under the file and the label says "(X matches)". In my own editor, however, I only see the file with X matches found inside that file, but I don't see the details in either the TreeViewer or the TableViewer. Any tips?