Bug 264312 - [Contributions] Contributed toolbar items lost
Summary: [Contributions] Contributed toolbar items lost
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 critical (vote)
Target Milestone: 3.5   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-10 03:33 EST by Dani Megert CLA
Modified: 2009-02-20 11:28 EST (History)
2 users (show)

See Also:


Attachments
Only modify the list of 'hidden' items based on actual user changes (5.01 KB, patch)
2009-02-12 09:50 EST, Eric Moffatt CLA
no flags Details | Diff
Picture showing tool bar with missing buttons (8.04 KB, image/png)
2009-02-13 07:50 EST, Dani Megert CLA
no flags Details
Picture showing the expected buttons (2.77 KB, image/png)
2009-02-13 07:52 EST, Dani Megert CLA
no flags Details
Patch to only modify action sets that are changed by the user (1.49 KB, application/octet-stream)
2009-02-18 10:01 EST, Eric Moffatt CLA
no flags Details
Patch to fix remaining issues (4.42 KB, patch)
2009-02-18 15:01 EST, Eric Moffatt CLA
no flags Details | Diff
Updated patch to fix remaining issues (5.91 KB, patch)
2009-02-19 09:56 EST, Eric Moffatt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2009-02-10 03:33:29 EST
Since 3.5 M4.

0. start with new workspace
1. enable the 'Editor Presentation' action set via Window > Customize 
   Perspective...
2. create Java project 'P'
3. create file 'f' ==> Text editor editor opens
4. create class 'C' ==> Java editor opens
==> the icons that are contributed by the Java editor's 'Java Editor Presentation' action set to the same toolbarPath as the ones from 'Editor Presentation' action set are not visible i.e. 'Toggle Mark Occurrences' and 'Toogle Breadcrumb' is missing.

Most likely caused by configurable toolbar work.

This affects all components that contribute to the same tool bar and results on missing toolbar icons, hence critical.
Comment 1 Dani Megert CLA 2009-02-10 03:43:44 EST
NOTE: the 'Java Editor Presentation' action set itself is not visible per default but enabled via org.eclipse.ui.actionSetPartAssociations extension.
Comment 2 Boris Bokowski CLA 2009-02-10 13:52:01 EST
Eric, assigning to you because you are familiar with the Customize Perspective code changes.
Comment 3 Eric Moffatt CLA 2009-02-10 16:00:30 EST
I'm not that familiar but I'll take a look...

Yikes! Changing the EditorPresentation action set state resulted in the following:

A call to setHiddenMenuItems containing 57 'ids' !!
A call to setHiddenToolbarItems containing 15 ids

Something's definitely wrong here...mt current suspicion is that we're scraping all 'unchecked' items in the two trees and claiming they're explicitly 'hidden' as opposed to adding/removing elements from the two lists as the -user- checks/un-checks the elements.
Comment 4 Eric Moffatt CLA 2009-02-10 16:01:06 EST
This is first thing on my plate...
Comment 5 Eric Moffatt CLA 2009-02-11 08:55:23 EST
OK, I looked at this last night and it appears that on close the dialog scrapes its model of check-states and simply declares anything that's 'unchecked' as hidden. If I interpret this correctly it means that any menu item that is not visible (i.e. through its 'visibleWhen' expression) will be declared hidden on exit.

I'm going to see if I can arrange that the dialog remembers every item that has been -explicitly- changed (by a user gesture) and only allow those items to affect the dialog's result...
Comment 6 Eric Moffatt CLA 2009-02-12 09:50:12 EST
Created attachment 125522 [details]
Only modify the list of 'hidden' items based on actual user changes


Only items whose state has been explicitly set by the user (or implicitly through (un)checking a parent element) are used to update the menu/tb 'hidden' lists.
Comment 7 Eric Moffatt CLA 2009-02-12 09:52:56 EST
Committed in >20090212. Applied the patch.

