Eclipse-plugin: Can't see my results in AbstractTextSearchViewPage

Posted by Jason Kealey on Stack Overflow See other posts from Stack Overflow or by Jason Kealey
Published on 2009-07-27T19:13:38Z Indexed on 2010/05/15 11:44 UTC
Read the original article Hit count: 298

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about eclipse-plugin

Related posts about eclipse