提交 82fa4fd9 编写于 作者: D dcherepanov

6806224: PIT : Getting java.lang.NullPointerException while opening Filedialog

Reviewed-by: art, dav
上级 0887d327
...@@ -166,7 +166,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget ...@@ -166,7 +166,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
enableLog.log(Level.FINE, "Initial enable state: {0}", new Object[] {Boolean.valueOf(enabled)}); enableLog.log(Level.FINE, "Initial enable state: {0}", new Object[] {Boolean.valueOf(enabled)});
if (target.isVisible()) { if (target.isVisible()) {
show(); setVisible(true);
} }
} }
...@@ -496,10 +496,6 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget ...@@ -496,10 +496,6 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
xSetVisible(b); xSetVisible(b);
} }
public void show() {
setVisible(true);
}
public void hide() { public void hide() {
setVisible(false); setVisible(false);
} }
......
...@@ -739,7 +739,17 @@ class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListe ...@@ -739,7 +739,17 @@ class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListe
this.filter = filter; 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) { if (fileDialog == null) {
init((FileDialog)target); init((FileDialog)target);
} }
...@@ -754,34 +764,20 @@ class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListe ...@@ -754,34 +764,20 @@ class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListe
setFile(savedFile); 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); super.setVisible(b);
if (b == true){ if (b == true){
// See 6240074 for more information // See 6240074 for more information
XChoicePeer choicePeer = (XChoicePeer)pathChoice.getPeer(); XChoicePeer choicePeer = (XChoicePeer)pathChoice.getPeer();
choicePeer.addXChoicePeerListener(this); choicePeer.addXChoicePeerListener(this);
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(this); KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(this);
}else{ }else{
// See 6240074 for more information // See 6240074 for more information
XChoicePeer choicePeer = (XChoicePeer)pathChoice.getPeer(); XChoicePeer choicePeer = (XChoicePeer)pathChoice.getPeer();
choicePeer.removeXChoicePeerListener(); choicePeer.removeXChoicePeerListener();
KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(this); KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(this);
} }
selectionField.requestFocusInWindow();
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册