| Summary: | [CoolBar] Maintain order when adjunct contributions are used | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Lynne Kues <lynne_kues> |
| Component: | UI | Assignee: | Platform-UI-Inbox <Platform-UI-Inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | n.a.edgar, simon_arsenault |
| Version: | 2.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 2000 | ||
| Whiteboard: | |||
|
Description
Lynne Kues
Plan to implement solution 3 for RC2. Nick, there is still one case that will not be handled without remembering some information about the coolitem layout. Assume ActionSetA defined as follows: A - /Normal/group1 B - /Normal/group2 C - /Normal/group3 Assume ActionSetB defined as follows: 1 - /ActionSetA/C/group4 2 - /ActionSetA/B/group5 3 - /ActionSetA/A/group6 On initial load, the resulting toolbar will be as follows: | 3 | A | 2 | B | 1 | C Now suppose you use Customize Perspective to turn off ActionSetA. The toolbar will be as follows: | 3 | 2 | 1 Further suppose you exit and restart. At this point I lose information about "beforeness" since ActionSetA is not active. The toolbar will appear as follows: | 1 | 2 | 3 I handle this case within a session by using group markers in the toolbar. The case is not an issue on initial load because we say that the before group must exist and base contributions are processed before adjunct contributions. The case is not handled on save/restore because the before group no longer "exists". In the short term, I can save information about beforeGroups between sessions. In the long term, it seems like more intelligent processing non-visible action sets would be the better solution (e.g., ActionPresentation remembers non- visible action sets, ContributionManagers contain action set items that are not active and therefore do not get displayed). Or maybe there is some reason why this was not done in the first place? Since there is no immediate need for beforeGroup specification for adjunct contributions, removed the capability. The above issue is no longer a problem. If beforeGroup capability added back, there also appears to be the desire for specifying before/after within a group. This capability would require some special tag in the toolbarpath or elsewhere to indicate where in the group the item should go. Changes for this bug report are released. Only open issue was the one with beforeGroups described above. This problem is not solved. If multiple action sets contribute to different groups in the same action set, order is not guaranteed to be the same on restore if the base action set has been turned off via Customize Perspective. Or if an action set contributes to a base group and contributes new groups and the base action set is turned off and you exit and restart. Again, may lead to order not being maintained. Changed algorithm to sort by action set id. - Within a toolbar group, sort items by action set id. When a new item is added, it will be added before all the items for its action set id (maintains the reverse order behavior). - Within a coolitem, sort groups by action set id. When a new group is added, it will be added after all the groups for its action set id. Unfortunately, this algorithm is not completely correct when it comes to maintaining order when action sets are turned off. The correct behavior would be to sort by group id within a CoolItem (regardless of action set id). An example of the problem: Action Set X Action 1 - Search Action Set B Action a - S/Search Action Set C Action A - S/JGrp Action B - S/JGrp Will lead to ==> | A B | a 1 Turn off Action Set X, exit, re-enter. Will lead to ==> | a | A B Defer until 2.2. No simple solution. I'm not seeing this issue with menu contribution. I've not been in that code for a while so I can't say exactly what is going on. I would need some time to put a test plugin together to try this scenario out with menus. When a new group is added, the correct algorithm would be to sort by action set id and within the groups for an action set id sort by group id. Note that when sorting groups by action set id you would need to sort based on the action set id that the item is contributing to - not the id of the action set that defines the item. Coolbar is not sorting by group id and groups are sorted by the ids of the defining action set, not the action set being contributed to. This leads to some order issues as does the not sorting by group id. Not sure exactly what menus are doing. Order is not maintained though as you turn action sets on and off. Bottom line - - action sets are processed in different order depending on whether or not the workspace is new or is being restored and action sets will be processed in a different order when action sets are turned on and off - the location of an adjunct toolitem (i.e., a toolitem being added to another coolitem) is specified in terms of other coolitems, so how an adjunct toolitem will be added depends on what coolitems are available at the time Since the processing order of actions sets is not deterministic, specifying adjunct toolitem location in terms of other coolitems will lead to scenarios where order is not maintained. Marking for LATER, please comment if you think this is important for 3.0. As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you. |