org.eclipse.cdt.internal.ui.util
Class ExceptionHandler

java.lang.Object
  extended by org.eclipse.cdt.internal.ui.util.ExceptionHandler

public class ExceptionHandler
extends java.lang.Object

The default exception handler shows an error dialog when one of its handle methods is called. If the passed exception is a CoreException an error dialog pops up showing the exception's status information. For a InvocationTargetException a normal message dialog pops up showing the exception's message. Additionally the exception is written to the platform log.


Constructor Summary
ExceptionHandler()
           
 
Method Summary
static void handle(org.eclipse.core.runtime.CoreException e, org.eclipse.swt.widgets.Shell parent, java.lang.String title, java.lang.String message)
          Handles the given CoreException.
static void handle(org.eclipse.core.runtime.CoreException e, java.lang.String title, java.lang.String message)
          Handles the given CoreException.
static void handle(java.lang.reflect.InvocationTargetException e, org.eclipse.swt.widgets.Shell parent, java.lang.String title, java.lang.String message)
          Handles the given InvocationTargetException.
static void handle(java.lang.reflect.InvocationTargetException e, java.lang.String title, java.lang.String message)
          Handles the given InvocationTargetException.
static void log(java.lang.Throwable t, java.lang.String message)
          Logs the given exception using the platform's logging mechanism.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionHandler

public ExceptionHandler()
Method Detail

log

public static void log(java.lang.Throwable t,
                       java.lang.String message)
Logs the given exception using the platform's logging mechanism. The exception is logged as an error with the error code JavaStatusConstants.INTERNAL_ERROR.


handle

public static void handle(org.eclipse.core.runtime.CoreException e,
                          java.lang.String title,
                          java.lang.String message)
Handles the given CoreException. The workbench shell is used as a parent for the dialog window.

Parameters:
e - the CoreException to be handled
title - the dialog window's window title
message - message to be displayed by the dialog window

handle

public static void handle(org.eclipse.core.runtime.CoreException e,
                          org.eclipse.swt.widgets.Shell parent,
                          java.lang.String title,
                          java.lang.String message)
Handles the given CoreException.

Parameters:
e - the CoreException to be handled
parent - the dialog window's parent shell
title - the dialog window's window title
message - message to be displayed by the dialog window

handle

public static void handle(java.lang.reflect.InvocationTargetException e,
                          java.lang.String title,
                          java.lang.String message)
Handles the given InvocationTargetException. The workbench shell is used as a parent for the dialog window.

Parameters:
e - the InvocationTargetException to be handled
title - the dialog window's window title
message - message to be displayed by the dialog window

handle

public static void handle(java.lang.reflect.InvocationTargetException e,
                          org.eclipse.swt.widgets.Shell parent,
                          java.lang.String title,
                          java.lang.String message)
Handles the given InvocationTargetException.

Parameters:
e - the InvocationTargetException to be handled
parent - the dialog window's parent shell
title - the dialog window's window title
message - message to be displayed by the dialog window