提交 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
enableLog.log(Level.FINE, "Initial enable state: {0}", new Object[] {Boolean.valueOf(enabled)});
if (target.isVisible()) {
show();
setVisible(true);
}
}
......@@ -496,10 +496,6 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
xSetVisible(b);
}
public void show() {
setVisible(true);
}
public void hide() {
setVisible(false);
}
......
......@@ -739,7 +739,17 @@ class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListe
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 @@ class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListe
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();
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册