Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Moffatt2013-07-29 19:21:33 +0000
committerEric Moffatt2013-07-29 19:21:57 +0000
commiteed1302da726969deb2d6554f75f9ecfc0bcdb8f (patch)
tree7b21958623beb1131c9f6cacbc05ed34578b255f
parentd731b6c381d06a8e796f2a035d75a959e1813d79 (diff)
downloadeclipse.platform.ui-eed1302da726969deb2d6554f75f9ecfc0bcdb8f.tar.gz
eclipse.platform.ui-eed1302da726969deb2d6554f75f9ecfc0bcdb8f.tar.xz
eclipse.platform.ui-eed1302da726969deb2d6554f75f9ecfc0bcdb8f.zip
Fix (2) for Bug 371598 - [FastView] Fast views do not always close on
Escape (Activate the part).
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java39
1 files changed, 15 insertions, 24 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java
index f6761518650..f42e7a32c60 100644
--- a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java
@@ -34,6 +34,7 @@ import org.eclipse.e4.ui.model.application.ui.advanced.MPerspectiveStack;
import org.eclipse.e4.ui.model.application.ui.advanced.MPlaceholder;
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.MTrimBar;
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
import org.eclipse.e4.ui.model.application.ui.menu.MToolControl;
@@ -109,28 +110,6 @@ public class TrimStack {
*/
private Map<String, Image> imageMap = new HashMap<String, Image>();
- private Listener mouseDownFilter = new Listener() {
- public void handleEvent(Event event) {
- if (!(event.widget instanceof Control))
- return;
- Control ctrl = (Control) event.widget;
- Point p = new Point(event.x, event.y);
- p = event.display.map(ctrl, null, p);
-
- Rectangle caBounds = hostPane.getBounds();
- caBounds = event.display.map(hostPane.getParent(), null, caBounds);
- boolean inHostPane = caBounds.contains(p);
-
- TrimmedPartLayout tpl = (TrimmedPartLayout) hostPane.getShell().getLayout();
- Rectangle shellCABounds = tpl.clientArea.getBounds();
- shellCABounds = event.display.map(tpl.clientArea.getParent(), null, shellCABounds);
- boolean inShellCA = shellCABounds.contains(p);
-
- if (inShellCA && !inHostPane)
- showStack(false);
- }
- };
-
ControlListener caResizeListener = new ControlListener() {
public void controlResized(ControlEvent e) {
if (hostPane != null && hostPane.isVisible())
@@ -826,7 +805,6 @@ public class TrimStack {
ctf.setParent(hostPane);
clientArea.addControlListener(caResizeListener);
- clientArea.getDisplay().addFilter(SWT.MouseDown, mouseDownFilter);
// Set the initial location
setPaneLocation(hostPane);
@@ -835,6 +813,20 @@ public class TrimStack {
hostPane.moveAbove(null);
hostPane.setVisible(true);
+ // Activate the part that is being brought up...
+ if (minimizedElement instanceof MPartStack) {
+ MPartStack theStack = (MPartStack) minimizedElement;
+ MStackElement curSel = theStack.getSelectedElement();
+ if (curSel instanceof MPart) {
+ partService.activate((MPart) curSel);
+ } else if (curSel instanceof MPlaceholder) {
+ MPlaceholder ph = (MPlaceholder) curSel;
+ if (ph.getRef() instanceof MPart) {
+ partService.activate((MPart) ph.getRef());
+ }
+ }
+ }
+
isShowing = true;
fixToolItemSelection();
} else if (!show && isShowing) {
@@ -842,7 +834,6 @@ public class TrimStack {
// trimstack may be currently hosted in the limbo shell
if (clientArea != null) {
clientArea.removeControlListener(caResizeListener);
- clientArea.getDisplay().removeFilter(SWT.MouseDown, mouseDownFilter);
}
if (hostPane != null && hostPane.isVisible()) {

Back to the top