summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDaniel Rolka2013-05-14 11:01:31 (EDT)
committer Gerrit Code Review @ Eclipse.org2013-05-14 14:36:20 (EDT)
commit4ab730aaad924f28aef63a3f4650c797be9fa0f6 (patch)
tree0038b002178cdd16d7760720df88d9552b2571aa
parentfcb761b640545ddff0ed9beb3ec110dcb8297352 (diff)
downloadeclipse.platform.ui-4ab730aaad924f28aef63a3f4650c797be9fa0f6.zip
eclipse.platform.ui-4ab730aaad924f28aef63a3f4650c797be9fa0f6.tar.gz
eclipse.platform.ui-4ab730aaad924f28aef63a3f4650c797be9fa0f6.tar.bz2
Bug 402429 - hiddenToolBarItem perspective extension does not react toI20130514-2000refs/changes/79/12779/2
perspective changes
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java24
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 632db2b..43063c2 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();
+ }
}