6806224: PIT : Getting java.lang.NullPointerException while opening Filedialog
Reviewed-by: art, dav
This commit is contained in:
parent
c59552fc2d
commit
a1117d31b6
@ -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
|
|||||||
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
|
|||||||
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
|
|||||||
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user