Fix for Bug 188958 - [Min/Max] Dragging a view back into the presentation doesn't 'unzoom'
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveHelper.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveHelper.java
index 27d598c..6edb26f 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveHelper.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveHelper.java
@@ -894,16 +894,6 @@
ViewPane pane = (ViewPane)((WorkbenchPartReference)ref).getPane();
if (canDetach() && pane != null) {
Rectangle bounds = pane.getParentBounds();
-// When new style placeholders get implemented this can be used to store the
-// last position of the window. Until then this breaks on restore state because
-// the view gets put in the placeholder rather than in the detached window.
-// Leaving the user with an empty detachedwindow shell.
-//
-// if (presentationHelper.hasPlaceholder(ref.getId(), ref.getSecondaryId()) ||
-// pane.getContainer() != null)
-// presentationHelper.removePart(pane);
-//
-// addDetachedPart(pane, bounds);
detach(pane, bounds.x ,bounds.y);
}
}
@@ -918,9 +908,6 @@
bounds.y = bounds.y + (bounds.height - 300) / 2;
addDetachedPart(part, bounds);
-
- // enable direct manipulation
- //enableDrop(part);
}
public void addDetachedPart(LayoutPart part, Rectangle bounds) {
@@ -1163,12 +1150,9 @@
*/
public boolean isZoomed() {
// New 3.3 behavior
-// IPreferenceStore preferenceStore = PrefUtil.getAPIPreferenceStore();
-// boolean useNewMinMax = preferenceStore
-// .getBoolean(IWorkbenchPreferenceConstants.ENABLE_NEW_MIN_MAX);
-// if (useNewMinMax) {
-// return maximizedStack != null;
-// }
+ if (Perspective.useNewMinMax(perspective)) {
+ return getMaximizedStack() != null;
+ }
return mainLayout.getZoomedPart() != null;
}
@@ -1427,12 +1411,11 @@
*/
public void zoomOut() {
// New 3.3 behavior
-// IPreferenceStore preferenceStore = PrefUtil.getAPIPreferenceStore();
-// boolean useNewMinMax = preferenceStore
-// .getBoolean(IWorkbenchPreferenceConstants.ENABLE_NEW_MIN_MAX);
-// if (useNewMinMax && maximizedStack != null) {
-// maximizedStack.setState(IStackPresentationSite.STATE_RESTORED);
-// }
+ if (Perspective.useNewMinMax(perspective)) {
+ if (maximizedStack != null)
+ maximizedStack.setState(IStackPresentationSite.STATE_RESTORED);
+ return;
+ }
LayoutPart zoomPart = mainLayout.getZoomedPart();
if (zoomPart != null) {
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
index 9d72756..508c674 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
@@ -2436,30 +2436,6 @@
* @see org.eclipse.ui.IWorkbenchPage#isPageZoomed()
*/
public boolean isPageZoomed() {
- if (Perspective.useNewMinMax(getActivePerspective())) {
- boolean zoomed = false;
-
- // Can we find a presentation container whose state is maximized ?
- Perspective persp = getActivePerspective();
- if (persp != null) {
- LayoutPart[] kids = persp.getPresentation().getLayout().getChildren();
- for (int i = 0; i < kids.length && !zoomed; i++) {
- if (kids[i] instanceof ViewStack) {
- zoomed = ((ViewStack)kids[i]).getState() == IStackPresentationSite.STATE_MAXIMIZED;
- }
- else if (kids[i] instanceof EditorSashContainer) {
- LayoutPart[] editors = ((EditorSashContainer)kids[i]).getChildren();
- for (int j = 0; j < editors.length && !zoomed; j++) {
- if (editors[j] instanceof EditorStack) {
- zoomed = ((EditorStack)editors[j]).getState() == IStackPresentationSite.STATE_MAXIMIZED;
- }
- }
- }
- }
- }
- return zoomed;
- }
-
return isZoomed();
}