1 11 package org.eclipse.jdt.internal.ui; 12 13 import org.eclipse.core.runtime.IStatus; 14 import org.eclipse.core.runtime.Status; 15 16 19 public class JavaUIStatus extends Status { 20 21 private JavaUIStatus(int severity, int code, String message, Throwable throwable) { 22 super(severity, JavaPlugin.getPluginId(), code, message, throwable); 23 } 24 25 public static IStatus createError(int code, Throwable throwable) { 26 String message= throwable.getMessage(); 27 if (message == null) { 28 message= throwable.getClass().getName(); 29 } 30 return new JavaUIStatus(IStatus.ERROR, code, message, throwable); 31 } 32 33 public static IStatus createError(int code, String message, Throwable throwable) { 34 return new JavaUIStatus(IStatus.ERROR, code, message, throwable); 35 } 36 37 public static IStatus createWarning(int code, String message, Throwable throwable) { 38 return new JavaUIStatus(IStatus.WARNING, code, message, throwable); 39 } 40 41 public static IStatus createInfo(int code, String message, Throwable throwable) { 42 return new JavaUIStatus(IStatus.INFO, code, message, throwable); 43 } 44 } 45 46 | Popular Tags |