private void instShowDialog( Dialog dlg )
{
// System.out.println( "instShowDialog" );
final AbstractWindow w;
final List wasOnTop = new ArrayList();
final boolean modal = dlg.isModal() && (fph != null);
AbstractWindow w2;
//boolean gaga = false;
// temporarily disable alwaysOnTop
if( !internalFrames && floating ) {
for( Iterator iter = getWindows(); iter.hasNext(); ) {
w2 = (AbstractWindow) iter.next();
if( GUIUtil.isAlwaysOnTop( w2.getWindow() )) {
//gaga = true;
//break;
wasOnTop.add( w2 );
GUIUtil.setAlwaysOnTop( w2.getWindow(), false );
}
}
}
try {
w = new AppWindow( dlg );
w.init(); // calls addWindow
// ((AppWindow) w).gaga();
// --- modal interruption ---
if( modal ) fph.addModalDialog(); // this shit is necessary because java.awt.FileDialog doesn't fire windowActivated ...
// if( gaga ) GUIUtil.setAlwaysOnTop( dlg, true );
w.setVisible( true );
if( modal ) fph.removeModalDialog();
// wh.removeWindow( w, null );
w.dispose(); // calls removeWindow
} finally { // make sure to restore original state
for( int i = 0; i < wasOnTop.size(); i++ ) {
w2 = (AbstractWindow) wasOnTop.get( i );
// System.out.println( "wasOnTop " + i + " : " + w2.getClass().getName() );
GUIUtil.setAlwaysOnTop( w2.getWindow(), true );
}
}
}