1 11 package org.eclipse.help.internal.webapp; 12 13 import org.eclipse.core.runtime.*; 14 import org.osgi.framework.*; 15 16 19 public class HelpWebappPlugin extends Plugin { 20 public final static String PLUGIN_ID = "org.eclipse.help.webapp"; 22 public static boolean DEBUG = false; 24 25 public static boolean DEBUG_WORKINGSETS = false; 26 27 protected static HelpWebappPlugin plugin; 28 29 31 34 public static synchronized void logError(String message, Throwable ex) { 35 if (message == null) 36 message = ""; Status errorStatus = new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, 38 message, ex); 39 HelpWebappPlugin.getDefault().getLog().log(errorStatus); 40 } 41 42 47 public static synchronized void logWarning(String message) { 48 if (HelpWebappPlugin.DEBUG) { 49 if (message == null) 50 message = ""; Status warningStatus = new Status(IStatus.WARNING, PLUGIN_ID, 52 IStatus.OK, message, null); 53 HelpWebappPlugin.getDefault().getLog().log(warningStatus); 54 } 55 } 56 57 60 public static HelpWebappPlugin getDefault() { 61 return plugin; 62 } 63 64 69 public void start(BundleContext context) throws Exception { 70 super.start(context); 71 plugin = this; 72 DEBUG = isDebugging(); 76 if (DEBUG) { 77 DEBUG_WORKINGSETS = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.help.webapp/debug/workingsets")); } 79 } 80 81 86 public void stop(BundleContext context) throws Exception { 87 plugin = null; 88 super.stop(context); 90 } 91 } 92 | Popular Tags |