DESCRIPTION

Bug 445538 - [Perspectives] Pin Editor command broken and can no longer
be added to perspective's toolbar

Because CommandContributionItem's are now replaced with
HandledContributionItem's in CoolBarToTrimManager we can't update the
state of originally contributed items anymore.

Moved the "pin editor" show/hide and refresh logic from the anonymous
subclass of the ContributionItemFactory.CommandContributionItem into the
WorkLeon OchoachActionBuilder.

Updated CPD tooltips and popup text which warn user that selected item
visibility can't be changed via CPD if the item represents an initially
disabled CommandContributionItem (default is enabled).

Change-Id: I313290938b012c9578a05a999a05f76bac5e2bfb
Signed-off-by: Jayvion Booth xxx@xxx.xxx


COMMENTS

author: Jayvion Booth
date: 2015-02-21 14:10:01.000000000

Uploaded patch set 10.

-------------------------------------
author: Brenden Conley
date: 2015-02-21 14:10:07.000000000

Patch Set 10:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/4659/

-------------------------------------
author: Brenden Conley
date: 2015-02-21 14:29:17.000000000

Patch Set 10: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/4659/ : SUCCESS

-------------------------------------
author: Skylar Chambers
date: 2015-02-23 11:06:46.000000000

Patch Set 10:

(2 comments)

- Contributors list still not updated in many files.

- Found another issue: Open new workspace. Enable "Close editors..." in Preferences. Open 2 files C1 and C2. Pin C1. Disable "Close editors..." in Preferences. Click on C2 tab to bring it to top. Enable "Close editors..." in Preferences. The tool item shows pinned though C2 is not pinned. This does not happen in 3.x.

- See other comments inlined.

Line:293, bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/WorkLeon OchoachActionBuilder.java -> Change looks fine. But I could not reproduce this issue on Eclipse 3.8.1 with the given steps.

Line:706, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java -> Just wondering if the above change would be required here as well.

-------------------------------------
author: Jayvion Booth
date: 2015-02-23 19:36:02.000000000

Patch Set 10:

(2 comments)

> Contributors list still not updated in many files.

My fault, in j/egit it is not mandatory. Do I really need to add myself to *every* file I touch, even if the change is small and not very important?

> Found another issue: Open new workspace. Enable "Close editors..." in Preferences. Open 2 files C1 and C2. Pin C1. Disable "Close editors..." in Preferences. Click on C2 tab to bring it to top. Enable "Close editors..." in Preferences. The tool item shows pinned though C2 is not pinned. This does not happen in 3.x.

> I think this was broken in 4.x before my patch already, but I have a fix :-)

> See other comments inlined.

The fixed patch follows soon. Thanks for you review!

Line:293, bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/WorkLeon OchoachActionBuilder.java -> I meant the issue was visible on *4.x* before my changes. Sorry for not clear explanation.

Line:706, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java -> As far as I understand this code, the first if branch (where prevChildVisible == null) is the one where the *initial* value is remembered, which should be considered first time the contribution is "touched". Here we should be in the "rollback" mode where we simply change whatever is in the model to the previously recorded value. So I *hope* the change above should be enough, but I'm also not really sure. I don't wont change more as needed unless we know something is broken and can reproduce it.

-------------------------------------
