Project

General

Profile

Download (20.1 KB) Statistics
| Branch: | Tag: | Revision:
1 e8409423 n.hoffmann
/**
2
* Copyright (C) 2007 EDIT
3 ee1d621e Patric Plitzner
* European Distributed Institute of Taxonomy
4 e8409423 n.hoffmann
* http://www.e-taxonomy.eu
5 ee1d621e Patric Plitzner
*
6 e8409423 n.hoffmann
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
10 9766a939 n.hoffmann
package eu.etaxonomy.taxeditor.model;
11 e8409423 n.hoffmann
12
import java.net.MalformedURLException;
13
import java.net.URI;
14
import java.net.URL;
15
16
import org.eclipse.core.runtime.FileLocator;
17
import org.eclipse.core.runtime.IPath;
18
import org.eclipse.core.runtime.Path;
19 b9274faa p.ciardelli
import org.eclipse.jface.resource.DeviceResourceException;
20 e8409423 n.hoffmann
import org.eclipse.jface.resource.ImageDescriptor;
21
import org.eclipse.jface.resource.ImageRegistry;
22
import org.eclipse.swt.graphics.Image;
23
24
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
25
26
/**
27 3be6ef3e n.hoffmann
 * <p>ImageResources class.</p>
28
 *
29 e8409423 n.hoffmann
 * @author n.hoffmann
30
 * @created 24.03.2009
31
 * @version 1.0
32
 */
