1 11 12 package org.eclipse.core.variables; 13 14 import org.eclipse.core.internal.variables.StringVariableManager; 15 import org.eclipse.core.runtime.IStatus; 16 import org.eclipse.core.runtime.Plugin; 17 import org.eclipse.core.runtime.Status; 18 19 23 public class VariablesPlugin extends Plugin { 24 25 28 public static final int INTERNAL_ERROR = 120; 29 30 33 public static final int REFERENCE_CYCLE_ERROR = 130; 34 35 38 private static VariablesPlugin plugin; 39 40 44 public static final String PI_CORE_VARIABLES = "org.eclipse.core.variables"; 46 47 55 public VariablesPlugin() { 56 super(); 57 plugin = this; 58 } 59 60 65 public static VariablesPlugin getDefault() { 66 return plugin; 67 } 68 69 74 public static void log(Throwable t) { 75 log(new Status(IStatus.ERROR, PI_CORE_VARIABLES, INTERNAL_ERROR, "Error logged from Core Variables: ", t)); } 77 78 84 public static void logMessage(String message, Throwable throwable) { 85 log(new Status(IStatus.ERROR, getUniqueIdentifier(), INTERNAL_ERROR, message, throwable)); 86 } 87 88 93 public static void log(IStatus status) { 94 getDefault().getLog().log(status); 95 } 96 97 100 public static String getUniqueIdentifier() { 101 return PI_CORE_VARIABLES; 102 } 103 104 109 public IStringVariableManager getStringVariableManager() { 110 return StringVariableManager.getDefault(); 111 } 112 } 113 | Popular Tags |