1 11 package org.eclipse.jdt.internal.debug.ui; 12 13 import java.net.URL ; 14 15 import org.eclipse.core.runtime.FileLocator; 16 import org.eclipse.core.runtime.Path; 17 import org.eclipse.core.runtime.Platform; 18 import org.eclipse.jface.resource.ImageDescriptor; 19 import org.eclipse.jface.resource.ImageRegistry; 20 import org.eclipse.swt.graphics.Image; 21 import org.osgi.framework.Bundle; 22 23 26 public class JavaDebugImages { 27 28 private static String ICONS_PATH = "$nl$/icons/full/"; 30 private static ImageRegistry fgImageRegistry = null; 32 33 36 public static final String IMG_OBJS_EXCEPTION= "IMG_OBJS_EXCEPTION"; public static final String IMG_OBJS_EXCEPTION_DISABLED= "IMG_OBJS_EXCEPTION_DISABLED"; public static final String IMG_OBJS_ERROR= "IMG_OBJS_ERROR"; 40 public static final String IMG_OVR_BREAKPOINT_INSTALLED= "IMG_OBJS_BREAKPOINT_INSTALLED"; public static final String IMG_OVR_BREAKPOINT_INSTALLED_DISABLED= "IMG_OBJS_BREAKPOINT_INSTALLED_DISABLED"; 43 public static final String IMG_OBJS_LOCAL_VARIABLE = "IMG_OBJS_LOCAL_VARIABLE"; 45 public static final String IMG_OVR_METHOD_BREAKPOINT_ENTRY= "IMG_OBJS_METHOD_BREAKPOINT_ENTRY"; public static final String IMG_OVR_METHOD_BREAKPOINT_ENTRY_DISABLED= "IMG_OBJS_METHOD_BREAKPOINT_ENTRY_DISABLED"; public static final String IMG_OVR_METHOD_BREAKPOINT_EXIT= "IMG_OBJS_METHOD_BREAKPOINT_EXIT"; public static final String IMG_OVR_METHOD_BREAKPOINT_EXIT_DISABLED= "IMG_OBJS_METHOD_BREAKPOINT_EXIT_DISABLED"; 50 public static final String IMG_OVR_CONDITIONAL_BREAKPOINT= "IMG_OBJS_CONDITIONAL_BREAKPOINT"; public static final String IMG_OVR_CONDITIONAL_BREAKPOINT_DISABLED= "IMG_OBJS_CONDITIONAL_BREAKPOINT_DISABLED"; 53 public static final String IMG_OVR_SCOPED_BREAKPOINT= "IMG_OBJS_SCOPED_BREAKPOINT"; public static final String IMG_OVR_SCOPED_BREAKPOINT_DISABLED= "IMG_OBJS_SCOPED_BREAKPOINT_DISABLED"; 56 public static final String IMG_OVR_UNCAUGHT_BREAKPOINT= "IMG_OBJS_UNCAUGHT_BREAKPOINT"; public static final String IMG_OVR_UNCAUGHT_BREAKPOINT_DISABLED= "IMG_OBJS_UNCAUGHT_BREAKPOINT_DISABLED"; 59 public static final String IMG_OVR_CAUGHT_BREAKPOINT= "IMG_OBJS_CAUGHT_BREAKPOINT"; public static final String IMG_OVR_CAUGHT_BREAKPOINT_DISABLED= "IMG_OBJS_CAUGHT_BREAKPOINT_DISABLED"; 62 public static final String IMG_OBJS_SNIPPET_EVALUATING= "IMG_OBJS_SNIPPET_EVALUATING"; 64 public static final String IMG_VIEW_ARGUMENTS_TAB= "IMG_VIEW_ARGUMENTS_TAB"; 66 public static final String IMG_OBJS_MONITOR = "IMG_OBJS_MONITOR"; public static final String IMG_OBJS_CONTENDED_MONITOR = "IMG_OBJS_CONTENDED_MONITOR"; public static final String IMG_OBJS_OWNED_MONITOR = "IMG_OBJS_OWNED_MONITOR"; 70 public static final String IMG_OBJS_REFERENCE = "IMG_OBJS_REFERENCE"; 72 public static final String IMG_OVR_OWNED = "IMG_OVR_OWNED"; public static final String IMG_OVR_OWNS_MONITOR = "IMG_OVR_OWNS_MONITOR"; public static final String IMG_OVR_IN_CONTENTION = "IMG_OVR_IN_CONTENTION"; public static final String IMG_OVR_IN_CONTENTION_FOR_MONITOR = "IMG_OVR_IN_CONTENTION_FOR_MONITOR"; public static final String IMG_OVR_IN_DEADLOCK = "IMG_OVR_IN_DEADLOCK"; 78 public static final String IMG_OBJS_EXCEPTION_BRKPT_TYPE = "IMG_OBJS_EXCEPTION_BRKPT_TYPE"; public static final String IMG_OBJS_LINE_BRKPT_TYPE = "IMG_OBJS_LINE_BRKPT_TYPE"; public static final String IMG_OBJS_CLASSLOAD_BRKPT_TYPE = "IMG_OBJS_CLASSLOAD_BRKPT_TYPE"; public static final String IMG_OBJS_WATCHPOINT_TYPE = "IMG_OBJS_WATCHPOINT_TYPE"; public static final String IMG_OBJS_JSP_BRKPT_TYPE = "IMG_OBJS_JSP_BRKPT_TYPE"; public static final String IMG_OBJS_METHOD_BRKPT_TYPE = "IMG_OBJS_METHOD_BRKPT_TYPE"; public static final String IMG_OBJS_THREAD_GROUP = "IMG_OBJS_THREAD_GROUP"; 86 public static final String IMG_OBJS_CLASSPATH = "IMG_OBJS_CLASSPATH"; 88 public static final String IMG_OVR_OUT_OF_SYNCH = "IMG_OVR_OUT_OF_SYNCH"; public static final String IMG_OVR_MAY_BE_OUT_OF_SYNCH = "IMG_OVR_MAY_BE_OUT_OF_SYNCH"; public static final String IMG_OVR_SYNCHRONIZED = "IMG_OVR_SYNCHRONIZED"; 92 public static final String IMG_WIZBAN_NEWSCRAPPAGE = "IMG_WIZBAN_NEWSCRAPPAGE"; public static final String IMG_WIZBAN_LIBRARY = "IMG_WIZBAN_LIBRARY"; public static final String IMG_TOOL_TERMSNIPPET = "IMG_TOOL_TERMSNIPPET"; public static final String IMG_TOOL_TERMSNIPPET_HOVER = "IMG_TOOL_TERMSNIPPET_HOVER"; public static final String IMG_TOOL_TERMSNIPPET_DISABLED = "IMG_TOOL_TERMSNIPPET_DISABLED"; public static final String IMG_OBJ_JAVA_INSPECT_EXPRESSION = "IMG_OBJ_JAVA_INSPECT_EXPRESSION"; 99 public static final String IMG_ELCL_AUTO_FORMAT = "IMG_ELCL_AUTO_FORMAT"; 101 public static final String IMG_ELCL_ALL_REFERENCES = "IMG_ELCL_ALL_REFERENCES"; 103 106 private static final String T_OBJ= ICONS_PATH + "obj16/"; private static final String T_OVR= ICONS_PATH + "ovr16/"; private static final String T_WIZBAN= ICONS_PATH + "wizban/"; private static final String T_EVIEW= ICONS_PATH + "eview16/"; private static final String T_DLCL= ICONS_PATH + "dtool16/"; private static final String T_ELCL= ICONS_PATH + "etool16/"; private static final String E_LCL = ICONS_PATH + "elcl16/"; 114 120 public static Image get(String key) { 121 return getImageRegistry().get(key); 122 } 123 124 128 public static ImageDescriptor getImageDescriptor(String key) { 129 return getImageRegistry().getDescriptor(key); 130 } 131 132 135 static ImageRegistry getImageRegistry() { 136 if (fgImageRegistry == null) { 137 initializeImageRegistry(); 138 } 139 return fgImageRegistry; 140 } 141 142 private static void initializeImageRegistry() { 143 fgImageRegistry= new ImageRegistry(JDIDebugUIPlugin.getStandardDisplay()); 144 declareImages(); 145 } 146 147 private static void declareImages() { 148 declareRegistryImage(IMG_OBJS_EXCEPTION, T_OBJ + "jexception_obj.gif"); declareRegistryImage(IMG_OBJS_EXCEPTION_DISABLED, T_OBJ + "jexceptiond_obj.gif"); declareRegistryImage(IMG_OVR_BREAKPOINT_INSTALLED, T_OVR + "installed_ovr.gif"); declareRegistryImage(IMG_OVR_BREAKPOINT_INSTALLED_DISABLED, T_OVR + "installed_ovr_disabled.gif"); declareRegistryImage(IMG_OBJS_REFERENCE, T_OBJ + "reference_obj.gif"); 154 declareRegistryImage(IMG_OBJS_LOCAL_VARIABLE, T_OBJ + "localvariable_obj.gif"); 156 declareRegistryImage(IMG_OVR_METHOD_BREAKPOINT_ENTRY, T_OVR + "entry_ovr.gif"); declareRegistryImage(IMG_OVR_METHOD_BREAKPOINT_ENTRY_DISABLED, T_OVR + "entry_ovr_disabled.gif"); declareRegistryImage(IMG_OVR_METHOD_BREAKPOINT_EXIT, T_OVR + "exit_ovr.gif"); declareRegistryImage(IMG_OVR_METHOD_BREAKPOINT_EXIT_DISABLED, T_OVR + "exit_ovr_disabled.gif"); 161 declareRegistryImage(IMG_OVR_CONDITIONAL_BREAKPOINT, T_OVR + "conditional_ovr.gif"); declareRegistryImage(IMG_OVR_CONDITIONAL_BREAKPOINT_DISABLED, T_OVR + "conditional_ovr_disabled.gif"); 164 declareRegistryImage(IMG_OVR_SCOPED_BREAKPOINT, T_OVR + "scoped_ovr.gif"); declareRegistryImage(IMG_OVR_SCOPED_BREAKPOINT_DISABLED, T_OVR + "scoped_ovr_disabled.gif"); 167 declareRegistryImage(IMG_OVR_UNCAUGHT_BREAKPOINT, T_OVR + "uncaught_ovr.gif"); declareRegistryImage(IMG_OVR_UNCAUGHT_BREAKPOINT_DISABLED, T_OVR + "uncaught_ovr_disabled.gif"); 170 declareRegistryImage(IMG_OVR_CAUGHT_BREAKPOINT, T_OVR + "caught_ovr.gif"); declareRegistryImage(IMG_OVR_CAUGHT_BREAKPOINT_DISABLED, T_OVR + "caught_ovr_disabled.gif"); 173 declareRegistryImage(IMG_OBJS_ERROR, T_OBJ + "jrtexception_obj.gif"); 175 declareRegistryImage(IMG_OBJS_SNIPPET_EVALUATING, T_OBJ + "jsbook_run_obj.gif"); 177 declareRegistryImage(IMG_VIEW_ARGUMENTS_TAB, T_EVIEW + "variable_tab.gif"); 179 declareRegistryImage(IMG_OVR_OUT_OF_SYNCH, T_OVR + "error_co.gif"); declareRegistryImage(IMG_OVR_MAY_BE_OUT_OF_SYNCH, T_OVR + "warning_co.gif"); declareRegistryImage(IMG_OVR_SYNCHRONIZED, T_OVR + "sync_ovr.gif"); 183 declareRegistryImage(IMG_OBJS_MONITOR, T_OBJ + "monitor_obj.gif"); declareRegistryImage(IMG_OVR_OWNED, T_OVR + "owned_ovr.gif"); declareRegistryImage(IMG_OVR_OWNS_MONITOR, T_OVR + "ownsmonitor_ovr.gif"); declareRegistryImage(IMG_OVR_IN_CONTENTION, T_OVR + "contention_ovr.gif"); declareRegistryImage(IMG_OVR_IN_CONTENTION_FOR_MONITOR, T_OVR + "contentionformonitor_ovr.gif"); declareRegistryImage(IMG_OVR_IN_DEADLOCK, T_OVR + "deadlock_ovr.gif"); declareRegistryImage(IMG_OBJS_CONTENDED_MONITOR, T_OBJ + "contended_monitor_obj.gif"); declareRegistryImage(IMG_OBJS_OWNED_MONITOR, T_OBJ + "owned_monitor_obj.gif"); declareRegistryImage(IMG_OBJS_THREAD_GROUP, T_OBJ + "threadgroup_obj.gif"); 193 declareRegistryImage(IMG_WIZBAN_NEWSCRAPPAGE, T_WIZBAN + "newsbook_wiz.png"); declareRegistryImage(IMG_WIZBAN_LIBRARY, T_WIZBAN + "library_wiz.png"); 196 declareRegistryImage(IMG_TOOL_TERMSNIPPET, T_ELCL + "term_sbook.gif"); declareRegistryImage(IMG_TOOL_TERMSNIPPET_HOVER, T_ELCL + "term_sbook.gif"); declareRegistryImage(IMG_TOOL_TERMSNIPPET_DISABLED, T_DLCL + "term_sbook.gif"); 200 declareRegistryImage(IMG_OBJ_JAVA_INSPECT_EXPRESSION, T_OBJ + "insp_sbook.gif"); declareRegistryImage(IMG_OBJS_CLASSPATH, T_OBJ + "classpath_obj.gif"); 203 declareRegistryImage(IMG_OBJS_EXCEPTION_BRKPT_TYPE, T_OBJ + "jexcept_obj.gif"); declareRegistryImage(IMG_OBJS_LINE_BRKPT_TYPE, T_OBJ + "jline_obj.gif"); declareRegistryImage(IMG_OBJS_CLASSLOAD_BRKPT_TYPE, T_OBJ + "jload_obj.gif"); declareRegistryImage(IMG_OBJS_METHOD_BRKPT_TYPE, T_OBJ + "jmeth_obj.gif"); declareRegistryImage(IMG_OBJS_JSP_BRKPT_TYPE, T_OBJ + "jspbrkpt_obj.gif"); declareRegistryImage(IMG_OBJS_WATCHPOINT_TYPE, T_OBJ + "jwatch_obj.gif"); 210 declareRegistryImage(IMG_ELCL_AUTO_FORMAT, E_LCL + "autoform_menu.gif"); 212 declareRegistryImage(IMG_ELCL_ALL_REFERENCES, E_LCL + "all_references.gif"); } 214 215 221 private final static void declareRegistryImage(String key, String path) { 222 ImageDescriptor desc = ImageDescriptor.getMissingImageDescriptor(); 223 Bundle bundle = Platform.getBundle(JDIDebugUIPlugin.getUniqueIdentifier()); 224 URL url = null; 225 if (bundle != null){ 226 url = FileLocator.find(bundle, new Path(path), null); 227 desc = ImageDescriptor.createFromURL(url); 228 } 229 fgImageRegistry.put(key, desc); 230 } 231 } 232 | Popular Tags |