diff options
| author | Daniel Rolka | 2013-05-14 15:01:31 +0000 |
|---|---|---|
| committer | Gerrit Code Review @ Eclipse.org | 2013-05-14 18:36:20 +0000 |
| commit | 4ab730aaad924f28aef63a3f4650c797be9fa0f6 (patch) | |
| tree | 0038b002178cdd16d7760720df88d9552b2571aa | |
| parent | fcb761b640545ddff0ed9beb3ec110dcb8297352 (diff) | |
| download | eclipse.platform.ui-4ab730aaad924f28aef63a3f4650c797be9fa0f6.tar.gz eclipse.platform.ui-4ab730aaad924f28aef63a3f4650c797be9fa0f6.tar.xz eclipse.platform.ui-4ab730aaad924f28aef63a3f4650c797be9fa0f6.zip | |
Bug 402429 - hiddenToolBarItem perspective extension does not react toI20130514-2000
perspective changes
| -rw-r--r-- | bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java index 632db2b0a1d..43063c2f15e 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2012 IBM Corporation and others. + * Copyright (c) 2011, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -704,12 +704,10 @@ public class CoolBarToTrimManager extends ContributionManager implements ICoolBa container, null); for (IContributionItem item : manager.getItems()) { - if (item == null) { - continue; - } - if (renderer.getToolElement(item) != null) { + if (item == null || !isChildVisible(item)) { continue; } + if (item instanceof IToolBarContributionItem) { IToolBarManager manager2 = ((IToolBarContributionItem) item).getToolBarManager(); //new Exception("fill(MToolBar container, IContributionManager manager) with " //$NON-NLS-1$ @@ -738,4 +736,20 @@ public class CoolBarToTrimManager extends ContributionManager implements ICoolBa } } } + + private boolean isChildVisible(IContributionItem item) { + Boolean v; + + IContributionManagerOverrides overrides = getOverrides(); + if (overrides == null) { + v = null; + } else { + v = getOverrides().getVisible(item); + } + + if (v != null) { + return v.booleanValue(); + } + return item.isVisible(); + } } |
