2 * (c) Copyright IBM Corp. 2000, 2001.
5 package net.sourceforge.phpdt.internal.corext.util;
7 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
8 //import net.sourceforge.phpeclipse.ui.WebUI;
10 import org.eclipse.core.runtime.IStatus;
11 import org.eclipse.core.runtime.Status;
13 //incastrix to be renamed
15 * Convenience class for error exceptions thrown inside PHPeclipse plugin.
17 public class PHPUIStatus extends Status {
19 public PHPUIStatus(int code) {
20 this(code, ""); //$NON-NLS-1$
23 private PHPUIStatus(int severity, int code, String message,
24 Throwable throwable) {
25 super(severity, PHPeclipsePlugin.getPluginId(), code, message,
29 public PHPUIStatus(int code, String message) {
30 this(code, message, null);
33 public PHPUIStatus(int code, String message, Throwable throwable) {
34 super(IStatus.ERROR, PHPeclipsePlugin.getPluginId(), code, message,
38 public static IStatus createError(int code, Throwable throwable) {
39 String message = throwable.getMessage();
40 if (message == null) {
41 message = throwable.getClass().getName();
43 return new PHPUIStatus(IStatus.ERROR, code, message, throwable);
46 public static IStatus createError(int code, String message,
47 Throwable throwable) {
48 return new PHPUIStatus(IStatus.ERROR, code, message, throwable);
51 public static IStatus createInfo(int code, String message,
52 Throwable throwable) {
53 return new PHPUIStatus(IStatus.INFO, code, message, throwable);
56 public static IStatus createWarning(int code, String message,
57 Throwable throwable) {
58 return new PHPUIStatus(IStatus.WARNING, code, message, throwable);