summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorSopot Cela2013-04-08 09:11:31 (EDT)
committer Eric Moffatt2013-04-08 09:11:31 (EDT)
commitbef4ce9767b8076dd7a5fa8f468ac93ecbaa8ce0 (patch)
tree362eec80ea3b3cb9297bd9d951f405bb509da4b8
parent9611c6e4bcdd5190d13a5b506402d002a5d890b3 (diff)
downloadeclipse.platform.ui-bef4ce9767b8076dd7a5fa8f468ac93ecbaa8ce0.zip
eclipse.platform.ui-bef4ce9767b8076dd7a5fa8f468ac93ecbaa8ce0.tar.gz
eclipse.platform.ui-bef4ce9767b8076dd7a5fa8f468ac93ecbaa8ce0.tar.bz2
Fix for Bug 391780 - Window Renderer fails to respond to it becoming the
selected element
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java
index 044723d..d883f49 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java
@@ -116,6 +116,7 @@ public class WBWRenderer extends SWTPartRenderer {
@Inject
private IPresentationEngine engine;
+ private EventHandler topWindowHandler;
private EventHandler shellUpdater;
private EventHandler visibilityHandler;
private EventHandler sizeHandler;
@@ -207,6 +208,32 @@ public class WBWRenderer extends SWTPartRenderer {
@PostConstruct
public void init() {
+ topWindowHandler = new EventHandler() {
+
+ public void handleEvent(Event event) {
+ // Ensure that this event is for a MApplication
+ if (!(event.getProperty(UIEvents.EventTags.ELEMENT) instanceof MApplication))
+ return;
+ MWindow win = (MWindow) event
+ .getProperty(UIEvents.EventTags.NEW_VALUE);
+ if ((win == null) || !win.getTags().contains("topLevel")) //$NON-NLS-1$
+ return;
+ win.setToBeRendered(true);
+ if (!(win.getRenderer() == WBWRenderer.this))
+ return;
+ Shell shell = (Shell) win.getWidget();
+ if (shell.getMinimized()) {
+ shell.setMinimized(false);
+ }
+ shell.setActive();
+ shell.moveAbove(null);
+
+ }
+ };
+
+ eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT,
+ topWindowHandler);
+
shellUpdater = new EventHandler() {
public void handleEvent(Event event) {
// Ensure that this event is for a MMenuItem
@@ -359,6 +386,7 @@ public class WBWRenderer extends SWTPartRenderer {
@PreDestroy
public void contextDisposed() {
+ eventBroker.unsubscribe(topWindowHandler);
eventBroker.unsubscribe(shellUpdater);
eventBroker.unsubscribe(visibilityHandler);
eventBroker.unsubscribe(sizeHandler);