Bug 210264 - Import Plug-ins and Fragments wizard: add prefix wildcard to filter field
Summary: Import Plug-ins and Fragments wizard: add prefix wildcard to filter field
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Joern Dinkla CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, contributed
Depends on:
Blocks:
 
Reported: 2007-11-19 10:51 EST by Markus Keller CLA
Modified: 2007-12-13 11:18 EST (History)
3 users (show)

See Also:


Attachments
Patch: prepend a '*' if newFilter does not start with a '*' (1.00 KB, patch)
2007-11-28 16:13 EST, Joern Dinkla CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2007-11-19 10:51:26 EST
I20071113-0800

In the 'Import Plug-ins and Fragments' wizard, my 99% use case is that I want to filter with a prefix wildcard. E.g. I want to import some JFace plug-ins, so I type "jface", wonder for a second why I get no match, and then press Home and enter "*".

Since most installs have a lot of plug-ins with the same prefix, the filter should somehow start with a "*" by default. I see two ways to implement this:
a) Implicitly prepend "*" to the user-supplied filter (like the implicit terminating "*").
b) Initialize the dialog with a "*" as filter (and the caret after the "*").

I slightly favor b), since it still gives the user the possibility to write a prefix sensitive filter pattern.
Comment 1 Chris Aniszczyk CLA 2007-11-19 11:00:52 EST
Anything for Markus :)
Comment 2 Brian Bauman CLA 2007-11-19 11:18:13 EST
For consistency, I would say lets do A.  This is how the filters work in the Manifest Editor (implicitly prepending a * to the filter field).
Comment 3 Joern Dinkla CLA 2007-11-28 16:13:29 EST
Created attachment 84017 [details]
Patch: prepend a '*' if newFilter does not start with a '*'

I added the code marked with a '+' to PluginImportWizardDetailedPage.AvailableFilter.setPattern()

		public boolean setPattern(String newPattern) {
			if (!newPattern.endsWith("*")) //$NON-NLS-1$
				newPattern += "*"; //$NON-NLS-1$
+			if (!newPattern.startsWith("*")) //$NON-NLS-1$
+				newPattern = "*" + newPattern; //$NON-NLS-1$
			if (fPattern != null) {
                        ...	

This prepends the newPattern with a '*' if it does not start with it.

Best regards,

Joern
Comment 4 Brian Bauman CLA 2007-11-29 11:12:27 EST
Nice job Joern.  Very elegant two line solution.  I applied the patch as is (though I updated the copy right to include your name :) ).  This function should be very helpful to many users, I know it will help me out.

Thanks a lot!
Comment 5 Chris Aniszczyk CLA 2007-11-29 21:28:39 EST
reopening, making sure it's assigned to Joern
Comment 6 Chris Aniszczyk CLA 2007-11-29 21:29:12 EST
Thanks!!! :D
Comment 7 Brian Bauman CLA 2007-11-30 10:35:38 EST
Sorry about not reassigning initially, was just trying to do too many things at once.  Thanks Chris.
Comment 8 Brian Bauman CLA 2007-12-13 11:18:05 EST
verified on I20071213-0010