1 /*******************************************************************************
2 * Copyright (c) 2000, 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.internal.debug.core;
13 import java.net.MalformedURLException;
16 import org.eclipse.jface.resource.ImageDescriptor;
17 import org.eclipse.jface.resource.ImageRegistry;
18 import org.eclipse.swt.graphics.Image;
20 public class PHPDegugCorePluginImages {
22 private final static URL BASE_URL = PHPDebugCorePlugin.getDefault()
23 .getBundle().getEntry("/");
25 private final static ImageRegistry PLUGIN_REGISTRY = PHPDebugCorePlugin
26 .getDefault().getImageRegistry();
28 public final static String ICONS_PATH = "icons/"; //$NON-NLS-1$
30 private static final String PATH_OBJ = ICONS_PATH + "obj16/"; //$NON-NLS-1$
32 private static final String PATH_LCL = ICONS_PATH + "elcl16/"; //$NON-NLS-1$
34 private static final String PATH_LCL_DISABLED = ICONS_PATH + "dlcl16/"; //$NON-NLS-1$
36 private static final String PATH_OVR = ICONS_PATH + "ovr16/"; //$NON-NLS-1$
38 private static final String PATH_EVENTS = ICONS_PATH + "eview16/"; //$NON-NLS-1$
40 public static final ImageDescriptor DESC_ERROR_ST_OBJ = create(PATH_OBJ,
41 "error_st_obj.gif"); //$NON-NLS-1$
43 public static final ImageDescriptor DESC_ERROR_STACK_OBJ = create(PATH_OBJ,
44 "error_stack.gif"); //$NON-NLS-1$
46 public static final ImageDescriptor DESC_EXT_POINT_OBJ = create(PATH_OBJ,
47 "ext_point_obj.gif"); //$NON-NLS-1$
49 public static final ImageDescriptor DESC_EXT_POINTS_OBJ = create(PATH_OBJ,
50 "ext_points_obj.gif"); //$NON-NLS-1$
52 public static final ImageDescriptor DESC_EXTENSION_OBJ = create(PATH_OBJ,
53 "extension_obj.gif"); //$NON-NLS-1$
55 public static final ImageDescriptor DESC_EXTENSIONS_OBJ = create(PATH_OBJ,
56 "extensions_obj.gif"); //$NON-NLS-1$
58 public static final ImageDescriptor DESC_GENERIC_XML_OBJ = create(PATH_OBJ,
59 "generic_xml_obj.gif"); //$NON-NLS-1$
61 public static final ImageDescriptor DESC_INFO_ST_OBJ = create(PATH_OBJ,
62 "info_st_obj.gif"); //$NON-NLS-1$
64 public static final ImageDescriptor DESC_JAVA_LIB_OBJ = create(PATH_OBJ,
65 "java_lib_obj.gif"); //$NON-NLS-1$
67 public static final ImageDescriptor DESC_NATIVE_LIB_OBJ = create(PATH_OBJ,
68 "native_lib_obj.gif"); //$NON-NLS-1$
70 public static final ImageDescriptor DESC_OK_ST_OBJ = create(PATH_OBJ,
71 "ok_st_obj.gif"); //$NON-NLS-1$
73 public static final ImageDescriptor DESC_PLUGIN_OBJ = create(PATH_OBJ,
74 "plugin_obj.gif"); //$NON-NLS-1$
76 public static final ImageDescriptor DESC_REQ_PLUGIN_OBJ = create(PATH_OBJ,
77 "req_plugin_obj.gif"); //$NON-NLS-1$
79 public static final ImageDescriptor DESC_REQ_PLUGINS_OBJ = create(PATH_OBJ,
80 "req_plugins_obj.gif"); //$NON-NLS-1$
82 public static final ImageDescriptor DESC_RUNTIME_OBJ = create(PATH_OBJ,
83 "runtime_obj.gif"); //$NON-NLS-1$
85 public static final ImageDescriptor DESC_WARNING_ST_OBJ = create(PATH_OBJ,
86 "warning_st_obj.gif"); //$NON-NLS-1$
89 * Local tool bar image descriptors
92 public static final ImageDescriptor DESC_PROPERTIES = create(PATH_LCL,
93 "properties.gif"); //$NON-NLS-1$
95 public static final ImageDescriptor DESC_OPEN_LOG = create(PATH_LCL,
96 "open_log.gif"); //$NON-NLS-1$
98 public static final ImageDescriptor DESC_OPEN_LOG_DISABLED = create(
99 PATH_LCL_DISABLED, "open_log.gif"); //$NON-NLS-1$
101 public static final ImageDescriptor DESC_PROPERTIES_DISABLED = create(
102 PATH_LCL_DISABLED, "properties.gif"); //$NON-NLS-1$
104 public static final ImageDescriptor DESC_REFRESH = create(PATH_LCL,
105 "refresh.gif"); //$NON-NLS-1$
107 public static final ImageDescriptor DESC_REFRESH_DISABLED = create(
108 PATH_LCL_DISABLED, "refresh.gif"); //$NON-NLS-1$
110 public static final ImageDescriptor DESC_CLEAR = create(PATH_LCL,
111 "clear.gif"); //$NON-NLS-1$
113 public static final ImageDescriptor DESC_CLEAR_DISABLED = create(
114 PATH_LCL_DISABLED, "clear.gif"); //$NON-NLS-1$
116 public static final ImageDescriptor DESC_READ_LOG = create(PATH_LCL,
117 "restore_log.gif"); //$NON-NLS-1$
119 public static final ImageDescriptor DESC_READ_LOG_DISABLED = create(
120 PATH_LCL_DISABLED, "restore_log.gif"); //$NON-NLS-1$
122 public static final ImageDescriptor DESC_REMOVE_LOG = create(PATH_LCL,
123 "remove.gif"); //$NON-NLS-1$
125 public static final ImageDescriptor DESC_REMOVE_LOG_DISABLED = create(
126 PATH_LCL_DISABLED, "remove.gif"); //$NON-NLS-1$
128 public static final ImageDescriptor DESC_FILTER = create(PATH_LCL,
129 "filter_ps.gif"); //$NON-NLS-1$
131 public static final ImageDescriptor DESC_FILTER_DISABLED = create(
132 PATH_LCL_DISABLED, "filter_ps.gif"); //$NON-NLS-1$
134 public static final ImageDescriptor DESC_EXPORT = create(PATH_LCL,
135 "export_log.gif"); //$NON-NLS-1$
137 public static final ImageDescriptor DESC_EXPORT_DISABLED = create(
138 PATH_LCL_DISABLED, "export_log.gif"); //$NON-NLS-1$
140 public static final ImageDescriptor DESC_IMPORT = create(PATH_LCL,
141 "import_log.gif"); //$NON-NLS-1$
143 public static final ImageDescriptor DESC_IMPORT_DISABLED = create(
144 PATH_LCL_DISABLED, "import_log.gif"); //$NON-NLS-1$
146 public static final ImageDescriptor DESC_COLLAPSE_ALL = create(PATH_LCL,
147 "collapseall.gif"); //$NON-NLS-1$
149 public static final ImageDescriptor DESC_HORIZONTAL_VIEW = create(PATH_LCL,
150 "th_horizontal.gif"); //$NON-NLS-1$
152 public static final ImageDescriptor DESC_HORIZONTAL_VIEW_DISABLED = create(
153 PATH_LCL_DISABLED, "th_horizontal.gif"); //$NON-NLS-1$
155 public static final ImageDescriptor DESC_VERTICAL_VIEW = create(PATH_LCL,
156 "th_vertical.gif"); //$NON-NLS-1$
158 public static final ImageDescriptor DESC_VERTICAL_VIEW_DISABLED = create(
159 PATH_LCL_DISABLED, "th_vertical.gif"); //$NON-NLS-1$
161 public static final ImageDescriptor DESC_HIDE_PANE = create(PATH_EVENTS,
162 "hide_pane.gif"); //$NON-NLS-1$
167 public static final ImageDescriptor DESC_PREV_EVENT = create(PATH_EVENTS,
168 "event_prev.gif"); //$NON-NLS-1$
170 public static final ImageDescriptor DESC_NEXT_EVENT = create(PATH_EVENTS,
171 "event_next.gif"); //$NON-NLS-1$
176 public static final ImageDescriptor DESC_RUN_CO = create(PATH_OVR,
177 "run_co.gif"); //$NON-NLS-1$
179 private static ImageDescriptor create(String prefix, String name) {
180 return ImageDescriptor.createFromURL(makeIconURL(prefix, name));
183 public static Image get(String key) {
184 return PLUGIN_REGISTRY.get(key);
187 private static URL makeIconURL(String prefix, String name) {
188 String path = prefix + name;
191 url = new URL(BASE_URL, path);
192 } catch (MalformedURLException e) {
198 public static Image manage(String key, ImageDescriptor desc) {
199 Image image = desc.createImage();
200 PLUGIN_REGISTRY.put(key, image);