Bug 454056 - [DND] Editor area drop listener not added when loading state
authorbriskaa <briskaa@dnastar.com>
Wed, 11 Nov 2015 20:10:29 +0000 (14:10 -0600)
committerBrian de Alwis <bsd@mt.ca>
Wed, 20 Jan 2016 21:31:22 +0000 (16:31 -0500)
Added code to configure any existing windows.

Change-Id: Iaeb10217d9d58107dc381a44d72504366b27c5f5
Signed-off-by: briskaa <briskaa@dnastar.com>
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java

index 6df2c7a..a51cdcc 100644 (file)
@@ -2719,8 +2719,25 @@ public class WorkbenchPage implements IWorkbenchPage {
                }
                restoreWorkingSets();
                restoreShowInMruPartIdsList();
+               configureExistingWindows();
     }
 
+       /*
+        * Perform any configuration required for an existing MWindow. The
+        * association of an MWindow to the WorkbenchWindow/WorkbenchPage can occur
+        * at different times (see Bug 454056 for details).
+        */
+       private void configureExistingWindows() {
+               List<MArea> elements = modelService.findElements(window, null, MArea.class, null);
+               for (MArea area : elements) {
+                       Object widget = area.getWidget();
+                       if (widget instanceof Control) {
+                               installAreaDropSupport((Control) widget);
+                               break;
+                       }
+               }
+       }
+
        public void restoreWorkingSets() {
                String workingSetName = getWindowModel().getPersistedState().get(
                                IWorkbenchConstants.TAG_WORKING_SET);