This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
API users writing applications that require login complain a lot that they are unable to show a modal dialog immediatelly after the splash screen is gone, but just before the main window shows.
Created attachment 37381 [details] Possible implementation
This is the code to show such dialog (when the patch is applied): import java.awt.event.ActionListener; import org.openide.modules.ModuleInstall; import org.openide.*; public class Installer extends ModuleInstall { public void restored() { NotifyDescriptor nd = new NotifyDescriptor.Message("Ok"); DialogDisplayer.getDefault().notifyLater(nd); } }
Do we want to integrate this for 6.0?
I have no strong objections, just few comments: - please add some basic javadoc to methods, code is not that self-explaining (clearing of list etc) - why extra runnables and "noParent" is used? and not just list of NotifyDescriptors? Maybe i'm missing smt but it looks like noParent will be always true in the 'run' list - theoretically show/hide can be called multiple times on winsys...
Thanks for watching over me, Dafe. I'll fix javadoc. The noParent is there because all of these dialogs are supposed to be shown after splash screen is hidden and before main window is open. In fact that means there is actually no parent then. But the original code in the Displayer searches for owner of previous selection, which exists - it is the splash screen. Moreover my dialogs are created a few moments before the splash screen is hidden, and as a result the dialogs used to appear and immediately disappear. That is why I introduced the noParent. If you know a better solution, please advice. Second call to show/hide has no effect, as the notifyLater descriptors are gathered just while the system has not been shown for the first time. Then the dialogs are shown immediately. I hope this is exactly what people want and expect.
Dafe will integrate this functionality next week.
reassigning to me and trying to integrate...
Javadocs added, apichanges added, integrated into main trunk: Checking in openide/dialogs/manifest.mf; /cvs/openide/dialogs/manifest.mf,v <-- manifest.mf new revision: 1.11; previous revision: 1.10 done Checking in openide/dialogs/apichanges.xml; /cvs/openide/dialogs/apichanges.xml,v <-- apichanges.xml new revision: 1.10; previous revision: 1.9 done Checking in openide/dialogs/src/org/openide/DialogDisplayer.java; /cvs/openide/dialogs/src/org/openide/DialogDisplayer.java,v <-- DialogDisplayer.java new revision: 1.7; previous revision: 1.6 done Checking in core/windows/src/org/netbeans/core/windows/services/DialogDisplayerImpl.java; /cvs/core/windows/src/org/netbeans/core/windows/services/DialogDisplayerImpl.java,v <-- DialogDisplayerImpl.java new revision: 1.14; previous revision: 1.13 done Checking in core/windows/test/unit/src/org/netbeans/core/windows/services/DialogDisplayerImplTest.java; /cvs/core/windows/test/unit/src/org/netbeans/core/windows/services/DialogDisplayerImplTest.java,v <-- DialogDisplayerImplTest.java new revision: 1.6; previous revision: 1.5 done Checking in core/windows/src/org/netbeans/core/windows/WindowSystemImpl.java; /cvs/core/windows/src/org/netbeans/core/windows/WindowSystemImpl.java,v <-- WindowSystemImpl.java new revision: 1.15; previous revision: 1.14 done
Thanks Dafe.
Reopening because this seems to have stopped working in 6.7: A few days ago I decided to migrate my Platform application from 6.5.1 over to 6.7.1 but the dialog shown between the splash screen and the main window stopped displaying correctly. I tried different things, such as showing a simple message as in comment #2 instead of my own dialog but the result is the same: the dialog windows shows up and is correctly decorated, but the content remains gray. It seems (though this is just an idea) that the EDT is somehow blocked preventing the content from being displayed. I also tried the same with 6.7 but to no avail - the problem seems to have been introduced there. The system configuration here is SuSE Linux 11.2, Sun JDK/JRE 1.5.0_22-b03.
works fine in: Product Version: NetBeans IDE Dev (Build 101013-8104f1cf7d80) Java: 1.6.0_20; Java HotSpot(TM) Client VM 16.3-b01 System: Windows Vista version 6.0 running on x86; Cp1250; cs_CZ (nb)
I reopen this issue because it's easy to bypass the login form by pressing the close button (X) or hitting "ESC". I came up with a workaround for the close button, but I can't get rid of the ESC key action. Here is my code: //AuthenticationPanel is my custom panel AuthenticationPanel pnlAuthentication = new AuthenticationPanel(); DialogDescriptor dd = new DialogDescriptor(pnlAuthentication, "Login Window", true, pnlAuthentication.getOptions(), null, DialogDescriptor.BOTTOM_ALIGN, null, null); JDialog dialog = (JDialog) DialogDisplayer.getDefault().createDialog(dd); dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); dialog.setVisible(true);
(In reply to comment #12) > I reopen this issue because it's easy to bypass the login form by pressing the > close button (X) or hitting "ESC". I came up with a workaround for the close > button, but I can't get rid of the ESC key action. Here is my code: > > //AuthenticationPanel is my custom panel > AuthenticationPanel pnlAuthentication = new AuthenticationPanel(); > DialogDescriptor dd = new DialogDescriptor(pnlAuthentication, "Login Window", > true, pnlAuthentication.getOptions(), null, DialogDescriptor.BOTTOM_ALIGN, > null, null); > JDialog dialog = (JDialog) DialogDisplayer.getDefault().createDialog(dd); > dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); > dialog.setVisible(true); just check which button was pressed in the dialog and exit the application if it wasn't ok button...