Bug 203792 - [Preferences] preference pages filter should support multiple keywords
Summary: [Preferences] preference pages filter should support multiple keywords
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC All
: P3 normal with 1 vote (vote)
Target Milestone: 4.8 M4   Edit
Assignee: Lucas Bullen CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
: 515457 (view as bug list)
Depends on: 534277
Blocks: 515457
  Show dependency tree
 
Reported: 2007-09-18 10:46 EDT by Markus Keller CLA
Modified: 2018-05-23 11:10 EDT (History)
5 users (show)

See Also:


Attachments
Proposed patch (5.49 KB, patch)
2009-09-23 17:36 EDT, Dina Sayed CLA
no flags Details | Diff
Proposed patch (12.23 KB, text/plain)
2009-10-02 07:25 EDT, Dina Sayed CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2007-09-18 10:46:12 EDT
I20070918-0010

The filter field in the Preferences dialog should support multiple keywords. Today, it e.g. finds a page with filter "java editor templates snippet macros", because that's the sequence of keywords defined for that page.

However, it should also find the page with filters "template java", "java snippet", etc.
Comment 1 Susan McCourt CLA 2009-07-09 19:29:05 EDT
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Comment 2 Dina Sayed CLA 2009-09-23 17:36:09 EDT
Created attachment 147936 [details]
Proposed patch

This is an early draft patch to propose an enhancement for the current filtering for the preference page.
Comment 3 Oleg Besedin CLA 2009-09-24 11:04:14 EDT
It seems to work fine if I don't use wildcards, but as you mentioned, it breaks down in many cases when whildcards are used:

- If I have an asterisk in the middle: "editor java" - many matches; "e*r java" - no matches
- If I have a '?': "editor java" - many matches; "edito? java" - no matches
- if I have a leading space: "editor" - many matches; " editor" - no matches

The StringMatcher#parseWildCards() parses the pattern into segments, something like:

pattern => 
[leading *] | [segment1 *] | [segment2 *] | ... [segmentN] | [trailing *]

I think that while this parsing is done, it needs to parse word separators adding a level on top of this structure:

pattern => word1 [| word2] ... [| wordN]

where each word is 
[leading *] | [segment1 *] | [segment2 *] | ... [segmentN] | [trailing *]
Comment 4 Dina Sayed CLA 2009-10-02 07:25:23 EDT
Created attachment 148630 [details]
Proposed patch

Thanks for the advice!
Comment 5 Eclipse Genie CLA 2017-09-27 17:21:22 EDT
New Gerrit change created: https://git.eclipse.org/r/105884
Comment 7 Lars Vogel CLA 2017-10-20 05:18:01 EDT
Awesome, thanks Dina and Lucas. 

Dina, we are very sorry that it took us sooooo long to integrate your patch. Thanks to Lucas for picking it up and pushing it to Gerrit.

Lucas, can you add a N&N to M3?
Comment 8 Dani Megert CLA 2017-10-21 05:02:08 EDT
Pretty sure this causes the new test failure we have on all platforms:
http://download.eclipse.org/eclipse/downloads/drops4/I20171020-2000/testresults/html/org.eclipse.ui.tests_ep48I-unit-win32_win32.win32.x86_8.0.html


Looks like it filters too much now.


assertion failed: tree item count 0 does not match expected: 1

org.eclipse.core.runtime.AssertionFailedException: assertion failed: tree item count 0 does not match expected: 1
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
at org.eclipse.ui.tests.filteredtree.FilteredTreeTests.assertNumberOfTopLevelItems(FilteredTreeTests.java:182)
at org.eclipse.ui.tests.filteredtree.FilteredTreeTests.testAddAndRemovePattern(FilteredTreeTests.java:117)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:726)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:348)
at org.eclipse.test.UITestApplication.lambda$0(UITestApplication.java:195)
at org.eclipse.test.UITestApplication$$Lambda$304/31470062.run(Unknown Source)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:37)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4213)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3820)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
at org.eclipse.ui.internal.Workbench$$Lambda$19/27798799.run(Unknown Source)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
at org.eclipse.test.UITestApplication.runApplication(UITestApplication.java:139)
at org.eclipse.test.UITestApplication.run(UITestApplication.java:61)
at org.eclipse.test.UITestApplication.start(UITestApplication.java:210)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
at org.eclipse.core.launcher.Main.main(Main.java:34)
Comment 9 Dani Megert CLA 2017-10-21 05:05:10 EDT
(In reply to Dani Megert from comment #8)
> Pretty sure this causes the new test failure we have on all platforms:
> http://download.eclipse.org/eclipse/downloads/drops4/I20171020-2000/testresults/html/org.eclipse.ui.tests_ep48I-unit-win32_win32.win32.x86_8.0.html

Why did you not wait for Hudson on the change? It reports a test failure:
https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/13719/
Comment 10 Lars Vogel CLA 2017-10-21 08:36:58 EDT
Lucas, can you have a look at the test failure?
Comment 11 Eclipse Genie CLA 2017-10-22 08:05:30 EDT
New Gerrit change created: https://git.eclipse.org/r/110487
Comment 16 Lars Vogel CLA 2017-11-07 10:34:17 EST
(In reply to Dani Megert from comment #15)
> Please either take a look or revert the changes.

AFAICS Lucas and Alex worked today on this.

https://git.eclipse.org/r/#/c/110987/4/tests/org.eclipse.ui.tests/Eclipse+UI+Tests/org/eclipse/ui/tests/dialogs/ResourceItemLabelTest.java
Comment 17 Lucas Bullen CLA 2017-11-08 08:18:49 EST
Looks as if the last patch fixed the failing tests. Seems as if it was an issue with not giving enough time for the Open Resource view to update it's cache.

http://download.eclipse.org/eclipse/downloads/drops4/I20171107-2000/testResults.php
Comment 18 Lucas Bullen CLA 2017-11-27 14:05:05 EST
Re-closing this bug as the failing test has stopped failing
Comment 19 Alexander Kurtakov CLA 2018-05-16 11:20:51 EDT
Is it expected to show all pages that match one of the keywords ? I think we should change it when there are multiple keywords to show only patches that match all of them.
Comment 20 Dani Megert CLA 2018-05-16 11:27:44 EDT
(In reply to Alexander Kurtakov from comment #19)
> Is it expected to show all pages that match one of the keywords ? I think we
> should change it when there are multiple keywords to show only patches that
> match all of them.

I assume with "patches" you meant "pages" ;-). Any "yes", I agree with you.
Comment 21 Dani Megert CLA 2018-05-23 10:13:56 EDT
(In reply to Dani Megert from comment #20)
> (In reply to Alexander Kurtakov from comment #19)
> > Is it expected to show all pages that match one of the keywords ? I think we
> > should change it when there are multiple keywords to show only patches that
> > match all of them.
> 
> I assume with "patches" you meant "pages" ;-). Any "yes", I agree with you.

I think this is now how it works after fixing bug 534277.
Comment 22 Dani Megert CLA 2018-05-23 11:10:59 EDT
*** Bug 515457 has been marked as a duplicate of this bug. ***