changeset 3693:223392e7cdf1

RT-30675: Quantum: Class cast exception in WindowState.setVisible() when Swing or SWT is embedded
author snorthov
date Mon, 27 May 2013 13:36:54 -0400
parents e470e4efc8dc
children c2f5dcdcce55 01de0b98dca1
files javafx-ui-quantum/src/com/sun/javafx/tk/quantum/WindowStage.java
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-quantum/src/com/sun/javafx/tk/quantum/WindowStage.java	Mon May 27 12:17:24 2013 -0400
+++ b/javafx-ui-quantum/src/com/sun/javafx/tk/quantum/WindowStage.java	Mon May 27 13:36:54 2013 -0400
@@ -375,14 +375,15 @@
         if (!visible) {
             removeActiveWindow(this);
             if (modality == Modality.WINDOW_MODAL) {
-                assert (owner != null);
-                ((WindowStage) owner).setEnabled(true);
+                if (owner != null && owner instanceof WindowStage) {
+                    ((WindowStage) owner).setEnabled(true);
+                }
             } else if (modality == Modality.APPLICATION_MODAL) {
                 windowsSetEnabled(true);
             } else {
                 // Note: This method is required to workaround a glass issue
                 // mentioned in RT-12607
-                if (owner != null) {
+                if (owner != null && owner instanceof WindowStage) {
                     WindowStage ownerStage = (WindowStage)owner;
                     ownerStage.requestToFront();
                 }
@@ -403,8 +404,9 @@
         // other windows.
         if (visible) {
             if (modality == Modality.WINDOW_MODAL) {
-                assert (owner != null);
-                ((WindowStage) owner).setEnabled(false);
+                if (owner != null && owner instanceof WindowStage) {
+                    ((WindowStage) owner).setEnabled(false);
+                }
             } else if (modality == Modality.APPLICATION_MODAL) {
                 windowsSetEnabled(false);
             }