Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Besedin2012-04-24 20:26:51 +0000
committerOleg Besedin2012-04-24 20:27:37 +0000
commitc501a689e0f3ba86dd12fdb66a5bfeebc14cc482 (patch)
tree9352bcdd8b5084d7cb291fee001a90664b38a247
parent30ca7d3190da9185a3bc41f0007371e7d83839db (diff)
downloadeclipse.platform.ui-c501a689e0f3ba86dd12fdb66a5bfeebc14cc482.tar.gz
eclipse.platform.ui-c501a689e0f3ba86dd12fdb66a5bfeebc14cc482.tar.xz
eclipse.platform.ui-c501a689e0f3ba86dd12fdb66a5bfeebc14cc482.zip
Bug 373529 - [Compatibility] IPageListener's pageOpened(*) is sent outv20120424-2027I20120424-1700
too early
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java27
1 files changed, 17 insertions, 10 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
index eb0dd8d2739..4f249269fc8 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
@@ -420,6 +420,8 @@ public final class Workbench extends EventManager implements IWorkbench {
boolean initializationDone = false;
+ private WorkbenchWindow windowBeingCreated = null;
+
/**
* Creates a new workbench.
*
@@ -1223,19 +1225,24 @@ public final class Workbench extends EventManager implements IWorkbench {
WorkbenchWindow result = (WorkbenchWindow) windowContext.get(IWorkbenchWindow.class
.getName());
if (result == null) {
+ if (windowBeingCreated != null)
+ return windowBeingCreated;
result = new WorkbenchWindow(input, descriptor);
-
- if (newWindow) {
- Point size = result.getWindowConfigurer().getInitialSize();
- window.setWidth(size.x);
- window.setHeight(size.y);
- application.getChildren().add(window);
- application.setSelectedElement(window);
+ windowBeingCreated = result;
+ try {
+ if (newWindow) {
+ Point size = result.getWindowConfigurer().getInitialSize();
+ window.setWidth(size.x);
+ window.setHeight(size.y);
+ application.getChildren().add(window);
+ application.setSelectedElement(window);
+ }
+ ContextInjectionFactory.inject(result, windowContext);
+ windowContext.set(IWorkbenchWindow.class.getName(), result);
+ } finally {
+ windowBeingCreated = null;
}
- ContextInjectionFactory.inject(result, windowContext);
- windowContext.set(IWorkbenchWindow.class.getName(), result);
-
if (application.getSelectedElement() == window) {
application.getContext().set(ISources.ACTIVE_WORKBENCH_WINDOW_NAME, result);
application.getContext().set(ISources.ACTIVE_WORKBENCH_WINDOW_SHELL_NAME, result.getShell());

Back to the top