33
public class ImageResources {
34 ee1d621e Patric Plitzner
35 e8409423 n.hoffmann
	private static ImageResources instance;
36 ee1d621e Patric Plitzner
37 3be6ef3e n.hoffmann
	/**
38
	 * <p>Getter for the field <code>instance</code>.</p>
39
	 *
40
	 * @return a {@link eu.etaxonomy.taxeditor.model.ImageResources} object.
41
	 */
42 e8409423 n.hoffmann
	public static ImageResources getInstance(){
43
		if(instance == null){
44
			instance = new ImageResources();
45
		}
46
		return instance;
47
	}
48 ee1d621e Patric Plitzner
49
50 e8409423 n.hoffmann
	/* ***************************************************************************************
51
	ICONS
52
	************************************************************************************** */
53 3be6ef3e n.hoffmann
	/** Constant <code>ADD_ICON="add_icon"</code> */
54 f3065796 Patrick Plitzner
	public static final String COPY_ICON = "copy_icon";
55
	public static final String PASTE_ICON = "paste_icon";
56 eca18c8b n.hoffmann
	public static final String ADD_ICON = "add_icon";
57 8b6ed3fc Patrick Plitzner
	public static final String ADD_DOUBLE = "add_double";
58
	public static final String ADD_TEXT = "add_text";
59 248d15d9 Patrick Plitzner
	public static final String ADD_ICON_GREEN = "add_icon_green";
60
	public static final String MIN_ICON = "min_icon";
61 cc4535d4 Patrick Plitzner
	public static final String ADD_EDIT = "add_edit";
62 3be6ef3e n.hoffmann
	/** Constant <code>TRASH_ICON="trash_icon"</code> */
63 eca18c8b n.hoffmann
	public static final String TRASH_ICON = "trash_icon";
64 3be6ef3e n.hoffmann
	/** Constant <code>BROWSE_ICON="browse_icon"</code> */
65 eca18c8b n.hoffmann
	public static final String BROWSE_ICON = "browse_icon";
66 23fa8987 Patrick Plitzner
	public static final String SEARCH_ICON = "search_icon";
67 3be6ef3e n.hoffmann
	/** Constant <code>EDIT_ICON="edit_icon"</code> */
68 e8409423 n.hoffmann
	public static final String EDIT_ICON = "edit_icon";
69 3be6ef3e n.hoffmann
	/** Constant <code>EDIT_LOGO_ICON="edit_logo_icon"</code> */
70 eca18c8b n.hoffmann
	public static final String EDIT_LOGO_ICON = "edit_logo_icon";
71 3be6ef3e n.hoffmann
	/** Constant <code>WARNING_ICON="warning_icon"</code> */
72 e8409423 n.hoffmann
	public static final String WARNING_ICON = "warning_icon";
73 3be6ef3e n.hoffmann
	/** Constant <code>BLACK_SQUARE_ICON="black_square_icon"</code> */
74 e8409423 n.hoffmann
	public static final String BLACK_SQUARE_ICON = "black_square_icon";
75 3be6ef3e n.hoffmann
	/** Constant <code>HOMOTYPIC_SYN_ICON="homotypic_syn_icon"</code> */
76 e8409423 n.hoffmann
	public static final String HOMOTYPIC_SYN_ICON = "homotypic_syn_icon";
77 3be6ef3e n.hoffmann
	/** Constant <code>HOMOTYPIC_SYN_ORIGINAL_ICON="homotypic_syn_original_icon"</code> */
78 e8409423 n.hoffmann
	public static final String HOMOTYPIC_SYN_ORIGINAL_ICON = "homotypic_syn_original_icon";
79 3be6ef3e n.hoffmann
	/** Constant <code>HETEROTYPIC_SYN_ICON="heterotypic_syn_icon"</code> */
80 e8409423 n.hoffmann
	public static final String HETEROTYPIC_SYN_ICON = "heterotypic_syn_icon";
81 ba38418d n.hoffmann
	public static final String NOM_INVAL_NUD_SYN_ICON = "nom_inval_nud_syn_icon";
82 d6815430 n.hoffmann
	public static final String HOMOTYPIC_SYNONYM_IN_HETEROTYPIC_GROUP_ICON = "homotypic_synonym_in_heterotypic_group_icon";
83 3be6ef3e n.hoffmann
	/** Constant <code>HETEROTYPIC_SYN_ORIGINAL_ICON="heterotypic_syn_original_icon"</code> */
84 e8409423 n.hoffmann
	public static final String HETEROTYPIC_SYN_ORIGINAL_ICON = "heterotypic_syn_original_icon";
85 3be6ef3e n.hoffmann
	/** Constant <code>MISAPPLIED_NAME_ICON="misapplied_icon"</code> */
86 e8409423 n.hoffmann
	public static final String MISAPPLIED_NAME_ICON = "misapplied_icon";
87 e944f62a Katja Luther
	/** Constant <code>INVALID_TYPE_DESIGNATION_ICON="invalid_type_designation_icon"</code> */
88
	public static final String INVALID_TYPE_DESIGNATION_ICON = "invalid_icon";
89 7cda107c Katja Luther
	/** Constant <code>PRO_PARTE_SYNONYM_ICON="pro_parte_synonym_icon"</code> */
90 08ef23e2 Katja Luther
    public static final String PRO_PARTE_SYNONYM_ICON = "proparte_syn_icon";
91
    /** Constant <code>PRO_PARTE_SYNONYM_ICON="pro_parte_synonym_icon"</code> */
92
    public static final String PARTIAL_SYNONYM_ICON = "partial_syn_icon";
93 3be6ef3e n.hoffmann
	/** Constant <code>CONCEPT_ICON="concept_icon"</code> */
94 e8409423 n.hoffmann
	public static final String CONCEPT_ICON = "concept_icon";
95 3be6ef3e n.hoffmann
	/** Constant <code>AUTONYM_ICON="autonym_icon"</code> */
96 e8409423 n.hoffmann
	public static final String AUTONYM_ICON = "autonym_icon";
97 3be6ef3e n.hoffmann
	/** Constant <code>BASIONYM_ICON="basionym_icon"</code> */
98 e8409423 n.hoffmann
	public static final String BASIONYM_ICON = "basionym_icon";
99 3be6ef3e n.hoffmann
	/** Constant <code>ORTHOGRAPHIC_VARIANT_ICON="orthographic_variants_icon"</code> */
100 e8409423 n.hoffmann
	public static final String ORTHOGRAPHIC_VARIANT_ICON = "orthographic_variants_icon";
101 3be6ef3e n.hoffmann
	/** Constant <code>DB_ICON="db_icon"</code> */
102 e8409423 n.hoffmann
	public static final String DB_ICON = "db_icon";
103 3be6ef3e n.hoffmann
	/** Constant <code>MOVE_ICON="move_icon"</code> */
104 e8409423 n.hoffmann
	public static final String MOVE_ICON = "move_icon";
105 3be6ef3e n.hoffmann
	/** Constant <code>ACTIVE_DELETE_ICON="active_delete_icon"</code> */
106 e8409423 n.hoffmann
	public static final String ACTIVE_DELETE_ICON = "active_delete_icon";
107 3be6ef3e n.hoffmann
	/** Constant <code>SYNONYM_TO_TAXON_ICON="synoynm_to_taxon_icon"</code> */
108 e8409423 n.hoffmann
	public static final String SYNONYM_TO_TAXON_ICON = "synoynm_to_taxon_icon";
109 3be6ef3e n.hoffmann
	/** Constant <code>OPEN_TAXON_ICON="open_taxon_icon"</code> */
110 e8409423 n.hoffmann
	public static final String OPEN_TAXON_ICON = "open_taxon_icon";
111 3be6ef3e n.hoffmann
	/** Constant <code>ADD_CHILD_TAXON_ICON="add_taxon_icon"</code> */
112 e8409423 n.hoffmann
	public static final String ADD_CHILD_TAXON_ICON = "add_taxon_icon";
113 3be6ef3e n.hoffmann
	/** Constant <code>SWAP_SYNONYM_AND_TAXON_ICON="swap_syn_and_tax_icon"</code> */
114 e8409423 n.hoffmann
	public static final String SWAP_SYNONYM_AND_TAXON_ICON = "swap_syn_and_tax_icon";
115 3be6ef3e n.hoffmann
	/** Constant <code>QUICK_ADD_ICON="quick_add_icon"</code> */
116 e8409423 n.hoffmann
	public static final String QUICK_ADD_ICON = "quick_add_icon";
117 3be6ef3e n.hoffmann
	/** Constant <code>TAXON_TO_SYNONYM_ICON="tax_to_syn_icon"</code> */
118 e8409423 n.hoffmann
	public static final String TAXON_TO_SYNONYM_ICON = "tax_to_syn_icon";
119 3be6ef3e n.hoffmann
	/** Constant <code>ERROR_ANNOTATION_ICON="error_annotation_icon"</code> */
120 e8409423 n.hoffmann
	public static final String ERROR_ANNOTATION_ICON = "error_annotation_icon";
121 3be6ef3e n.hoffmann
	/** Constant <code>EDIT_BITMAP_ICON="edit_bitmap_icon"</code> */
122 e8409423 n.hoffmann
	public static final String EDIT_BITMAP_ICON = "edit_bitmap_icon";
123 3be6ef3e n.hoffmann
	/** Constant <code>IMG_DATASOURCE_CONNECTED="IMG_DATASOURCE_CONNECTED"</code> */
124 e8409423 n.hoffmann
	public static final String IMG_DATASOURCE_CONNECTED = "IMG_DATASOURCE_CONNECTED";
125 3be6ef3e n.hoffmann
	/** Constant <code>IMG_DATASOURCE_DISCONNECTED="IMG_DATASOURCE_DISCONNECTED"</code> */
126 e8409423 n.hoffmann
	public static final String IMG_DATASOURCE_DISCONNECTED = "IMG_DATASOURCE_DISCONNECTED";
127 3be6ef3e n.hoffmann
	/** Constant <code>IMG_NOT_FOUND="IMG_NOT_FOUND"</code> */
128 b9274faa p.ciardelli
	public static final String IMG_NOT_FOUND = "IMG_NOT_FOUND";
129 3be6ef3e n.hoffmann
	/** Constant <code>WARNING_ANNOTATION_ICON="warning"</code> */
130 b3db1ca6 p.ciardelli
	public static final String WARNING_ANNOTATION_ICON = "warning";
131 ee1d621e Patric Plitzner
132
	/** Constant <code>LOCK_ICON="locked"</code> */
133
	public static final String LOCK_ICON = "lock";
134
135 9de4bfe6 Patrick Plitzner
	public static final String SYNCED = "synced";
136 6ff2e71e Patrick Plitzner
	public static final String REFRESH = "refresh";
137 9de4bfe6 Patrick Plitzner
138 ee1d621e Patric Plitzner
	/** Constant <code>LOCK_OPEN_ICON="lock_open"</code> */
139
	public static final String LOCK_OPEN_ICON = "lock_open";
140
141 3be6ef3e n.hoffmann
	/** Constant <code>THREE_PRONGED_EQUAL="3_pronged_equal"</code> */
142 e938ffac p.ciardelli
	public static final String THREE_PRONGED_EQUAL = "3_pronged_equal";
143 3be6ef3e n.hoffmann
	/** Constant <code>TWO_PRONGED_EQUAL="2_pronged_equal"</code> */
144 fca33a78 p.ciardelli
	public static final String TWO_PRONGED_EQUAL = "2_pronged_equal";
145 3be6ef3e n.hoffmann
	/** Constant <code>MISAPPLIED_NAME="misapplied_name"</code> */
146 fca33a78 p.ciardelli
	public static final String MISAPPLIED_NAME = "misapplied_name";
147 b4ca72fe Cherian Mathew
	/** Constant <code>ORPHANED_TAXON="orphaned_taxon"</code> */
148
	public static final String ORPHANED_TAXON = "orphaned_taxon";
149 3be6ef3e n.hoffmann
	/** Constant <code>EXPAND_ALL="expand_all"</code> */
150 eca18c8b n.hoffmann
	public static final String EXPAND_ALL = "expand_all";
151 05d18da0 Patrick Plitzner
	public static final String EXPAND = "expand";
152 3be6ef3e n.hoffmann
	/** Constant <code>COLLAPSE_ALL="collapse_all"</code> */
153 eca18c8b n.hoffmann
	public static final String COLLAPSE_ALL = "collapse_all";
154 e8409423 n.hoffmann
155 12f71b09 Patrick Plitzner
	public static final String SWITCH_VIEW_TYPE = "switch_view_type";
156 1016796d Patrick Plitzner
	public static final String SETTINGS = "settings";
157
	public static final String EXPORT = "export";
158 1f677abd Patrick Plitzner
	public static final String IMPORT = "import";
159 12f71b09 Patrick Plitzner
160
	//derivative icons
161 e140c036 Patric Plitzner
	public static final String TISSUE_SAMPLE_DERIVATE = "tissue_sample_derivate";
162 968295ec Patric Plitzner
	public static final String TISSUE_SAMPLE_DERIVATE_CHARACTER_DATA = "tissue_sample_derivate_character_data";
163 d2e1a7c5 Patric Plitzner
	public static final String DNA_SAMPLE_DERIVATE = "dna_sample_derivate";
164 968295ec Patric Plitzner
	public static final String DNA_SAMPLE_DERIVATE_CHARACTER_DATA = "dna_sample_derivate_character_data";
165 926bb819 Patric Plitzner
	public static final String FIELD_UNIT = "field_unit";
166 968295ec Patric Plitzner
	public static final String FIELD_UNIT_CHARACTER_DATA = "field_unit_character_data";
167 d2e1a7c5 Patric Plitzner
	public static final String SPECIMEN_DERIVATE = "specimen_derivate";
168 98886159 Patrick Plitzner
	public static final String SPECIMEN_DERIVATE_TYPE = "specimen_derivate_type";
169 968295ec Patric Plitzner
	public static final String SPECIMEN_DERIVATE_CHARACTER_DATA = "specimen_derivate_character_data";
170 d2e1a7c5 Patric Plitzner
    public static final String ARTWORK_DERIVATE = "artwork_derivate";
171 968295ec Patric Plitzner
    public static final String ARTWORK_DERIVATE_CHARACTER_DATA = "artwork_derivate_character_data";
172 e140c036 Patric Plitzner
    public static final String SPECIMEN_SCAN_DERIVATE = "specimen_scan_derivate";
173 968295ec Patric Plitzner
    public static final String SPECIMEN_SCAN_DERIVATE_CHARACTER_DATA = "specimen_scan_derivate_character_data";
174 d2e1a7c5 Patric Plitzner
    public static final String LIVING_PLANT_PHOTO_DERIVATE = "living_plant_photo_derivate";
175 968295ec Patric Plitzner
    public static final String LIVING_PLANT_PHOTO_DERIVATE_CHARACTER_DATA = "living_plant_photo_derivate_character_data";
176 fa10e899 Patric Plitzner
    public static final String DETAIL_IMAGE_DERIVATE = "detail_image_derivate";
177 968295ec Patric Plitzner
    public static final String DETAIL_IMAGE_DERIVATE_CHARACTER_DATA = "detail_image_derivate_character_data";
178 39b24584 Patric Plitzner
    public static final String SEQUENCE_DERIVATE = "sequence_derivate";
179
    public static final String AMPLIFICATION_DERIVATE = "amplification_derivate";
180
    public static final String SINGLE_READ_DERIVATE = "single_read_derivate";
181 35a12f14 Patric Plitzner
    public static final String SINGLE_READ_DERIVATE_MULTILINK = "single_read_derivate_multilink";
182 86a8b79e Patrick Plitzner
    public static final String DEFAULT_DERIVATIVE = "default_derivate";
183 926bb819 Patric Plitzner
184 27ef27c0 Patric Plitzner
    public static final String CHARACTER_DATA_DERIVATE = "character_data_derivate";
185 94bff8f1 Patric Plitzner
186 a9b5194c Patrick Plitzner
    public static final String WEB = "web";
187 d3dc900f Katja Luther
    public static final String DATE = "dates";
188 ee1d621e Patric Plitzner
189 354b2131 Patrick Plitzner
    public static final String FLAT = "flat";
190
    public static final String HIERARCHICAL = "hierarchical";
191
192 391e9f07 Patrick Plitzner
    public static final String LIGHT_BULB = "light_bulb";
193 487ef756 Patrick Plitzner
    public static final String HELP_TOPIC = "help_icon";
194
    public static final String VALIDATE_ICON = "VALIDATE_ICON";
195
    public static final String FUNNEL_ICON = "FUNNEL_ICON";
196
    public static final String FUNNEL_ICON_EXCLAMATION = "FUNNEL_ICON_EXCLAMATION";
197 391e9f07 Patrick Plitzner
198 ee1d621e Patric Plitzner
199 e944f62a Katja Luther
200 e8409423 n.hoffmann
	/***************************************************************************
201
	 * IMAGE REGISTRY
202
	 **************************************************************************/
203
	private ImageRegistry imageRegistry;
204 ee1d621e Patric Plitzner
205 3be6ef3e n.hoffmann
	/**
206
	 * <p>getImageDescriptor</p>
207
	 *
208
	 * @param key a {@link java.lang.String} object.
209
	 * @return a {@link org.eclipse.jface.resource.ImageDescriptor} object.
210
	 */
211 e8409423 n.hoffmann
	public static ImageDescriptor getImageDescriptor(String key) {
212
		return getInstance().getImageRegistry().getDescriptor(key);
213
	}
214
215 3be6ef3e n.hoffmann
	/**
216
	 * <p>getImage</p>
217
	 *
218
	 * @param key a {@link java.lang.String} object.
219
	 * @return a {@link org.eclipse.swt.graphics.Image} object.
220
	 */
221 e8409423 n.hoffmann
	public static Image getImage(String key) {
222
		return getInstance().getImageRegistry().get(key);
223
	}
224 ee1d621e Patric Plitzner
225 e8409423 n.hoffmann
	/**
226
	 * Gets an image for the given URL. Adds the image to the registry as needed.
227 3be6ef3e n.hoffmann
	 *
228
	 * @param uri a {@link java.net.URI} object.
229
	 * @return a {@link org.eclipse.swt.graphics.Image} object.
230 e8409423 n.hoffmann
	 */
231 ee1d621e Patric Plitzner
	public static Image getImage(URI uri) {
232
233 e8409423 n.hoffmann
		String key = uri.toString();
234
		ImageRegistry registry = getInstance().getImageRegistry();
235
236
		Image image = registry.get(key);
237 ee1d621e Patric Plitzner
238 e8409423 n.hoffmann
		if (image == null) {
239
			ImageDescriptor desc;
240
			try {
241
				desc = ImageDescriptor.createFromURL(new URL(key));
242
				registry.put(key, desc);
243
				image = registry.get(key);
244 b9274faa p.ciardelli
			} catch (DeviceResourceException e) {
245
				return getImageNotFound();
246 e8409423 n.hoffmann
			} catch (MalformedURLException e) {
247
				// should never happen
248 b9274faa p.ciardelli
			} catch (Exception e) {
249 41e2f693 Cherian Mathew
				MessagingUtils.error(ImageResources.class, e);
250 e8409423 n.hoffmann
			}
251 ee1d621e Patric Plitzner
252 e8409423 n.hoffmann
//			logger.warn(ImageDescriptor.getMissingImageDescriptor().getClass());
253
//			logger.warn(desc.getClass());
254 ee1d621e Patric Plitzner
//
255 e8409423 n.hoffmann
//			if (ImageDescriptor.getMissingImageDescriptor().equals(desc)) {
256
//				logger.warn("img not found");
257
//			}
258 ee1d621e Patric Plitzner
259 e8409423 n.hoffmann
		}
260 ee1d621e Patric Plitzner
261 e8409423 n.hoffmann
		return image;
262
	}
263 ee1d621e Patric Plitzner
264 3be6ef3e n.hoffmann
	/**
265
	 * <p>getImageNotFound</p>
266
	 *
267
	 * @return a {@link org.eclipse.swt.graphics.Image} object.
268 b9274faa p.ciardelli
	 */
269
	public static Image getImageNotFound() {
270
		return getImage(ImageResources.IMG_NOT_FOUND);
271
	}
272
273 3be6ef3e n.hoffmann
	/**
274
	 * <p>Getter for the field <code>imageRegistry</code>.</p>
275
	 *
276
	 * @return a {@link org.eclipse.jface.resource.ImageRegistry} object.
277
	 */
278 b9274faa p.ciardelli
	public ImageRegistry getImageRegistry() {
279 e8409423 n.hoffmann
        if (imageRegistry == null) {
280
            imageRegistry = TaxeditorStorePlugin.getDefault().createImageRegistry();
281
            initializeImageRegistry(imageRegistry);
282
        }
283
        return imageRegistry;
284
    }
285
286 3be6ef3e n.hoffmann
	/**
287
	 * <p>initializeImageRegistry</p>
288
	 *
289
	 * @param registry a {@link org.eclipse.jface.resource.ImageRegistry} object.
290
	 */
291 e8409423 n.hoffmann
	protected void initializeImageRegistry(ImageRegistry registry) {
292 f3065796 Patrick Plitzner
	    registerImage(registry, COPY_ICON,
293
	            "copy_edit.png");
294
	    registerImage(registry, PASTE_ICON,
295
	            "paste_edit.png");
296 ee1d621e Patric Plitzner
		registerImage(registry, ADD_ICON,
297 e71ca239 n.hoffmann
				"add_no_bg.gif");
298 8b6ed3fc Patrick Plitzner
		registerImage(registry, ADD_DOUBLE,
299
		        "add_double.png");
300
		registerImage(registry, ADD_TEXT,
301
		        "add_text.png");
302 248d15d9 Patrick Plitzner
		registerImage(registry, ADD_ICON_GREEN,
303
		        "add.gif");
304
		registerImage(registry, MIN_ICON,
305
		        "min.gif");
306 cc4535d4 Patrick Plitzner
		registerImage(registry, ADD_EDIT,
307
		        "add_edit.gif");
308 ee1d621e Patric Plitzner
		registerImage(registry, TRASH_ICON,
309 eca18c8b n.hoffmann
				"trash.gif");
310 ee1d621e Patric Plitzner
		registerImage(registry, EDIT_ICON,
311 eca18c8b n.hoffmann
				"text.gif");
312 ee1d621e Patric Plitzner
		registerImage(registry, EDIT_LOGO_ICON,
313 ba38418d n.hoffmann
				"edit_16x16.ico");
314 e8409423 n.hoffmann
		registerImage(registry, WARNING_ICON,
315
				"warn_tsk.gif");
316
		registerImage(registry, BLACK_SQUARE_ICON,
317
				"accepted_small.gif");
318
		registerImage(registry, HOMOTYPIC_SYN_ICON,
319
				"homosyn_no_bg.gif");
320 ba38418d n.hoffmann
		registerImage(registry,	HOMOTYPIC_SYN_ORIGINAL_ICON,
321 e8409423 n.hoffmann
				"homosyn_original_no_bg.gif");
322
		registerImage(registry, HETEROTYPIC_SYN_ICON,
323
				"heterosyn_no_bg.gif");
324 ee1d621e Patric Plitzner
		registerImage(registry, NOM_INVAL_NUD_SYN_ICON,
325 ba38418d n.hoffmann
				"nominval_nud_no_bg.gif");
326
		registerImage(registry,	HETEROTYPIC_SYN_ORIGINAL_ICON,
327 e8409423 n.hoffmann
				"heterosyn_original_no_bg.gif");
328 ee1d621e Patric Plitzner
		registerImage(registry, HOMOTYPIC_SYNONYM_IN_HETEROTYPIC_GROUP_ICON,
329 d6815430 n.hoffmann
				"homotypic_syn_hetero_group.gif");
330 e8409423 n.hoffmann
		registerImage(registry, MISAPPLIED_NAME_ICON,
331
				"misapplied_no_bg.gif");
332 e944f62a Katja Luther
		registerImage(registry, INVALID_TYPE_DESIGNATION_ICON,
333
                "invalid.gif");
334 7cda107c Katja Luther
		registerImage(registry, PRO_PARTE_SYNONYM_ICON,
335
                "proparte-bright.gif");
336 08ef23e2 Katja Luther
	    registerImage(registry, PARTIAL_SYNONYM_ICON,
337
	            "proparte-dark.gif");
338 e8409423 n.hoffmann
		registerImage(registry, CONCEPT_ICON,
339
				"concept_no_bg.gif");
340
		registerImage(registry, AUTONYM_ICON,
341
				"autonym_no_bg.gif");
342
		registerImage(registry, BASIONYM_ICON,
343
				"basionym_no_bg.gif");
344
		registerImage(registry, ORTHOGRAPHIC_VARIANT_ICON,
345
				"orthovariant_no_bg.gif");
346 ee1d621e Patric Plitzner
		registerImage(registry, DB_ICON,
347 ba38418d n.hoffmann
				"db.gif");
348 e8409423 n.hoffmann
		registerImage(registry, MOVE_ICON,
349
				"correction_change.gif");
350
		registerImage(registry, ACTIVE_DELETE_ICON,
351
				"delete_edit.gif");
352
		registerImage(registry, SYNONYM_TO_TAXON_ICON,
353
				"change.gif");
354 ee1d621e Patric Plitzner
		registerImage(registry, OPEN_TAXON_ICON,
355 ba38418d n.hoffmann
				"open.gif");
356 e8409423 n.hoffmann
		registerImage(registry, ADD_CHILD_TAXON_ICON,
357
				"new_child.gif");
358
		registerImage(registry,
359
				SWAP_SYNONYM_AND_TAXON_ICON, "swap2.gif");
360
		registerImage(registry, QUICK_ADD_ICON,
361
				"quick_add.gif");
362
		registerImage(registry, TAXON_TO_SYNONYM_ICON,
363
				"tax_to_syn.gif");
364
		registerImage(registry, ERROR_ANNOTATION_ICON,
365
				"error_co.gif");
366
		registerImage(registry, EDIT_BITMAP_ICON,
367
				"256color_16x16.bmp");
368 ee1d621e Patric Plitzner
		registerImage(registry, IMG_DATASOURCE_CONNECTED,
369 e8409423 n.hoffmann
				"prj_obj.gif");
370 ee1d621e Patric Plitzner
		registerImage(registry, IMG_DATASOURCE_DISCONNECTED,
371 b9274faa p.ciardelli
				"cprj_obj.gif");
372 ee1d621e Patric Plitzner
		registerImage(registry, IMG_NOT_FOUND,
373 f42f497f p.ciardelli
				"pic_not_found.PNG");
374 ee1d621e Patric Plitzner
		registerImage(registry, WARNING_ANNOTATION_ICON,
375 f42f497f p.ciardelli
				"warning_co.gif");
376 ee1d621e Patric Plitzner
		registerImage(registry, THREE_PRONGED_EQUAL,
377 fca33a78 p.ciardelli
				"3_pronged_equal_small.GIF");
378 ee1d621e Patric Plitzner
		registerImage(registry, TWO_PRONGED_EQUAL,
379
				"2_pronged_equal_small.GIF");
380
		registerImage(registry, MISAPPLIED_NAME,
381
				"ma_12x12.gif");
382
		registerImage(registry, ORPHANED_TAXON,
383
				"orphaned.gif");
384
		registerImage(registry, EXPAND_ALL,
385 eca18c8b n.hoffmann
				"expandAll.jpg");
386 05d18da0 Patrick Plitzner
		registerImage(registry, EXPAND,
387
		        "expand.gif");
388 ee1d621e Patric Plitzner
		registerImage(registry, COLLAPSE_ALL,
389 eca18c8b n.hoffmann
				"collapseall.gif");
390 ee1d621e Patric Plitzner
		registerImage(registry, BROWSE_ICON,
391 eca18c8b n.hoffmann
				"prj_obj.gif");
392 23fa8987 Patrick Plitzner
		registerImage(registry, SEARCH_ICON,
393
		        "search.gif");
394 ee1d621e Patric Plitzner
		registerImage(registry, LOCK_ICON,
395
		        "lock.png");
396 9de4bfe6 Patrick Plitzner
		registerImage(registry, SYNCED,
397
		        "synced.gif");
398 6ff2e71e Patrick Plitzner
		registerImage(registry, REFRESH,
399
		        "refresh.gif");
400 ee1d621e Patric Plitzner
		registerImage(registry, LOCK_OPEN_ICON,
401
		        "lock_open.png");
402 12f71b09 Patrick Plitzner
		registerImage(registry, SWITCH_VIEW_TYPE,
403 23a2223a Patrick Plitzner
		        "switch_view_type-16x16-32.png");
404 1016796d Patrick Plitzner
		registerImage(registry, SETTINGS,
405
		        "settings.gif");
406 e140c036 Patric Plitzner
		registerImage(registry, DNA_SAMPLE_DERIVATE,
407 d00b84de Patric Plitzner
		        "dna_derivate-16x16-32.png");
408 968295ec Patric Plitzner
		registerImage(registry, DNA_SAMPLE_DERIVATE_CHARACTER_DATA,
409
		        "dna_derivate_data-16x16-32.png");
410 926bb819 Patric Plitzner
		registerImage(registry, FIELD_UNIT,
411 d00b84de Patric Plitzner
		        "fieldunit-16x16-32.png");
412 968295ec Patric Plitzner
		registerImage(registry, FIELD_UNIT_CHARACTER_DATA,
413
		        "fieldunit_data-16x16-32.png");
414 e140c036 Patric Plitzner
		registerImage(registry, SPECIMEN_DERIVATE,
415 d00b84de Patric Plitzner
		        "specimen_derivate-16x16-32.png");
416 98886159 Patrick Plitzner
		registerImage(registry, SPECIMEN_DERIVATE_TYPE,
417
		        "specimen_derivate_type-16x16-32.png");
418 968295ec Patric Plitzner
		registerImage(registry, SPECIMEN_DERIVATE_CHARACTER_DATA,
419
		        "specimen_derivate_data-16x16-32.png");
420 e140c036 Patric Plitzner
		registerImage(registry, ARTWORK_DERIVATE,
421 27f95c73 Patric Plitzner
		        "artwork_derivate-16x16-32.png");
422 968295ec Patric Plitzner
		registerImage(registry, ARTWORK_DERIVATE_CHARACTER_DATA,
423
		        "artwork_derivate_data-16x16-32.png");
424 e140c036 Patric Plitzner
		registerImage(registry, SPECIMEN_SCAN_DERIVATE,
425 d00b84de Patric Plitzner
		        "specimen_scan_derivate-16x16-32.png");
426 968295ec Patric Plitzner
		registerImage(registry, SPECIMEN_SCAN_DERIVATE_CHARACTER_DATA,
427
		        "specimen_scan_derivate_data-16x16-32.png");
428 d2e1a7c5 Patric Plitzner
		registerImage(registry, LIVING_PLANT_PHOTO_DERIVATE,
429 dbfbd136 Patric Plitzner
		        "living_plant_photo_derivate-16x16-32.png");
430 968295ec Patric Plitzner
		registerImage(registry, LIVING_PLANT_PHOTO_DERIVATE_CHARACTER_DATA,
431
		        "living_plant_photo_derivate_data-16x16-32.png");
432 fa10e899 Patric Plitzner
		registerImage(registry, DETAIL_IMAGE_DERIVATE,
433
		        "detail_image_derivate-16x16-32.png");
434 968295ec Patric Plitzner
		registerImage(registry, DETAIL_IMAGE_DERIVATE_CHARACTER_DATA,
435
		        "detail_image_derivate_data-16x16-32.png");
436 926bb819 Patric Plitzner
		registerImage(registry, TISSUE_SAMPLE_DERIVATE,
437 d00b84de Patric Plitzner
		        "tissue_sample-16x16-32.png");
438 968295ec Patric Plitzner
		registerImage(registry, TISSUE_SAMPLE_DERIVATE_CHARACTER_DATA,
439
		        "tissue_sample_data-16x16-32.png");
440 39b24584 Patric Plitzner
		registerImage(registry, SEQUENCE_DERIVATE,
441 99fa2e6e Patric Plitzner
		        "sequence_derivate-16x16-32.png");
442 39b24584 Patric Plitzner
		registerImage(registry, AMPLIFICATION_DERIVATE,
443 99fa2e6e Patric Plitzner
		        "amplification_derivate-16x16-32.png");
444 39b24584 Patric Plitzner
		registerImage(registry, SINGLE_READ_DERIVATE,
445 99fa2e6e Patric Plitzner
		        "single_read_derivate-16x16-32.png");
446 35a12f14 Patric Plitzner
		registerImage(registry, SINGLE_READ_DERIVATE_MULTILINK,
447
		        "single_read_derivate_multilink-16x16-32.png");
448 27ef27c0 Patric Plitzner
		registerImage(registry, CHARACTER_DATA_DERIVATE,
449
		        "character_data_derivate-16x16-32.png");
450 86a8b79e Patrick Plitzner
		registerImage(registry, DEFAULT_DERIVATIVE,
451
				"default_derivate-16x16-32.png");
452 1016796d Patrick Plitzner
		registerImage(registry, EXPORT,
453
		        "export.gif");
454 1f677abd Patrick Plitzner
		registerImage(registry, IMPORT,
455
		        "import_wiz.gif");
456 94bff8f1 Patric Plitzner
457 a9b5194c Patrick Plitzner
		registerImage(registry, WEB,
458
		        "web.gif");
459 d3dc900f Katja Luther
		registerImage(registry, DATE,
460
		        "dates.gif");
461 a9b5194c Patrick Plitzner
462 354b2131 Patrick Plitzner
		registerImage(registry, FLAT,
463
		        "flat.gif");
464
		registerImage(registry, HIERARCHICAL,
465
		        "hierarchical.gif");
466 391e9f07 Patrick Plitzner
		registerImage(registry, LIGHT_BULB,
467
		        "smartmode_co.gif");
468 487ef756 Patrick Plitzner
		registerImage(registry, HELP_TOPIC,
469
		        "help_topic.gif");
470
		registerImage(registry, VALIDATE_ICON,
471
		        "validate.gif");
472
		registerImage(registry, FUNNEL_ICON,
473
		        "funnel-icon.png");
474
		registerImage(registry, FUNNEL_ICON_EXCLAMATION,
475
		        "funnel-exclamation-icon.png");
476 354b2131 Patrick Plitzner
477 e8409423 n.hoffmann
	}
478
479
	private void registerImage(ImageRegistry registry, String key,
480
			String fileName) {
481
		try {
482
			IPath path = new Path("icons/" + fileName); //$NON-NLS-1$
483
			URL url = FileLocator.find(TaxeditorStorePlugin.getDefault().getBundle(), path, null);
484
			if (url != null) {
485
				ImageDescriptor desc = ImageDescriptor.createFromURL(url);
486
				registry.put(key, desc);
487
			}
488
		} catch (Exception e) {
489
		}
490
	}
491
}