if (!fileDialog.isDisplayable()) {
// make displayable together with owner
fileDialog.addNotify();
}
ci.setVisibleFlag(fileDialog, true);
postEvent(new ComponentEvent(fileDialog,
ComponentEvent.COMPONENT_SHOWN));
initOFN();
boolean ok = false;
Thread thread = Thread.currentThread();
thread2fd.put(thread, fileDialog);
switch (mode) {
case FileDialog.LOAD:
ok = (win32.GetOpenFileNameW(ofn) != 0);
break;
case FileDialog.SAVE:
ok = (win32.GetSaveFileNameW(ofn) != 0);
break;
default:
return;
}
setValues(ok);
thread2fd.remove(thread);
fd2win.remove(fileDialog);
ci.setVisibleFlag(fileDialog, false);
postEvent(new ComponentEvent(fileDialog,
ComponentEvent.COMPONENT_HIDDEN));
}
}