Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2017-06-22 22:21:23 +0000
committerThomas Schindl2017-06-23 12:08:11 +0000
commitc00a05cd8a273a8fecc706391a3d1bf89a841db5 (patch)
tree8f052a74a9ca75619adbc60d681b4a17b082971e
parent2aaad1c298badb80d04da24b986da4f73cb6a847 (diff)
downloadeclipse.platform.ui-c00a05cd8a273a8fecc706391a3d1bf89a841db5.tar.gz
eclipse.platform.ui-c00a05cd8a273a8fecc706391a3d1bf89a841db5.tar.xz
eclipse.platform.ui-c00a05cd8a273a8fecc706391a3d1bf89a841db5.zip
Bug 518666 - Toolbar does not come back after last ToolItem is hidden temporarily
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarContributionRecord.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarContributionRecord.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarContributionRecord.java
index c0417563410..82b9a4fdb42 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarContributionRecord.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarContributionRecord.java
@@ -18,6 +18,7 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.stream.Stream;
import org.eclipse.core.expressions.ExpressionInfo;
import org.eclipse.e4.core.commands.ExpressionContext;
import org.eclipse.e4.core.contexts.EclipseContextFactory;
@@ -81,7 +82,13 @@ public class ToolBarContributionRecord {
}
if (changed) {
- getManagerForModel().markDirty();
+ ToolBarManager managerForModel = getManagerForModel();
+ managerForModel.markDirty();
+ // Make sure the MToolBar model is visible because
+ // TrimBarLayout.hideManagedTB hides and IPresentationEngine moves
+ // it to the Limbo-Shell
+ Stream.of(managerForModel.getItems()).filter(i -> i.isVisible()).findFirst()
+ .ifPresent((i) -> toolbarModel.setVisible(true));
}
}

Back to the top