Lines 15-24
Link Here
|
15 |
|
15 |
|
16 |
// May use core, GUI, ad nauseum. |
16 |
// May use core, GUI, ad nauseum. |
17 |
|
17 |
|
|
|
18 |
import java.awt.Component; |
18 |
import java.io.File; |
19 |
import java.io.File; |
19 |
import java.text.Collator; |
20 |
import java.text.Collator; |
20 |
import java.util.*; |
21 |
import java.util.*; |
21 |
import javax.swing.JOptionPane; |
22 |
import javax.swing.JOptionPane; |
|
|
23 |
import org.netbeans.core.startup.Splash.SplashOutput; |
22 |
import org.openide.ErrorManager; |
24 |
import org.openide.ErrorManager; |
23 |
import org.openide.filesystems.FileObject; |
25 |
import org.openide.filesystems.FileObject; |
24 |
import org.openide.modules.SpecificationVersion; |
26 |
import org.openide.modules.SpecificationVersion; |
Lines 268-286
Link Here
|
268 |
} |
270 |
} |
269 |
} |
271 |
} |
270 |
private static final class Notifier implements Runnable { |
272 |
private static final class Notifier implements Runnable { |
|
|
273 |
private static int questions; |
274 |
|
271 |
private boolean warn; |
275 |
private boolean warn; |
272 |
private String text; |
276 |
private String text; |
273 |
private static RequestProcessor RP = new RequestProcessor("Notify About Module System"); // NOI18N |
277 |
private static RequestProcessor RP = new RequestProcessor("Notify About Module System"); // NOI18N |
|
|
278 |
private volatile boolean shown; |
279 |
private Object[] options; |
280 |
private Object value; |
274 |
|
281 |
|
275 |
public Notifier(String text, boolean type) { |
282 |
public Notifier(String text, boolean type) { |
276 |
this.warn = type; |
283 |
this.warn = type; |
277 |
this.text = text; |
284 |
this.text = text; |
278 |
RP.post(this, 0, Thread.MIN_PRIORITY); |
285 |
//this.options = options; |
|
|
286 |
RequestProcessor.Task t = RP.post(this, 0, Thread.MIN_PRIORITY); |
287 |
|
288 |
if (questions++ == 0) { |
289 |
this.options = new String[] { |
290 |
NbBundle.getMessage(Notifier.class, "MSG_continue"), |
291 |
NbBundle.getMessage(Notifier.class, "MSG_exit"), |
292 |
}; |
293 |
} |
294 |
|
295 |
if (options != null) { |
296 |
try { |
297 |
t.waitFinished(10000); |
298 |
} catch (InterruptedException ex) { |
299 |
// ok, this is not a problem |
300 |
} |
301 |
if (shown) { |
302 |
t.waitFinished(); |
303 |
} |
304 |
} |
305 |
} |
306 |
|
307 |
public Object getOption() { |
308 |
return value; |
279 |
} |
309 |
} |
280 |
public void run() { |
310 |
public void run() { |
|
|
311 |
shown = true; |
312 |
|
281 |
int type = warn ? JOptionPane.WARNING_MESSAGE : JOptionPane.INFORMATION_MESSAGE; |
313 |
int type = warn ? JOptionPane.WARNING_MESSAGE : JOptionPane.INFORMATION_MESSAGE; |
282 |
String msg = NbBundle.getMessage(Notifier.class, warn ? "MSG_warning" : "MSG_info"); // NOI18N |
314 |
String msg = NbBundle.getMessage(Notifier.class, warn ? "MSG_warning" : "MSG_info"); // NOI18N |
283 |
JOptionPane.showMessageDialog(null, text, msg, type); |
315 |
|
|
|
316 |
Splash.SplashOutput out = org.netbeans.core.startup.Main.getSplash(); |
317 |
Component c = out == null ? null : out.getComponent(); |
318 |
|
319 |
if (options == null) { |
320 |
JOptionPane.showMessageDialog(null, text, msg, type); |
321 |
} else { |
322 |
int ret = JOptionPane.showOptionDialog(c, text, msg, 0, type, null, options, options[0]); |
323 |
if (ret == 1) { |
324 |
TopSecurityManager.exit(1); |
325 |
} |
326 |
} |
284 |
} |
327 |
} |
285 |
} |
328 |
} |
286 |
|
329 |
|