/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
/**
* @version 1.0
*/
public class ImageResources {
-
+
private static ImageResources instance;
-
+
/**
* <p>Getter for the field <code>instance</code>.</p>
*
}
return instance;
}
-
-
+
+
/* ***************************************************************************************
ICONS
************************************************************************************** */
public static final String IMG_NOT_FOUND = "IMG_NOT_FOUND";
/** Constant <code>WARNING_ANNOTATION_ICON="warning"</code> */
public static final String WARNING_ANNOTATION_ICON = "warning";
+
+ /** Constant <code>LOCK_ICON="locked"</code> */
+ public static final String LOCK_ICON = "lock";
+
+ /** Constant <code>LOCK_OPEN_ICON="lock_open"</code> */
+ public static final String LOCK_OPEN_ICON = "lock_open";
+
/** Constant <code>THREE_PRONGED_EQUAL="3_pronged_equal"</code> */
public static final String THREE_PRONGED_EQUAL = "3_pronged_equal";
/** Constant <code>TWO_PRONGED_EQUAL="2_pronged_equal"</code> */
public static final String EXPAND_ALL = "expand_all";
/** Constant <code>COLLAPSE_ALL="collapse_all"</code> */
public static final String COLLAPSE_ALL = "collapse_all";
-
-
+ public static final String TISSUE_SAMPLE_DERIVATE = "tissue_sample_derivate";
+ public static final String DNA_SAMPLE_DERIVATE = "dna_sample_derivate";
+ public static final String FIELD_UNIT = "field_unit";
+ public static final String SPECIMEN_DERIVATE = "specimen_derivate";
+ public static final String ARTWORK_DERIVATE = "artwork_derivate";
+ public static final String SPECIMEN_SCAN_DERIVATE = "specimen_scan_derivate";
+ public static final String LIVING_PLANT_PHOTO_DERIVATE = "living_plant_photo_derivate";
+
+
+
/***************************************************************************
* IMAGE REGISTRY
**************************************************************************/
private ImageRegistry imageRegistry;
-
+
/**
* <p>getImageDescriptor</p>
*
public static Image getImage(String key) {
return getInstance().getImageRegistry().get(key);
}
-
+
/**
* Gets an image for the given URL. Adds the image to the registry as needed.
*
* @param uri a {@link java.net.URI} object.
* @return a {@link org.eclipse.swt.graphics.Image} object.
*/
- public static Image getImage(URI uri) {
-
+ public static Image getImage(URI uri) {
+
String key = uri.toString();
ImageRegistry registry = getInstance().getImageRegistry();
Image image = registry.get(key);
-
+
if (image == null) {
ImageDescriptor desc;
try {
} catch (MalformedURLException e) {
// should never happen
} catch (Exception e) {
- StoreUtil.error(ImageResources.class, e);
+ AbstractUtility.error(ImageResources.class, e);
}
-
+
// logger.warn(ImageDescriptor.getMissingImageDescriptor().getClass());
// logger.warn(desc.getClass());
-//
+//
// if (ImageDescriptor.getMissingImageDescriptor().equals(desc)) {
// logger.warn("img not found");
// }
-
+
}
-
+
return image;
}
-
+
/**
* <p>getImageNotFound</p>
*
* @param registry a {@link org.eclipse.jface.resource.ImageRegistry} object.
*/
protected void initializeImageRegistry(ImageRegistry registry) {
- registerImage(registry, ADD_ICON,
+ registerImage(registry, ADD_ICON,
"add_no_bg.gif");
- registerImage(registry, TRASH_ICON,
+ registerImage(registry, TRASH_ICON,
"trash.gif");
- registerImage(registry, EDIT_ICON,
+ registerImage(registry, EDIT_ICON,
"text.gif");
- registerImage(registry, EDIT_LOGO_ICON,
+ registerImage(registry, EDIT_LOGO_ICON,
"edit_16x16.ico");
registerImage(registry, WARNING_ICON,
"warn_tsk.gif");
"homosyn_original_no_bg.gif");
registerImage(registry, HETEROTYPIC_SYN_ICON,
"heterosyn_no_bg.gif");
- registerImage(registry, NOM_INVAL_NUD_SYN_ICON,
+ registerImage(registry, NOM_INVAL_NUD_SYN_ICON,
"nominval_nud_no_bg.gif");
registerImage(registry, HETEROTYPIC_SYN_ORIGINAL_ICON,
"heterosyn_original_no_bg.gif");
- registerImage(registry, HOMOTYPIC_SYNONYM_IN_HETEROTYPIC_GROUP_ICON,
+ registerImage(registry, HOMOTYPIC_SYNONYM_IN_HETEROTYPIC_GROUP_ICON,
"homotypic_syn_hetero_group.gif");
registerImage(registry, MISAPPLIED_NAME_ICON,
"misapplied_no_bg.gif");
"basionym_no_bg.gif");
registerImage(registry, ORTHOGRAPHIC_VARIANT_ICON,
"orthovariant_no_bg.gif");
- registerImage(registry, DB_ICON,
+ registerImage(registry, DB_ICON,
"db.gif");
registerImage(registry, MOVE_ICON,
"correction_change.gif");
"delete_edit.gif");
registerImage(registry, SYNONYM_TO_TAXON_ICON,
"change.gif");
- registerImage(registry, OPEN_TAXON_ICON,
+ registerImage(registry, OPEN_TAXON_ICON,
"open.gif");
registerImage(registry, ADD_CHILD_TAXON_ICON,
"new_child.gif");
"error_co.gif");
registerImage(registry, EDIT_BITMAP_ICON,
"256color_16x16.bmp");
- registerImage(registry, IMG_DATASOURCE_CONNECTED,
+ registerImage(registry, IMG_DATASOURCE_CONNECTED,
"prj_obj.gif");
- registerImage(registry, IMG_DATASOURCE_DISCONNECTED,
+ registerImage(registry, IMG_DATASOURCE_DISCONNECTED,
"cprj_obj.gif");
- registerImage(registry, IMG_NOT_FOUND,
+ registerImage(registry, IMG_NOT_FOUND,
"pic_not_found.PNG");
- registerImage(registry, WARNING_ANNOTATION_ICON,
+ registerImage(registry, WARNING_ANNOTATION_ICON,
"warning_co.gif");
- registerImage(registry, THREE_PRONGED_EQUAL,
+ registerImage(registry, THREE_PRONGED_EQUAL,
"3_pronged_equal_small.GIF");
- registerImage(registry, TWO_PRONGED_EQUAL,
- "2_pronged_equal_small.GIF");
- registerImage(registry, MISAPPLIED_NAME,
- "ma_12x12.gif");
- registerImage(registry, ORPHANED_TAXON,
- "orphaned.gif");
- registerImage(registry, EXPAND_ALL,
+ registerImage(registry, TWO_PRONGED_EQUAL,
+ "2_pronged_equal_small.GIF");
+ registerImage(registry, MISAPPLIED_NAME,
+ "ma_12x12.gif");
+ registerImage(registry, ORPHANED_TAXON,
+ "orphaned.gif");
+ registerImage(registry, EXPAND_ALL,
"expandAll.jpg");
- registerImage(registry, COLLAPSE_ALL,
+ registerImage(registry, COLLAPSE_ALL,
"collapseall.gif");
- registerImage(registry, BROWSE_ICON,
+ registerImage(registry, BROWSE_ICON,
"prj_obj.gif");
+ registerImage(registry, LOCK_ICON,
+ "lock.png");
+ registerImage(registry, LOCK_OPEN_ICON,
+ "lock_open.png");
+ registerImage(registry, DNA_SAMPLE_DERIVATE,
+ "dna_derivate-16x16-32.png");
+ registerImage(registry, FIELD_UNIT,
+ "fieldunit-16x16-32.png");
+ registerImage(registry, SPECIMEN_DERIVATE,
+ "specimen_derivate-16x16-32.png");
+ registerImage(registry, ARTWORK_DERIVATE,
+ "artwork_derivate-16x16-32.png");
+ registerImage(registry, SPECIMEN_SCAN_DERIVATE,
+ "specimen_scan_derivate-16x16-32.png");
+ registerImage(registry, LIVING_PLANT_PHOTO_DERIVATE,
+ "specimen_scan_derivate-16x16-32.png");
+ registerImage(registry, TISSUE_SAMPLE_DERIVATE,
+ "tissue_sample-16x16-32.png");
}
private void registerImage(ImageRegistry registry, String key,