2 * (c) Copyright IBM Corp. 2000, 2001.
5 package net.sourceforge.phpdt.internal.corext.util;
7 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
9 import org.eclipse.core.runtime.IStatus;
10 import org.eclipse.core.runtime.Status;
12 //incastrix to be renamed
14 * Convenience class for error exceptions thrown inside PHPeclipse plugin.
16 public class PHPUIStatus extends Status {
18 // public PHPUIStatus(int code) {
19 // this(code, ""); //$NON-NLS-1$
22 private PHPUIStatus(int severity, int code, String message,
23 Throwable throwable) {
24 super(severity, PHPeclipsePlugin.getPluginId(), code, message,
28 // public PHPUIStatus(int code, String message) {
29 // this(code, message, null);
32 // public PHPUIStatus(int code, String message, Throwable throwable) {
33 // super(IStatus.ERROR, PHPeclipsePlugin.getPluginId(), code, message,
37 public static IStatus createError(int code, Throwable throwable) {
38 String message = throwable.getMessage();
39 if (message == null) {
40 message = throwable.getClass().getName();
42 return new PHPUIStatus(IStatus.ERROR, code, message, throwable);
45 // public static IStatus createError(int code, String message,
46 // Throwable throwable) {
47 // return new PHPUIStatus(IStatus.ERROR, code, message, throwable);
50 // public static IStatus createInfo(int code, String message,
51 // Throwable throwable) {
52 // return new PHPUIStatus(IStatus.INFO, code, message, throwable);
55 // public static IStatus createWarning(int code, String message,
56 // Throwable throwable) {
57 // return new PHPUIStatus(IStatus.WARNING, code, message, throwable);