changeset 1102:2083f9461cea

6806224: PIT : Getting java.lang.NullPointerException while opening Filedialog Reviewed-by: art, dav
author dcherepanov
date Thu, 19 Feb 2009 14:10:19 +0300
parents e03aa9d6b8d5
children 66d6db0a1de6
files src/solaris/classes/sun/awt/X11/XComponentPeer.java src/solaris/classes/sun/awt/X11/XFileDialogPeer.java
diffstat 2 files changed, 14 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Tue Feb 17 14:44:58 2009 +0300
+++ b/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Thu Feb 19 14:10:19 2009 +0300
@@ -166,7 +166,7 @@
         enableLog.log(Level.FINE, "Initial enable state: {0}", new Object[] {Boolean.valueOf(enabled)});
 
         if (target.isVisible()) {
-            show();
+            setVisible(true);
         }
     }
 
@@ -496,10 +496,6 @@
         xSetVisible(b);
     }
 
-    public void show() {
-        setVisible(true);
-    }
-
     public void hide() {
         setVisible(false);
     }
--- a/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java	Tue Feb 17 14:44:58 2009 +0300
+++ b/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java	Thu Feb 19 14:10:19 2009 +0300
@@ -739,7 +739,17 @@
         this.filter = filter;
     }
 
-    public void show() {
+
+    public void dispose() {
+        FileDialog fd = (FileDialog)fileDialog;
+        if (fd != null) {
+            fd.removeAll();
+        }
+        super.dispose();
+    }
+
+    // 03/02/2005 b5097243 Pressing 'ESC' on a file dlg does not dispose the dlg on Xtoolkit
+    public void setVisible(boolean b){
         if (fileDialog == null) {
             init((FileDialog)target);
         }
@@ -754,34 +764,20 @@
             setFile(savedFile);
         }
 
-        super.show();
-        selectionField.requestFocusInWindow();
-    }
-
-    public void dispose() {
-        FileDialog fd = (FileDialog)fileDialog;
-        if (fd != null) {
-            fd.removeAll();
-        }
-        super.dispose();
-    }
-
-    // 03/02/2005 b5097243 Pressing 'ESC' on a file dlg does not dispose the dlg on Xtoolkit
-    public void setVisible(boolean b){
         super.setVisible(b);
         if (b == true){
             // See 6240074 for more information
             XChoicePeer choicePeer = (XChoicePeer)pathChoice.getPeer();
             choicePeer.addXChoicePeerListener(this);
-
             KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(this);
         }else{
             // See 6240074 for more information
             XChoicePeer choicePeer = (XChoicePeer)pathChoice.getPeer();
             choicePeer.removeXChoicePeerListener();
-
             KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(this);
         }
+
+        selectionField.requestFocusInWindow();
     }
 
     /*