1 11 package org.eclipse.pde.internal.runtime; 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.jface.resource.ImageDescriptor; 18 import org.eclipse.jface.resource.ImageRegistry; 19 import org.eclipse.swt.graphics.Image; 20 21 public class PDERuntimePluginImages { 22 23 private final static ImageRegistry PLUGIN_REGISTRY = 24 PDERuntimePlugin.getDefault().getImageRegistry(); 25 26 public final static String ICONS_PATH = "icons/"; 28 private static final String PATH_OBJ = ICONS_PATH + "obj16/"; private static final String PATH_LCL = ICONS_PATH + "elcl16/"; private static final String PATH_LCL_DISABLED = ICONS_PATH + "dlcl16/"; private static final String PATH_OVR = ICONS_PATH + "ovr16/"; private static final String PATH_EVENTS = ICONS_PATH + "eview16/"; 34 35 public static final ImageDescriptor DESC_ERROR_ST_OBJ = 36 create(PATH_OBJ, "error_st_obj.gif"); public static final ImageDescriptor DESC_ERROR_STACK_OBJ = 38 create(PATH_OBJ, "error_stack.gif"); public static final ImageDescriptor DESC_EXT_POINT_OBJ = 40 create(PATH_OBJ, "ext_point_obj.gif"); public static final ImageDescriptor DESC_EXT_POINTS_OBJ = 42 create(PATH_OBJ, "ext_points_obj.gif"); public static final ImageDescriptor DESC_EXTENSION_OBJ = 44 create(PATH_OBJ, "extension_obj.gif"); public static final ImageDescriptor DESC_EXTENSIONS_OBJ = 46 create(PATH_OBJ, "extensions_obj.gif"); public static final ImageDescriptor DESC_GENERIC_XML_OBJ = 48 create(PATH_OBJ, "generic_xml_obj.gif"); public static final ImageDescriptor DESC_ATTR_XML_OBJ = 50 create(PATH_OBJ, "attr_xml_obj.gif"); public static final ImageDescriptor DESC_INFO_ST_OBJ = 52 create(PATH_OBJ, "info_st_obj.gif"); public static final ImageDescriptor DESC_JAVA_LIB_OBJ = 54 create(PATH_OBJ, "java_lib_obj.gif"); public static final ImageDescriptor DESC_NATIVE_LIB_OBJ = 56 create(PATH_OBJ, "native_lib_obj.gif"); public static final ImageDescriptor DESC_OK_ST_OBJ = 58 create(PATH_OBJ, "ok_st_obj.gif"); public static final ImageDescriptor DESC_PLUGIN_OBJ = 60 create(PATH_OBJ, "plugin_obj.gif"); public static final ImageDescriptor DESC_REQ_PLUGIN_OBJ = 62 create(PATH_OBJ, "req_plugin_obj.gif"); public static final ImageDescriptor DESC_REQ_PLUGINS_OBJ = 64 create(PATH_OBJ, "req_plugins_obj.gif"); public static final ImageDescriptor DESC_RUNTIME_OBJ = 66 create(PATH_OBJ, "runtime_obj.gif"); public static final ImageDescriptor DESC_WARNING_ST_OBJ = 68 create(PATH_OBJ, "warning_st_obj.gif"); public static final ImageDescriptor DESC_LOCATION = 70 create(PATH_OBJ, "location_obj.gif"); 72 75 76 public static final ImageDescriptor DESC_PROPERTIES = 77 create(PATH_LCL, "properties.gif"); public static final ImageDescriptor DESC_OPEN_LOG = 79 create(PATH_LCL, "open_log.gif"); public static final ImageDescriptor DESC_OPEN_LOG_DISABLED = 81 create(PATH_LCL_DISABLED, "open_log.gif"); 83 public static final ImageDescriptor DESC_PROPERTIES_DISABLED = 84 create(PATH_LCL_DISABLED, "properties.gif"); public static final ImageDescriptor DESC_REFRESH = 86 create(PATH_LCL, "refresh.gif"); public static final ImageDescriptor DESC_REFRESH_DISABLED = 88 create(PATH_LCL_DISABLED, "refresh.gif"); public static final ImageDescriptor DESC_CLEAR = create(PATH_LCL, "clear.gif"); public static final ImageDescriptor DESC_CLEAR_DISABLED = 91 create(PATH_LCL_DISABLED, "clear.gif"); 93 public static final ImageDescriptor DESC_READ_LOG = 94 create(PATH_LCL, "restore_log.gif"); public static final ImageDescriptor DESC_READ_LOG_DISABLED = 96 create(PATH_LCL_DISABLED, "restore_log.gif"); 98 public static final ImageDescriptor DESC_REMOVE_LOG = 99 create(PATH_LCL, "remove.gif"); public static final ImageDescriptor DESC_REMOVE_LOG_DISABLED = 101 create(PATH_LCL_DISABLED, "remove.gif"); 103 public static final ImageDescriptor DESC_FILTER = 104 create(PATH_LCL, "filter_ps.gif"); public static final ImageDescriptor DESC_FILTER_DISABLED = 106 create(PATH_LCL_DISABLED, "filter_ps.gif"); 108 public static final ImageDescriptor DESC_EXPORT = 109 create(PATH_LCL, "export_log.gif"); public static final ImageDescriptor DESC_EXPORT_DISABLED = 111 create(PATH_LCL_DISABLED, "export_log.gif"); 113 public static final ImageDescriptor DESC_IMPORT = 114 create(PATH_LCL, "import_log.gif"); public static final ImageDescriptor DESC_IMPORT_DISABLED = 116 create(PATH_LCL_DISABLED, "import_log.gif"); 118 public static final ImageDescriptor DESC_COLLAPSE_ALL = 119 create(PATH_LCL, "collapseall.gif"); 121 124 public static final ImageDescriptor DESC_PREV_EVENT = 125 create(PATH_EVENTS, "event_prev.gif"); public static final ImageDescriptor DESC_NEXT_EVENT = 127 create(PATH_EVENTS, "event_next.gif"); 131 public static final ImageDescriptor DESC_RUN_CO = 132 create(PATH_OVR, "run_co.gif"); public static final ImageDescriptor DESC_EXPORT_CO = 134 create(PATH_OVR, "export_co.gif"); public static final ImageDescriptor DESC_ERROR_CO = 136 create(PATH_OVR, "error_co.gif"); 138 private static ImageDescriptor create(String prefix, String name) { 139 return ImageDescriptor.createFromURL(makeIconURL(prefix, name)); 140 } 141 142 public static Image get(String key) { 143 return PLUGIN_REGISTRY.get(key); 144 } 145 private static URL makeIconURL(String prefix, String name) { 146 String path = "$nl$/" + prefix + name; return FileLocator.find(PDERuntimePlugin.getDefault().getBundle(), new Path(path), null); 148 } 149 public static Image manage(String key, ImageDescriptor desc) { 150 Image image = desc.createImage(); 151 PLUGIN_REGISTRY.put(key, image); 152 return image; 153 } 154 } 155 | Popular Tags |