Community
Participate
Working Groups
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.
Anything for Markus :)
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).
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
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!
reopening, making sure it's assigned to Joern
Thanks!!! :D
Sorry about not reassigning initially, was just trying to do too many things at once. Thanks Chris.
verified on I20071213-0010