Revision 3be6ef3e
Added by Niels Hoffmann over 13 years ago
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java | ||
---|---|---|
24 | 24 |
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin; |
25 | 25 |
|
26 | 26 |
/** |
27 |
* <p>ImageResources class.</p> |
|
28 |
* |
|
27 | 29 |
* @author n.hoffmann |
28 | 30 |
* @created 24.03.2009 |
29 | 31 |
* @version 1.0 |
... | ... | |
32 | 34 |
|
33 | 35 |
private static ImageResources instance; |
34 | 36 |
|
37 |
/** |
|
38 |
* <p>Getter for the field <code>instance</code>.</p> |
|
39 |
* |
|
40 |
* @return a {@link eu.etaxonomy.taxeditor.model.ImageResources} object. |
|
41 |
*/ |
|
35 | 42 |
public static ImageResources getInstance(){ |
36 | 43 |
if(instance == null){ |
37 | 44 |
instance = new ImageResources(); |
... | ... | |
43 | 50 |
/* *************************************************************************************** |
44 | 51 |
ICONS |
45 | 52 |
************************************************************************************** */ |
53 |
/** Constant <code>ADD_ICON="add_icon"</code> */ |
|
46 | 54 |
public static final String ADD_ICON = "add_icon"; |
55 |
/** Constant <code>TRASH_ICON="trash_icon"</code> */ |
|
47 | 56 |
public static final String TRASH_ICON = "trash_icon"; |
57 |
/** Constant <code>BROWSE_ICON="browse_icon"</code> */ |
|
48 | 58 |
public static final String BROWSE_ICON = "browse_icon"; |
59 |
/** Constant <code>EDIT_ICON="edit_icon"</code> */ |
|
49 | 60 |
public static final String EDIT_ICON = "edit_icon"; |
61 |
/** Constant <code>EDIT_LOGO_ICON="edit_logo_icon"</code> */ |
|
50 | 62 |
public static final String EDIT_LOGO_ICON = "edit_logo_icon"; |
63 |
/** Constant <code>WARNING_ICON="warning_icon"</code> */ |
|
51 | 64 |
public static final String WARNING_ICON = "warning_icon"; |
65 |
/** Constant <code>BLACK_SQUARE_ICON="black_square_icon"</code> */ |
|
52 | 66 |
public static final String BLACK_SQUARE_ICON = "black_square_icon"; |
67 |
/** Constant <code>HOMOTYPIC_SYN_ICON="homotypic_syn_icon"</code> */ |
|
53 | 68 |
public static final String HOMOTYPIC_SYN_ICON = "homotypic_syn_icon"; |
69 |
/** Constant <code>HOMOTYPIC_SYN_ORIGINAL_ICON="homotypic_syn_original_icon"</code> */ |
|
54 | 70 |
public static final String HOMOTYPIC_SYN_ORIGINAL_ICON = "homotypic_syn_original_icon"; |
71 |
/** Constant <code>HETEROTYPIC_SYN_ICON="heterotypic_syn_icon"</code> */ |
|
55 | 72 |
public static final String HETEROTYPIC_SYN_ICON = "heterotypic_syn_icon"; |
73 |
/** Constant <code>HETEROTYPIC_SYN_ORIGINAL_ICON="heterotypic_syn_original_icon"</code> */ |
|
56 | 74 |
public static final String HETEROTYPIC_SYN_ORIGINAL_ICON = "heterotypic_syn_original_icon"; |
75 |
/** Constant <code>MISAPPLIED_NAME_ICON="misapplied_icon"</code> */ |
|
57 | 76 |
public static final String MISAPPLIED_NAME_ICON = "misapplied_icon"; |
77 |
/** Constant <code>CONCEPT_ICON="concept_icon"</code> */ |
|
58 | 78 |
public static final String CONCEPT_ICON = "concept_icon"; |
79 |
/** Constant <code>AUTONYM_ICON="autonym_icon"</code> */ |
|
59 | 80 |
public static final String AUTONYM_ICON = "autonym_icon"; |
81 |
/** Constant <code>BASIONYM_ICON="basionym_icon"</code> */ |
|
60 | 82 |
public static final String BASIONYM_ICON = "basionym_icon"; |
83 |
/** Constant <code>ORTHOGRAPHIC_VARIANT_ICON="orthographic_variants_icon"</code> */ |
|
61 | 84 |
public static final String ORTHOGRAPHIC_VARIANT_ICON = "orthographic_variants_icon"; |
85 |
/** Constant <code>DB_ICON="db_icon"</code> */ |
|
62 | 86 |
public static final String DB_ICON = "db_icon"; |
87 |
/** Constant <code>MOVE_ICON="move_icon"</code> */ |
|
63 | 88 |
public static final String MOVE_ICON = "move_icon"; |
89 |
/** Constant <code>ACTIVE_DELETE_ICON="active_delete_icon"</code> */ |
|
64 | 90 |
public static final String ACTIVE_DELETE_ICON = "active_delete_icon"; |
91 |
/** Constant <code>SYNONYM_TO_TAXON_ICON="synoynm_to_taxon_icon"</code> */ |
|
65 | 92 |
public static final String SYNONYM_TO_TAXON_ICON = "synoynm_to_taxon_icon"; |
93 |
/** Constant <code>OPEN_TAXON_ICON="open_taxon_icon"</code> */ |
|
66 | 94 |
public static final String OPEN_TAXON_ICON = "open_taxon_icon"; |
95 |
/** Constant <code>ADD_CHILD_TAXON_ICON="add_taxon_icon"</code> */ |
|
67 | 96 |
public static final String ADD_CHILD_TAXON_ICON = "add_taxon_icon"; |
97 |
/** Constant <code>SWAP_SYNONYM_AND_TAXON_ICON="swap_syn_and_tax_icon"</code> */ |
|
68 | 98 |
public static final String SWAP_SYNONYM_AND_TAXON_ICON = "swap_syn_and_tax_icon"; |
99 |
/** Constant <code>QUICK_ADD_ICON="quick_add_icon"</code> */ |
|
69 | 100 |
public static final String QUICK_ADD_ICON = "quick_add_icon"; |
101 |
/** Constant <code>TAXON_TO_SYNONYM_ICON="tax_to_syn_icon"</code> */ |
|
70 | 102 |
public static final String TAXON_TO_SYNONYM_ICON = "tax_to_syn_icon"; |
103 |
/** Constant <code>ERROR_ANNOTATION_ICON="error_annotation_icon"</code> */ |
|
71 | 104 |
public static final String ERROR_ANNOTATION_ICON = "error_annotation_icon"; |
105 |
/** Constant <code>EDIT_BITMAP_ICON="edit_bitmap_icon"</code> */ |
|
72 | 106 |
public static final String EDIT_BITMAP_ICON = "edit_bitmap_icon"; |
107 |
/** Constant <code>IMG_DATASOURCE_CONNECTED="IMG_DATASOURCE_CONNECTED"</code> */ |
|
73 | 108 |
public static final String IMG_DATASOURCE_CONNECTED = "IMG_DATASOURCE_CONNECTED"; |
109 |
/** Constant <code>IMG_DATASOURCE_DISCONNECTED="IMG_DATASOURCE_DISCONNECTED"</code> */ |
|
74 | 110 |
public static final String IMG_DATASOURCE_DISCONNECTED = "IMG_DATASOURCE_DISCONNECTED"; |
111 |
/** Constant <code>IMG_NOT_FOUND="IMG_NOT_FOUND"</code> */ |
|
75 | 112 |
public static final String IMG_NOT_FOUND = "IMG_NOT_FOUND"; |
113 |
/** Constant <code>WARNING_ANNOTATION_ICON="warning"</code> */ |
|
76 | 114 |
public static final String WARNING_ANNOTATION_ICON = "warning"; |
115 |
/** Constant <code>THREE_PRONGED_EQUAL="3_pronged_equal"</code> */ |
|
77 | 116 |
public static final String THREE_PRONGED_EQUAL = "3_pronged_equal"; |
117 |
/** Constant <code>TWO_PRONGED_EQUAL="2_pronged_equal"</code> */ |
|
78 | 118 |
public static final String TWO_PRONGED_EQUAL = "2_pronged_equal"; |
119 |
/** Constant <code>MISAPPLIED_NAME="misapplied_name"</code> */ |
|
79 | 120 |
public static final String MISAPPLIED_NAME = "misapplied_name"; |
121 |
/** Constant <code>EXPAND_ALL="expand_all"</code> */ |
|
80 | 122 |
public static final String EXPAND_ALL = "expand_all"; |
123 |
/** Constant <code>COLLAPSE_ALL="collapse_all"</code> */ |
|
81 | 124 |
public static final String COLLAPSE_ALL = "collapse_all"; |
82 | 125 |
|
83 | 126 |
|
... | ... | |
87 | 130 |
**************************************************************************/ |
88 | 131 |
private ImageRegistry imageRegistry; |
89 | 132 |
|
133 |
/** |
|
134 |
* <p>getImageDescriptor</p> |
|
135 |
* |
|
136 |
* @param key a {@link java.lang.String} object. |
|
137 |
* @return a {@link org.eclipse.jface.resource.ImageDescriptor} object. |
|
138 |
*/ |
|
90 | 139 |
public static ImageDescriptor getImageDescriptor(String key) { |
91 | 140 |
return getInstance().getImageRegistry().getDescriptor(key); |
92 | 141 |
} |
93 | 142 |
|
143 |
/** |
|
144 |
* <p>getImage</p> |
|
145 |
* |
|
146 |
* @param key a {@link java.lang.String} object. |
|
147 |
* @return a {@link org.eclipse.swt.graphics.Image} object. |
|
148 |
*/ |
|
94 | 149 |
public static Image getImage(String key) { |
95 | 150 |
return getInstance().getImageRegistry().get(key); |
96 | 151 |
} |
97 | 152 |
|
98 | 153 |
/** |
99 | 154 |
* Gets an image for the given URL. Adds the image to the registry as needed. |
100 |
*
|
|
101 |
* @param url
|
|
102 |
* @return |
|
155 |
* |
|
156 |
* @param uri a {@link java.net.URI} object.
|
|
157 |
* @return a {@link org.eclipse.swt.graphics.Image} object.
|
|
103 | 158 |
*/ |
104 | 159 |
public static Image getImage(URI uri) { |
105 | 160 |
|
... | ... | |
135 | 190 |
return image; |
136 | 191 |
} |
137 | 192 |
|
138 |
/** |
|
139 |
* @return |
|
193 |
/** |
|
194 |
* <p>getImageNotFound</p> |
|
195 |
* |
|
196 |
* @return a {@link org.eclipse.swt.graphics.Image} object. |
|
140 | 197 |
*/ |
141 | 198 |
public static Image getImageNotFound() { |
142 | 199 |
return getImage(ImageResources.IMG_NOT_FOUND); |
143 | 200 |
} |
144 | 201 |
|
202 |
/** |
|
203 |
* <p>Getter for the field <code>imageRegistry</code>.</p> |
|
204 |
* |
|
205 |
* @return a {@link org.eclipse.jface.resource.ImageRegistry} object. |
|
206 |
*/ |
|
145 | 207 |
public ImageRegistry getImageRegistry() { |
146 | 208 |
if (imageRegistry == null) { |
147 | 209 |
imageRegistry = TaxeditorStorePlugin.getDefault().createImageRegistry(); |
... | ... | |
150 | 212 |
return imageRegistry; |
151 | 213 |
} |
152 | 214 |
|
215 |
/** |
|
216 |
* <p>initializeImageRegistry</p> |
|
217 |
* |
|
218 |
* @param registry a {@link org.eclipse.jface.resource.ImageRegistry} object. |
|
219 |
*/ |
|
153 | 220 |
protected void initializeImageRegistry(ImageRegistry registry) { |
154 | 221 |
registerImage(registry, ADD_ICON, |
155 | 222 |
"add.gif"); |
Also available in: Unified diff
performed javacscript:fix and worked on documentation