Community
Participate
Working Groups
The old Open Type dialog supported searching for package patterns. To port this functionality over to the new open type dialog, search for all type names should support patterns for package/enclosing type name.
To support this, we need a new API method on SearchEngine such as: public void searchAllTypeNames( final char[] qualification, final char[] typeName, final int matchRule, int searchFor, IJavaSearchScope scope, final TypeNameRequestor nameRequestor, int waitingPolicy, IProgressMonitor progressMonitor) throws JavaModelException which supports both the qualification & typeName as patterns. We would use a QualifiedTypeDeclarationPattern instead of a TypeDeclarationPattern. NOTE: We would match the member type 'p1.A.M.Network' if supplied with 'p1.*' & 'Net*' This would be very similar to the new method searchAllTypeNames(char[][] qualifications, char[][] typeNames...) added for organize imports. See bug 84224#c17.
Do we want to do this one?
Kent, what can we do here fore 3.1 assuming that we don't do anything for bug 92266.
Basically we'd like to call these good for 3.1, and say that we revisit API for 3.2 (using object wrappers)
The problem is that the old open type dialog had the feature of being able to use wildcards in pattern names. This is currently lost functionality certain people are complaining about. So if we can do something without additional API that would be great.
Wildcard in simple name sounds fair, but in enclosing or package... do anyone use this dialog with anything other than a simple name ?
Without a new API, we cannot support wildcards in the package name. As for supporting it... with the history, why do they need wildcards in the package name? The history will give them what they want quicker.
The use case is that they don't remember the name but know that the type is in a util package. They can type *.util.* which gives them all types in all util packages.
I accept that we may be 'removing' a case that worked in the past, but I doubt too many users will notice. They can still find the type by using the search dialog with type declarations & a qualified pattern match.
Reconsider adding the API after 3.1
*** Bug 98494 has been marked as a duplicate of this bug. ***
+1 from an occasional user of this feature.
*** Bug 111799 has been marked as a duplicate of this bug. ***
Kent, is it in your plan to add this API to SearchEngine or do you want me to take it?
Check with Philippe whether we want to add it. I would vote no. If so, then its all yours.
I could imagine living without it... now if doing it, we will not do something else (thinking of some template search for instance). Also, I would imagine that one may want a different matchRule for qualification than for typeName (likely overkill). Pls check again with clients if really needed.
Personally I find (found) this feature invaluable. I used it in the way Dirk describes in Comment#8 - for example I know that there's a class that does something like I want in my code-base. I know it's called *Cache* but when I search for *Cache* I get 1600 results because of the other jars in my workspace. I can do other kinds of filtering (such as setting up a working set), which helps a bit, but it's nothing like as good as using package filtering: com.fredcorp.**.util.**.*Cache*
We had that feature in th old (two pane) Open Type dialog. Besides the case described in #17 it is useful for "quickly" browsing all classes in a package. For example "java.util.*"
Too late for this kind of change in dvpt process. Defer post 3.2, set target as 3.3 to take this bug in early 3.3 dvpt
Fix for this is now available for this problem => reopen
Created attachment 41862 [details] Proposed patch Note that fix design is: 1) Change existing searchAllTypeNames(char[], char[], int, int,...) API method contract (eg. Javadoc) to specify that packageName parameter only accepts *exact* package full name. 2) Add new searchAllTypeNames(char[], int, char[], int, int,...) API method to allow usage of a different match rule for packages/enclosing types name.
Created attachment 41868 [details] JDT/UI patch This patch needs to be applied on org.eclipse.jdt.ui project to make Open type dialog working properly with patterns in package name...
Created attachment 45087 [details] Proposed patch update Patch updated with HEAD contents + JDT/Core plugins ID update (3.3.0) + buildnotes_jdt-core.html update + exportplugin.xml script update (see bug 148174)
Released for 3.3 M1 in HEAD
*** Bug 148387 has been marked as a duplicate of this bug. ***
changed the open type dialog to use the support. thanks frederic!
Verified for 3.3 M1 using build I20060804-0010.