diff options
| author | Dani Megert | 2012-04-17 08:38:21 +0000 |
|---|---|---|
| committer | Dani Megert | 2012-04-17 08:39:12 +0000 |
| commit | 8d91da76608af4522ddd141b43c059e2448078de (patch) | |
| tree | f574def415675bd009fb1a3cde221ac1cdf736a1 | |
| parent | 0c2287b25d3d76d620025cecf8adbcf0f57b4742 (diff) | |
| download | eclipse.platform.ui-8d91da76608af4522ddd141b43c059e2448078de.tar.gz eclipse.platform.ui-8d91da76608af4522ddd141b43c059e2448078de.tar.xz eclipse.platform.ui-8d91da76608af4522ddd141b43c059e2448078de.zip | |
Fixed bug 375576: Controls are not fully realized when partOpened(...)v20120417-0839N20120417-1307I20120417-1000I20120417-0800
and partActivated(...) are called
2 files changed, 31 insertions, 4 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 e0e289cb357..3f5a8e7bd97 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 @@ -4285,6 +4285,7 @@ UIEvents.UIElement.TOPIC_TOBERENDERED, } private void firePartActivated(MPart part) { + Object client = part.getObject(); if (client instanceof CompatibilityPart) { final IWorkbenchPart workbenchPart = ((CompatibilityPart) client).getPart(); @@ -4294,6 +4295,16 @@ UIEvents.UIElement.TOPIC_TOBERENDERED, return; } + if (partListenerList.size() + partListener2List.size() == 0) + return; + + // Flush deferred layouts if needed, see bug 375576 for details + Object widget = part.getWidget(); + if (widget instanceof Composite) { + Composite parent = (Composite) widget; + parent.getDisplay().readAndDispatch(); + } + for (final Object listener : partListenerList.getListeners()) { SafeRunner.run(new SafeRunnable() { public void run() throws Exception { @@ -4343,6 +4354,16 @@ UIEvents.UIElement.TOPIC_TOBERENDERED, SaveablesList saveablesList = (SaveablesList) getWorkbenchWindow().getService( ISaveablesLifecycleListener.class); saveablesList.postOpen(part); + + if (partListenerList.size() + partListener2List.size() == 0) + return; + + // Flush deferred layouts if needed, see bug 375576 for details + MPart model = compatibilityPart.getModel(); + if (model != null && (model.getWidget() instanceof Composite)) { + Composite parent = (Composite) model.getWidget(); + parent.getDisplay().readAndDispatch(); + } for (final Object listener : partListenerList.getListeners()) { SafeRunner.run(new SafeRunnable() { @@ -4433,6 +4454,16 @@ UIEvents.UIElement.TOPIC_TOBERENDERED, final IWorkbenchPart workbenchPart = ((CompatibilityPart) client).getPart(); final IWorkbenchPartReference partReference = getReference(workbenchPart); + if (partListenerList.size() + partListener2List.size() == 0) + return; + + // Flush deferred layouts if needed, see bug 375576 for details + Object widget = part.getWidget(); + if (widget instanceof Composite) { + Composite parent = (Composite) widget; + parent.getDisplay().readAndDispatch(); + } + for (final Object listener : partListenerList.getListeners()) { SafeRunner.run(new SafeRunnable() { public void run() throws Exception { diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityEditor.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityEditor.java index f0d31083b90..c5455cf8fd4 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityEditor.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityEditor.java @@ -127,10 +127,6 @@ public class CompatibilityEditor extends CompatibilityPart { } } - // Flush ant deferred layouts and do an explicit one...see bug 375576 - parent.getDisplay().readAndDispatch(); - parent.layout(true, true); - return true; } |
