aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Rolka2014-01-14 09:58:30 (EST)
committerGerrit Code Review @ Eclipse.org2014-01-17 09:12:16 (EST)
commit5da5952ac820ee036bf94b225389c550c9fd6e35 (patch)
tree2703c1b56300dd1cd54979ac2ce17425d9c5274e
parent837a195cd9d56e9b8bba03fee6f4e80db753b6d1 (diff)
downloadeclipse.platform.ui-5da5952ac820ee036bf94b225389c550c9fd6e35.zip
eclipse.platform.ui-5da5952ac820ee036bf94b225389c550c9fd6e35.tar.gz
eclipse.platform.ui-5da5952ac820ee036bf94b225389c550c9fd6e35.tar.bz2
Bug 384108 - JUnit view icon no longer shows progress while executingrefs/changes/15/20615/5
tests Change-Id: I1bd409d5890190a15976de5d1190483875918173 Signed-off-by: Daniel Rolka <daniel.rolka@pl.ibm.com>
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java41
1 files changed, 40 insertions, 1 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java
index 8908be4..1aaffd1 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2013 IBM Corporation and others.
+ * Copyright (c) 2009, 2014 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
@@ -42,6 +42,7 @@ import org.eclipse.e4.ui.model.application.ui.advanced.MPlaceholder;
import org.eclipse.e4.ui.model.application.ui.basic.MInputPart;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
+import org.eclipse.e4.ui.model.application.ui.basic.MStackElement;
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
import org.eclipse.e4.ui.model.application.ui.menu.MToolBar;
import org.eclipse.e4.ui.services.EContextService;
@@ -100,6 +101,42 @@ public class PartServiceImpl implements EPartService {
}
};
+ private EventHandler minimizedPartHandler = new EventHandler() {
+ public void handleEvent(Event event) {
+ Object element = event.getProperty(UIEvents.EventTags.ELEMENT);
+ if (!(element instanceof MPartStack)) {
+ return;
+ }
+
+ Object newValue = event.getProperty(UIEvents.EventTags.NEW_VALUE);
+ Object oldValue = event.getProperty(UIEvents.EventTags.OLD_VALUE);
+
+ boolean minimizedTagAdded = UIEvents.isADD(event)
+ && IPresentationEngine.MINIMIZED.equals(newValue);
+ boolean minimizedTagRemoved = UIEvents.isREMOVE(event)
+ && IPresentationEngine.MINIMIZED.equals(oldValue);
+
+ if (!(minimizedTagAdded || minimizedTagRemoved)) {
+ return;
+ }
+
+ MPart part = toPart(((MPartStack) element).getSelectedElement());
+ if (part != null && minimizedTagAdded) {
+ firePartHidden(part);
+ } else if (part != null) {
+ firePartVisible(part);
+ }
+ }
+
+ private MPart toPart(MStackElement stackElement) {
+ if (stackElement != null) {
+ return stackElement instanceof MPlaceholder ? (MPart) ((MPlaceholder) stackElement)
+ .getRef() : (MPart) stackElement;
+ }
+ return null;
+ }
+ };
+
private MApplication application;
/**
@@ -170,6 +207,7 @@ public class PartServiceImpl implements EPartService {
@PostConstruct
void postConstruct() {
eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT, selectedHandler);
+ eventBroker.subscribe(UIEvents.ApplicationElement.TOPIC_TAGS, minimizedPartHandler);
constructed = true;
partActivationHistory = new PartActivationHistory(this, modelService);
if (activePart != null) {
@@ -181,6 +219,7 @@ public class PartServiceImpl implements EPartService {
void preDestroy() {
constructed = false;
eventBroker.unsubscribe(selectedHandler);
+ eventBroker.unsubscribe(minimizedPartHandler);
partActivationHistory.clear();
}