Dani, can you check to ensure that your scenario now works. This should take care of the missing items but I'm not sure about the icon issues...
Comment 8 Dani Megert CLA 2009-02-13 07:49:05 EST
Eric, from your last comment I assume all your changes are in HEAD. I tested with N20090212-2000 and the scenario from comment 0 is not fixed.
Comment 9 Dani Megert CLA 2009-02-13 07:50:51 EST
Created attachment 125629 [details]
Picture showing tool bar with missing buttons
Comment 10 Dani Megert CLA 2009-02-13 07:52:00 EST
Created attachment 125630 [details]
Picture showing the expected buttons
Comment 11 Eric Moffatt CLA 2009-02-13 14:54:35 EST
Dani, my current testing is showing that org.eclipse.ui.workbench.texteditor has a perspectiveExtension that explicitly declares "org.eclipse.ui.edit.text.toggleShowSelectedElementOnly" as a hidden toolbar item...is this possible?

I'm seeing this on the initial load of the perspective on a clean WS using I20090211-0900.
Comment 12 Dani Megert CLA 2009-02-14 03:57:13 EST
Yes, it hides one of the three items but none of the missing ones. In addition I added this just recently i.e. it cannot affect this bug which already exists in M4.
Comment 13 Dani Megert CLA 2009-02-18 04:54:10 EST
>Dani, my current testing is showing that org.eclipse.ui.workbench.texteditor
>has a perspectiveExtension that explicitly declares
>"org.eclipse.ui.edit.text.toggleShowSelectedElementOnly" as a hidden toolbar
>item...is this possible?
This might be yet another problem: I expected that this extension would hide it out of the box - which works - but then the user can enable it on the 'Tool Bar Visibility' tab of the 'Customize Perspective' dialog. This works in the dialog i.e. I can select the icon but it does not appear in the toolbar after clicking 'OK'.
Comment 14 Eric Moffatt CLA 2009-02-18 09:08:14 EST
Dani, yep I've got another issue. Apparently the ActionSets are also getting 'locked' on close (meaning that since the 'Java Editor Presentation' was off when the dialog was first opened it doesn't get activated when the java editor opens.

Top of my plate again...sorry dude (thanks for picking this up!)

Comment 15 Eric Moffatt CLA 2009-02-18 10:01:55 EST
Created attachment 126024 [details]
Patch to only modify action sets that are changed by the user


Just to capture the change...
Comment 16 Eric Moffatt CLA 2009-02-18 13:07:49 EST
Committed in >20090218. Applied the patch.

This is a start and fixes the ActionSet locking issue...there will be another patch with (hopefully final) fixes for menu/toolbar updating...
Comment 17 Eric Moffatt CLA 2009-02-18 15:01:06 EST
Created attachment 126062 [details]
Patch to fix remaining issues


This patch fixes:

- Unchecking a menu correctly marks all children as 'changedByUser'
- updates the action bars on exit if necessary
- causes the 'reset perspective to update the main menu as well as the CoolBar

I'll apply this patch once I've reviewed everything with Paul.
Comment 18 Eric Moffatt CLA 2009-02-18 15:46:22 EST
Paul, there's a remaining issue that I believe has existed forever...if you 'customize' an ActionSet to be either always 'on' or 'off' there seems to be no ways (except reset) to get it back to 'neither' (i.e. not in either list).

Paul, we should go over this whenever you can spare the time...
Comment 19 Eric Moffatt CLA 2009-02-19 09:56:46 EST
Created attachment 126167 [details]
Updated patch to fix remaining issues


this is just a re-spin of the previous patch with a few clean up tweaks...
Comment 20 Eric Moffatt CLA 2009-02-19 10:04:11 EST
Committed in >20090219. I've tried all the scenarios I can think of...

Comment 21 Eric Moffatt CLA 2009-02-19 10:05:07 EST
Marking as FIXED...please re-open if you encounter any issues.

Comment 22 Dani Megert CLA 2009-02-19 10:44:23 EST
Verified that my scenarios from comment 0 and comment 13 are fixed.

Thanks Eric!
Comment 23 Eric Moffatt CLA 2009-02-20 11:28:30 EST
No problemo, I'm glad you found it before it got too far into the wild...;-).