Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 303705 - [search] Custom search results not shown hierarchically in the java search results view
Summary: [search] Custom search results not shown hierarchically in the java search re...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.6 M6   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-23 18:05 EST by Carsten Pfeiffer CLA
Modified: 2010-03-08 05:32 EST (History)
1 user (show)

See Also:


Attachments
Patch addressing the issue (1.48 KB, patch)
2010-02-23 18:07 EST, Carsten Pfeiffer CLA
markus.kell.r: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carsten Pfeiffer CLA 2010-02-23 18:05:26 EST
Build Identifier: M20090917-0800

Consider an instance of org.eclipse.search.ui.text.Match with an element that is neither an IResource nor an IJavaElement. It might be an element in a class diagram, for example.

When such an element is reported, it will be shown as a plain, flat element in the otherwise hierarchical java search results view. This is because the LevelTreeContentProvider and its superclasses only check for IJavaElement and IResource.

I propose to also check for IAdaptable and try to adapt to IJavaElement and IResource, if the other checks fail. I'll attach a patch.

Reproducible: Always
Comment 1 Carsten Pfeiffer CLA 2010-02-23 18:07:25 EST
Created attachment 160011 [details]
Patch addressing the issue

With this patch applied, the search results are perfectly included in the hierarchy, as long as they adapt to IResource or IJavaElement.
Comment 2 Markus Keller CLA 2010-03-08 05:31:51 EST
Thanks for the patch, released to HEAD.