Bug 402429 - hiddenToolBarItem perspective extension does not react to perspective changes
Summary: hiddenToolBarItem perspective extension does not react to perspective changes
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.4 M3   Edit
Assignee: Daniel Rolka CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-05 07:58 EST by Dave Nice CLA
Modified: 2014-02-07 09:38 EST (History)
5 users (show)

See Also:


Attachments
Application used during testing the fix (4.62 KB, multipart/x-zip)
2013-05-14 11:04 EDT, Daniel Rolka CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Nice CLA 2013-03-05 07:58:41 EST
I have a perspective extension like this:
      <perspectiveExtension
            targetID="org.eclipse.jdt.ui.JavaPerspective">

         <hiddenToolBarItem id="org.eclipse.ui.navigate.next" />
         <hiddenToolBarItem id="org.eclipse.ui.navigate.previous" />

         <hiddenMenuItem id="org.eclipse.ui.run" />
         </perspectiveExtension>

In Eclipse 3.6.2, the annotation navigation toolbar buttons are hidden in the Java perspective but not in other perspectives.

In Eclipse 4.2.2, the annotation navigation toolbar buttons are hidden in all perspectives.

I have noticed that if I target the debug perspective instead of the java perspective, the toolbar buttons are never hidden, so I think it's just that they are not updating according to perspective changes.

The hiddenMenuItem works correctly.
Comment 1 Paul Webster CLA 2013-04-12 09:57:26 EDT
Very similar to bug 391481

PW
Comment 2 Dave Nice CLA 2013-04-12 11:18:11 EDT
Just to confirm that build http://download.eclipse.org/eclipse/downloads/drops4/I20130409-0900/ does not fix this particular issue.  As you say, the fix for bug 391481 might be a similar fix, but it's not "buy one get one free", sadly!
Comment 3 Daniel Rolka CLA 2013-05-14 11:04:06 EDT
Created attachment 230952 [details]
Application used during testing the fix

I've added the application that I was using during working on the fix for the bug

thanks,
Daniel
Comment 4 Eric Moffatt CLA 2013-05-14 14:36:01 EDT
Daniel / Paul, in order to the the extension to take effect I have to do a clean start...is this expected ?

Other than that it works fine...
Comment 6 Paul Webster CLA 2013-05-14 14:50:38 EDT
(In reply to comment #5)
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=4ab730aaad924f28aef63a3f4650c797be9fa0f6

This fix will prevent hidden toolbar items from being modelled on startup (so they won't react to changes after the fact), and won't react to changes if they're made after the fact.

I'd prefer we revert this commit and make sure we've got all the cases covered (target the save icon and the print icon to make sure they work).  

PW
Comment 7 Daniel Rolka CLA 2013-05-15 06:26:34 EDT
Guys,
I've uploaded the new patch to Gerrit that I believe addresses all concerns as well as fixes the memory leak introduced by previous patch :)

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=dacaf4ad01eff26cca72b5c0ca3b59aa7e73e8b8

However if it is still not good enough please revert the previous patch to fix the mentioned memory leak issue (when the CoolBarToTrimManager.fill method is executed it always creates the new model items and puts it to the MToolBar children list. The children items are present there until the particual perspective is opened)

thanks in advance for review,
Daniel
Comment 8 Paul Webster CLA 2013-05-15 13:22:44 EDT
(In reply to comment #7)
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=dacaf4ad01eff26cca72b5c0ca3b59aa7e73e8b8

Thanks Daniel.

I've reverted the original commit with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=3d6eeeb2857cc8b1bc5fb407e65ed250a892f28f

as you re-examine https://git.eclipse.org/r/#/c/12819 you will have to include the elements of your original commit that you deem useful.

PW
Comment 10 Daniel Rolka CLA 2013-10-29 10:03:25 EDT
Verified in the build: I20131028-2000
Comment 11 Christian Georgi CLA 2014-02-07 09:37:13 EST
Is it possible to back-port this to 4.3 (as part of 4.3 SR2)?

Thanks,
Christian
Comment 12 Paul Webster CLA 2014-02-07 09:38:30 EST
(In reply to Christian Georgi from comment #11)
> Is it possible to back-port this to 4.3 (as part of 4.3 SR2)?

No, our window for backporting things is over, we're at 4.3.2 RC3

PW