Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2018-07-08 19:33:40 +0000
committerAndrey Loskutov2018-07-08 19:33:40 +0000
commit60cf926245c69690fca3c2615b6ffe6e33ffe121 (patch)
tree015515cf992865c6918826b4bafb97534d3d7671
parent30490a7a2940c68d426550b56a268c1f8e9575f1 (diff)
downloadeclipse.platform.ui-60cf926245c69690fca3c2615b6ffe6e33ffe121.tar.gz
eclipse.platform.ui-60cf926245c69690fca3c2615b6ffe6e33ffe121.tar.xz
eclipse.platform.ui-60cf926245c69690fca3c2615b6ffe6e33ffe121.zip
Bug 536677 - do not change model in page.close() on window.close()I20180708-2000
Hiding parts or other model changes on closing the page during window.close() causes opened editors not to be restored on next start. Change-Id: I70ffdfdf1b7e6709674d7443396ba7f55e163797 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java41
1 files changed, 21 insertions, 20 deletions
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 f5897190716..6bce993eb2d 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
@@ -1793,28 +1793,29 @@ public class WorkbenchPage implements IWorkbenchPage {
return false;
}
- Collection<MPart> partsToHide = partService.getParts();
- // workaround for bug 455281
- List<MPart> partsOutsidePersp = modelService.findElements(window, null, MPart.class, null,
- EModelService.OUTSIDE_PERSPECTIVE);
- partsToHide.removeAll(partsOutsidePersp);
-
- for (MPart part : partsToHide) {
- // no save, no confirm, force
- hidePart(part, false, true, true);
- }
-
- MPerspectiveStack perspectiveStack = modelService.findElements(window, null,
- MPerspectiveStack.class, null).get(0);
- MPerspective current = perspectiveStack.getSelectedElement();
- for (Object perspective : perspectiveStack.getChildren().toArray()) {
- if (perspective != current) {
- modelService.removePerspectiveModel((MPerspective) perspective, window);
+ if (!legacyWindow.isClosing()) {
+ Collection<MPart> partsToHide = partService.getParts();
+ // workaround for bug 455281
+ List<MPart> partsOutsidePersp = modelService.findElements(window, null, MPart.class, null,
+ EModelService.OUTSIDE_PERSPECTIVE);
+ partsToHide.removeAll(partsOutsidePersp);
+
+ for (MPart part : partsToHide) {
+ // no save, no confirm, force
+ hidePart(part, false, true, true);
+ }
+ MPerspectiveStack perspectiveStack = modelService.findElements(window, null, MPerspectiveStack.class, null)
+ .get(0);
+ MPerspective current = perspectiveStack.getSelectedElement();
+ for (Object perspective : perspectiveStack.getChildren().toArray()) {
+ if (perspective != current) {
+ modelService.removePerspectiveModel((MPerspective) perspective, window);
+ }
}
- }
- if (current != null) {
- modelService.removePerspectiveModel(current, window);
+ if (current != null) {
+ modelService.removePerspectiveModel(current, window);
+ }
}
viewReferences.clear();

Back to the top