multex
Class Awt

java.lang.Object
  |
  +--multex.Awt

public class Awt
extends java.lang.Object

Services for reporting onto AWT Dialogs the messages for any exception with dynamic or static or no internationalization. The exception can be

For setting static internationalization see MsgText.

Author:
Christoph Knabe, Berlin, Copyright 1999-2001

Method Summary
static int countLines(java.lang.String i_text)
          Result: Number of lines in String i_text.
static void report(java.awt.Component io_ownerHook, java.lang.Throwable i_throwable)
          Reports i_throwable into an error message dialog with static internationalization.
static void report(java.awt.Component io_ownerHook, java.lang.Throwable i_throwable, java.util.ResourceBundle i_resourceBundle)
          Reports i_throwable into an AWT Dialog, detail description here.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

report

public static void report(java.awt.Component io_ownerHook,
                          java.lang.Throwable i_throwable)
Reports i_throwable into an error message dialog with static internationalization. For details see @link #report(java.awt.Component, Throwable, ResourceBundle)}.


report

public static void report(java.awt.Component io_ownerHook,
                          java.lang.Throwable i_throwable,
                          java.util.ResourceBundle i_resourceBundle)
Reports i_throwable into an AWT Dialog, detail description here.
Firstly reports the same as Msg.printMessages(StringBuffer, Throwable, ResourceBundle) into a pop-up window of appropriate size. Accepting the message is done by Each of these will close the dialog box.

The Button "Show Stack Trace" will add the compactified stack trace including the chain of all causing exceptions to the message dialog box. The contents of the compact stack trace are described at method Msg.printStackTrace(StringBuffer,Throwable).

In an application this method should not be called directly from a GUI class, but the author of each GUI class should set up a method e.g.

   private void _report(Throwable ex){Awt.report(this,ex,null);}
   
, which will be called from each catch-clause in the event listeners and adds the actual GUI class as the owner of the message dialog.

Parameters:
io_ownerHook - The owner Window of the dialog box will be determined from io_ownerHook by searching the nearest parent Window. The owner window is blocked for further input until this dialog box will be closed. If the owner hook is null, the dialog is created as a nonmodal dialog with a shared, anonymous owner frame.
i_throwable - The exception to be reported along with its causal chain
i_resourceBundle - Where to take from the message texts for the exceptions to be reported. If null, falls back to static or no internationalization, depending on the actual state of @{link MsgText}.
See Also:
Msg.printReport(StringBuffer,Throwable, ResourceBundle)

countLines

public static int countLines(java.lang.String i_text)
Result: Number of lines in String i_text. Useful for sizing the text area in a message window.

See Also:
BufferedReader.readLine()