Community
Participate
Working Groups
In the Import or Export Wizard dialog, within a given category, if you have a PatternFilter allowing one wizard through and a WizardActivityFilter allowing a different wizard through, then the category remains in the display, though empty. I noticed that NewWizardNewPage does also use PatternFilter and WizardActivityFilter, but it also has one last filter WizardEmptyFolderFilter. Adding this filter to ImportExportPage does indeed seem to fix the problem.
Could you please add the steps to reproduce the issue or attach sample project that shows it? thanks, Daniel
I couldn't find a reproducible case in stock Eclipse. Hopefully a more explicit example will help. For us the bug shows up because we have a Capability filter hiding certain wizards. Say you have an import wizard category containing two wizards, named 'Inactive Wizard' and 'Active Wizard', with 'Inactive Wizard' hidden by capability. If I then type 'Inactive' in the dialog filter text box, the category containing the two is shown but it is empty. It appears that the category folder is allowed to appear because every filter on its children passes at least one child, with the capability filter letting through 'Active Wizard' and PatternFilter letting through 'Inactive Wizard'.
Created attachment 233027 [details] Sample project with the considered issue
Created attachment 233029 [details] Normal state
Created attachment 233030 [details] Considered issue
I've attached the sample project where the issue was recreated. Steps to reproduce it: 1) Run attached plugin 2) Open dialog with the 'Show wizards' toolbar button. You should see the dialog with the content presented by the 'Normal state' attachment. If not, press the 'Modify activity' button to apply the proper Capability filter. 3) Using filter text box enter some wizard's name that is hidden by the filter, the 'file' one for instance 4) You should get the dialog's content with the issue. See the 'Considered issue' attachment. I'll continue the investigation of the issue, Daniel
Yup, that's it. I thought I would add a patch for the one line fix I mentioned, but now I see that WizardEmptyFolderFilter is a class that we added to our version of the platform code. This means that the headline for this bug should be extended to include the New Project Wizard.
Is this a regression? I don't see why/how this qualifies for a backport.
(In reply to comment #8) > Is this a regression? I don't see why/how this qualifies for a backport. I've just checked it in the Eclipse 3.8 and it doesn't work there either. So it looks like it was always broken Daniel
(In reply to comment #6) > I've attached the sample project where the issue was recreated. Steps to > reproduce it: > > 1) Run attached plugin > > 2) Open dialog with the 'Show wizards' toolbar button. You should see the > dialog with the content presented by the 'Normal state' attachment. If not, > press the 'Modify activity' button to apply the proper Capability filter. I cannot reproduce this. When I 1. import the plug-in into my dev workspace 2. and launch target with new workspace 3. close Welcome 4. click 'Show wizards' I see picture1 5. click 'Modify activity' ==> picture1 > > 3) Using filter text box enter some wizard's name that is hidden by the > filter, the 'file' one for instance > > 4) You should get the dialog's content with the issue. See the 'Considered > issue' attachment. When I do this, all looks good, see picture2.
Created attachment 233485 [details] picture1
Created attachment 233486 [details] picture2
(In reply to comment #12) > Created attachment 233486 [details] > picture2 Let's try with the following wizards dialog: File/New/Other... You should get the issue using it as well Daniel
(In reply to comment #13) > (In reply to comment #12) > > Created attachment 233486 [details] > > picture2 > > Let's try with the following wizards dialog: File/New/Other... > You should get the issue using it as well > > Daniel Yep, that does the trick, but your 'Show wizards' does not seem to work.
(In reply to comment #14) > (In reply to comment #13) > > (In reply to comment #12) > > > Created attachment 233486 [details] > > > picture2 > > > > Let's try with the following wizards dialog: File/New/Other... > > You should get the issue using it as well > > > > Daniel > > Yep, that does the trick, but your 'Show wizards' does not seem to work. Adding a WizardEmptyFolderFilter [1] to the NewWizardNewPage fixes that particular problem. Either we have to add it to all affected wizards or we find a common place to add the filter. For that, we should have steps / test cases for each individual wizard/problem, so that the fix can be verified. [1] WizardEmptyFolderFilter private class WizardEmptyFolderFilter extends ViewerFilter { public boolean select(Viewer viewer, Object parentElement, Object element) { if (element instanceof WizardCollectionElement) { WizardCollectionElement wce = (WizardCollectionElement) element; return wce.getChildren().length > 0; } return true; } }
(In reply to comment #15) > (In reply to comment #14) > > (In reply to comment #13) > > > (In reply to comment #12) > > > > Created attachment 233486 [details] > > > > picture2 > > > > > > Let's try with the following wizards dialog: File/New/Other... > > > You should get the issue using it as well > > > > > > Daniel > > > > Yep, that does the trick, but your 'Show wizards' does not seem to work. > > Adding a WizardEmptyFolderFilter [1] to the NewWizardNewPage fixes that > particular problem. Either we have to add it to all affected wizards or we > find a common place to add the filter. For that, we should have steps / test > cases for each individual wizard/problem, so that the fix can be verified. > > [1] WizardEmptyFolderFilter > private class WizardEmptyFolderFilter extends ViewerFilter { > public boolean select(Viewer viewer, Object parentElement, Object > element) { > if (element instanceof WizardCollectionElement) { > WizardCollectionElement wce = (WizardCollectionElement) element; > return wce.getChildren().length > 0; > } > return true; > } > } I've noticed an issue with this approach. Please follow the proper Gerrit's comments for more details. I've put the altered patch of my original solution for that to Gerrit - http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=05a1b7675bf9c450c71aa229a07106d7d4084715 Thanks in advance for review, Daniel
Created attachment 234560 [details] Plugin that exposes the issue Steps to reproduce the issue: 1) Launch the updated version of plugin (WizardFilteringIssue_modified.zip) 2) The plugin will add three toolbar buttons 3) Execute the 'Show wizards' button. The new dialog with wizards will be displayed 4) Enter the 'file' in the filter textbox 5) Verify the considered issue: a) Without the patch the empty 'General' category will be displayed (see the 'Considered issue' attachment). If you don't see the empty category use the 'Modify activity' button to enable the activity filter b) After applying the fix the empty wizards list will be displayed Please let me know if you need more information, Daniel
(In reply to comment #17) > Created attachment 234560 [details] > Plugin that exposes the issue > > Steps to reproduce the issue: > > 1) Launch the updated version of plugin (WizardFilteringIssue_modified.zip) > 2) The plugin will add three toolbar buttons > 3) Execute the 'Show wizards' button. The new dialog with wizards will be > displayed > 4) Enter the 'file' in the filter textbox > 5) Verify the considered issue: > a) Without the patch the empty 'General' category will be displayed > (see the 'Considered issue' attachment). If you don't see the empty > category use the 'Modify activity' button to enable the activity filter > > b) After applying the fix the empty wizards list will be displayed > > Please let me know if you need more information, > Daniel Those steps work, thanks.
See https://git.eclipse.org/r/#/c/14554/ for proposed fixes.
Retargeting to 4.4 since this is neither a new nor a major issue.
Submitted with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=5cae0230eaf8ba81f941d08ca5c725728396b95b
Verified in the build: I20130916-2330