Docking: bug when saving the configuration 41/10241/1
Calixte DENIZET [Thu, 17 Jan 2013 15:04:25 +0000 (16:04 +0100)]
Change-Id: Ica5093b9238ec471ee1a81cc682bba334e55c63c

scilab/modules/gui/src/java/org/scilab/modules/gui/utils/ClosingOperationsManager.java

index 9631f62..e874da5 100644 (file)
@@ -25,6 +25,7 @@ import java.util.UUID;
 import javax.swing.AbstractAction;
 import javax.swing.Action;
 import javax.swing.JCheckBox;
+import javax.swing.SwingUtilities;
 
 import org.flexdock.docking.DockingConstants;
 import org.scilab.modules.gui.bridge.tab.SwingScilabTab;
@@ -842,12 +843,7 @@ public class ClosingOperationsManager {
      * @return the corresponding window
      */
     private static final SwingScilabWindow getWindow(SwingScilabTab tab) {
-        SwingScilabWindow win = SwingScilabWindow.allScilabWindows.get(tab.getParentWindowId());
-        if (win == null) {
-            return null;
-        }
-
-        return win;
+       return (SwingScilabWindow) SwingUtilities.getAncestorOfClass(SwingScilabWindow.class, tab);
     }
 
     /**