From a4aa681612c27f10fa6fb8ab3856454750768daf Mon Sep 17 00:00:00 2001 From: megacz Date: Fri, 30 Jan 2004 06:48:41 +0000 Subject: [PATCH] 2002/07/02 00:18:00 darcs-hash:20040130064841-2ba56-dcdc0ad82d5a80948a5f26bda2ee3f7292a9216d.gz --- CHANGES | 1 + src/org/xwt/plat/AWT.java | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/CHANGES b/CHANGES index 9d3809d..1a57ad4 100644 --- a/CHANGES +++ b/CHANGES @@ -238,3 +238,4 @@ 01-Jul megacz TinySSL.java, HTTP.java: fixed SSL-over-Proxy +01-Jul megacz AWT.java: added dialog for critical aborts diff --git a/src/org/xwt/plat/AWT.java b/src/org/xwt/plat/AWT.java index ab3cfa9..4a79839 100644 --- a/src/org/xwt/plat/AWT.java +++ b/src/org/xwt/plat/AWT.java @@ -27,6 +27,26 @@ public class AWT extends Platform { protected int _getMaxDescent(String font) { return getFont(font).metrics.getMaxDescent(); } protected boolean _supressDirtyOnResize() { return true; } + protected void _criticalAbort(String message) { + if (Log.on) Log.log(this, message); + final Dialog d = new Dialog(new Frame(), "XWT Cannot Continue"); + d.setLayout(new BorderLayout()); + TextArea ta = new TextArea("XWT cannot continue because:\n\n" + message, 10, 80); + ta.setEditable(false); + d.add(ta, "Center"); + Button b = new Button("OK"); + b.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + d.dispose(); + } + }); + d.add(b, "South"); + d.setModal(true); + d.pack(); + d.show(); + new Semaphore().block(); + } + protected String _getClipBoard() { Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard(); if (cb == null) return null; -- 1.7.10.4