2 * (c) Copyright IBM Corp. 2000, 2001.
5 package net.sourceforge.phpdt.internal.ui;
7 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
9 import org.eclipse.core.runtime.IStatus;
10 import org.eclipse.core.runtime.Status;
13 * Convenience class for error exceptions thrown inside PHPeclipse plugin.
15 public class PHPUIStatus extends Status {
17 public PHPUIStatus(int code) {
18 this(code, ""); //$NON-NLS-1$
21 private PHPUIStatus(int severity, int code, String message, Throwable throwable) {
22 super(severity, PHPeclipsePlugin.getPluginId(), code, message, throwable);
25 public PHPUIStatus(int code, String message) {
26 this(code, message, null);
29 public PHPUIStatus(int code, String message, Throwable throwable) {
30 super(IStatus.ERROR, PHPeclipsePlugin.getPluginId(), code, message, throwable);
33 public static IStatus createError(int code, Throwable throwable) {
34 String message= throwable.getMessage();
35 if (message == null) {
36 message= throwable.getClass().getName();
38 return new PHPUIStatus(IStatus.ERROR, code, message, throwable);
41 public static IStatus createError(int code, String message, Throwable throwable) {
42 return new PHPUIStatus(IStatus.ERROR, code, message, throwable);
45 public static IStatus createInfo(int code, String message, Throwable throwable) {
46 return new PHPUIStatus(IStatus.INFO, code, message, throwable);
49 public static IStatus createWarning(int code, String message, Throwable throwable) {
50 return new PHPUIStatus(IStatus.WARNING, code, message, throwable);