Index: core/startup/src/org/netbeans/core/startup/Bundle.properties =================================================================== RCS file: /cvs/core/startup/src/org/netbeans/core/startup/Bundle.properties,v retrieving revision 1.9 diff -u -r1.9 Bundle.properties --- core/startup/src/org/netbeans/core/startup/Bundle.properties 1 Nov 2005 09:30:17 -0000 1.9 +++ core/startup/src/org/netbeans/core/startup/Bundle.properties 15 Nov 2005 14:39:08 -0000 @@ -132,6 +132,8 @@ MSG_problem_package_not_loaded_or_old=The package {0} was not loaded or was an outdated version. MSG_warning=Warning MSG_info=Information +MSG_continue=Continue +MSG_exit=Exit # NbEvents MSG_start_load_boot_modules=Loading core... Index: core/startup/src/org/netbeans/core/startup/Main.java =================================================================== RCS file: /cvs/core/startup/src/org/netbeans/core/startup/Main.java,v retrieving revision 1.10 diff -u -r1.10 Main.java --- core/startup/src/org/netbeans/core/startup/Main.java 10 Nov 2005 05:37:23 -0000 1.10 +++ core/startup/src/org/netbeans/core/startup/Main.java 15 Nov 2005 14:39:10 -0000 @@ -407,7 +407,7 @@ /** Return splash screen. */ - protected Splash.SplashOutput getSplash() { + final static Splash.SplashOutput getSplash() { return splash; } Index: core/startup/src/org/netbeans/core/startup/NbEvents.java =================================================================== RCS file: /cvs/core/startup/src/org/netbeans/core/startup/NbEvents.java,v retrieving revision 1.4 diff -u -r1.4 NbEvents.java --- core/startup/src/org/netbeans/core/startup/NbEvents.java 1 Nov 2005 09:30:17 -0000 1.4 +++ core/startup/src/org/netbeans/core/startup/NbEvents.java 15 Nov 2005 14:39:10 -0000 @@ -15,10 +15,12 @@ // May use core, GUI, ad nauseum. +import java.awt.Component; import java.io.File; import java.text.Collator; import java.util.*; import javax.swing.JOptionPane; +import org.netbeans.core.startup.Splash.SplashOutput; import org.openide.ErrorManager; import org.openide.filesystems.FileObject; import org.openide.modules.SpecificationVersion; @@ -268,19 +270,60 @@ } } private static final class Notifier implements Runnable { + private static int questions; + private boolean warn; private String text; private static RequestProcessor RP = new RequestProcessor("Notify About Module System"); // NOI18N + private volatile boolean shown; + private Object[] options; + private Object value; public Notifier(String text, boolean type) { this.warn = type; this.text = text; - RP.post(this, 0, Thread.MIN_PRIORITY); + //this.options = options; + RequestProcessor.Task t = RP.post(this, 0, Thread.MIN_PRIORITY); + + if (questions++ == 0) { + this.options = new String[] { + NbBundle.getMessage(Notifier.class, "MSG_continue"), + NbBundle.getMessage(Notifier.class, "MSG_exit"), + }; + } + + if (options != null) { + try { + t.waitFinished(10000); + } catch (InterruptedException ex) { + // ok, this is not a problem + } + if (shown) { + t.waitFinished(); + } + } + } + + public Object getOption() { + return value; } public void run() { + shown = true; + int type = warn ? JOptionPane.WARNING_MESSAGE : JOptionPane.INFORMATION_MESSAGE; String msg = NbBundle.getMessage(Notifier.class, warn ? "MSG_warning" : "MSG_info"); // NOI18N - JOptionPane.showMessageDialog(null, text, msg, type); + + Splash.SplashOutput out = org.netbeans.core.startup.Main.getSplash(); + Component c = out == null ? null : out.getComponent(); + + if (options == null) { + JOptionPane.showMessageDialog(null, text, msg, type); + } else { + int ret = JOptionPane.showOptionDialog(c, text, msg, 0, type, null, options, options[0]); + if (ret == 1) { + TopSecurityManager.exit(1); + } + } } } Index: core/startup/src/org/netbeans/core/startup/Splash.java =================================================================== RCS file: /cvs/core/startup/src/org/netbeans/core/startup/Splash.java,v retrieving revision 1.5 diff -u -r1.5 Splash.java --- core/startup/src/org/netbeans/core/startup/Splash.java 26 Sep 2005 15:25:30 -0000 1.5 +++ core/startup/src/org/netbeans/core/startup/Splash.java 15 Nov 2005 14:39:10 -0000 @@ -15,6 +15,7 @@ import java.awt.BorderLayout; import java.awt.Color; +import java.awt.Component; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.Font; @@ -105,6 +106,8 @@ public void addAndSetMaxSteps(int steps); public void increment(int steps); + + public Component getComponent(); } /** This interface is used only internally in this class. @@ -525,6 +532,10 @@ public void addAndSetMaxSteps(int steps) { splashComponent.addAndSetMaxSteps(steps); } + + public Component getComponent() { + return this; + } } @@ -595,6 +606,10 @@ } public void addAndSetMaxSteps(int steps) { + } + + public Component getComponent() { + return this; } }