Bug 81498

Summary: [search] ITypeNameRequestor should support enums and annotations as well
Product: [Eclipse Project] JDT Reporter: Dirk Baeumer <dirk_baeumer>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: martinae
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 81366    
Attachments:
Description Flags
TypeNameRequestor.java
none
New version for TypeNameRequestor none

Description Dirk Baeumer CLA 2004-12-17 04:54:58 EST
To render the correct icon for enums and annotations in the Open Type dialog the
search engine has to report this information via the ITypeNameRequestor.
Comment 1 Jerome Lanneluc CLA 2004-12-17 05:37:41 EST
Unfortunately since clients implement this interface, we cannot modify it. We
should deprecate it and replace it with a class with a default behavior.
Comment 2 Frederic Fusier CLA 2004-12-29 05:13:53 EST
Detection of circular annotations does not blocks the implementation of this
enhancement => remove dependency.
Comment 3 Martin Aeschlimann CLA 2005-01-04 11:39:21 EST
It would be nice if the new API would just return the modifier flags and solve
bug 36896 as well.
Comment 4 Frederic Fusier CLA 2005-03-09 13:00:29 EST
Dirk,

Proposal to match your requirement would be to have a new class
org.eclipse.jdt.core.search.TypeNameRequestor. I'll attach it to this bug to
make its review easier...

Of course interface ITypeNameRequestor would be deprecated and SearchEngine will
continue to assume its use transparently.

I've verified that's assumption was true by running all JDT/UI tests with new
implementation and got no error :-)
Comment 5 Frederic Fusier CLA 2005-03-09 13:02:11 EST
Created attachment 18593 [details]
TypeNameRequestor.java

Let me know asap if this class matches your requirement, thx
Comment 6 Dirk Baeumer CLA 2005-03-10 07:08:57 EST
Frederic, can you clarify on the parameter

@param access the restriction access for the type. <code>null</code> means no
restriction.

Comment 7 Frederic Fusier CLA 2005-03-10 10:20:54 EST
Sorry, AccessRestriction is currently JDT/Core internal, so it should never be
presented in this API... You can forget it.
Comment 8 Dirk Baeumer CLA 2005-03-10 12:35:11 EST
Then the API is fine with me.
Comment 9 Frederic Fusier CLA 2005-03-11 04:47:44 EST
Created attachment 18687 [details]
New version for TypeNameRequestor

Internal parameter access restriction removed + Update modifiers param javadoc
Comment 10 Frederic Fusier CLA 2005-03-11 04:54:23 EST
Fixed.

TypeNameRequestor now replaces deprecated ITypeNameRequestor.

[jdt-core-internal]
No specific test cases added, just keep OldSearchTests using deprecated
interface to verify that search engine assume backward compatibility and modify
all other clients to use new class...
Comment 11 Olivier Thomann CLA 2005-03-30 15:14:28 EST
Verified in I20050330-0500
Comment 12 Olivier Thomann CLA 2005-03-30 15:14:35 EST
Verified in I20050330-0500