Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a217e0280f816bb3c99627993074efa35aa46bcf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
/*******************************************************************************
 * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>
 * Copyright (C) 2008, Roger C. Soares <rogersoares@intelinet.com.br>
 * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>
 * Copyright (C) 2010, Chris Aniszczyk <caniszczyk@gmail.com>
 * Copyright (C) 2013, Daniel Megert <daniel_megert@ch.ibm.com>
 * Copyright (C) 2013, Robin Stocker <robin@nibor.org>
 * Copyright (C) 2014, Axel Richard <axel.richard@obeo.fr>
 * Copyright (C) 2015, Denis Zygann <d.zygann@web.de>
 * Copyright (C) 2016, Thomas Wolf <thomas.wolf@paranor.ch>
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *******************************************************************************/
package org.eclipse.egit.ui.internal;

import java.net.MalformedURLException;
import java.net.URL;

import org.eclipse.core.runtime.Platform;
import org.eclipse.egit.ui.Activator;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jface.viewers.IDecoration;
import org.eclipse.swt.graphics.Image;
import org.osgi.framework.Version;

/**
 * Icons for the Eclipse plugin. Mostly decorations.
 */
public class UIIcons {

	/** Decoration for resource in the index but not yet committed. */
	public final static ImageDescriptor OVR_STAGED;

	/** Decoration for resource added to index but not yet committed. */
	public final static ImageDescriptor OVR_STAGED_ADD;

	/** Decoration for resource removed from the index but not commit. */
	public final static ImageDescriptor OVR_STAGED_REMOVE;

	/** Decoration for resource that was removed and added with another name */
	public static final ImageDescriptor OVR_STAGED_RENAME;

	/** Decoration for resource not being tracked by Git */
	public final static ImageDescriptor OVR_UNTRACKED;

	/** Decoration for tracked resource with a merge conflict.  */
	public final static ImageDescriptor OVR_CONFLICT;

	/** Decoration for tracked resources that we want to ignore changes in. */
	public final static ImageDescriptor OVR_ASSUMEUNCHANGED;

	/** Decoration for tracked resources that are dirty. */
	public final static ImageDescriptor OVR_DIRTY;

	/** Decoration for warning **/
	public final static ImageDescriptor OVR_ERROR;

	/** Decoration for symlink **/
	public final static ImageDescriptor OVR_SYMLINK;

	/** Find icon */
	public final static ImageDescriptor ELCL16_FIND;
	/** Compare / View icon */
	public final static ImageDescriptor ELCL16_COMPARE_VIEW;
	/** Next arrow icon */
	public final static ImageDescriptor ELCL16_NEXT;
	/** Previous arrow icon */
	public final static ImageDescriptor ELCL16_PREVIOUS;
	/** Commit icon */
	public final static ImageDescriptor ELCL16_COMMIT;
	/** Comments icon */
	public final static ImageDescriptor ELCL16_COMMENTS;
	/** Author icon */
	public final static ImageDescriptor ELCL16_AUTHOR;
	/** Committer icon */
	public final static ImageDescriptor ELCL16_COMMITTER;
	/** Id icon */
	public final static ImageDescriptor ELCL16_ID;
	/** Delete icon */
	public final static ImageDescriptor ELCL16_DELETE;
	/** Add icon */
	public final static ImageDescriptor ELCL16_ADD;
	/** "Add all" icon */
	public final static ImageDescriptor ELCL16_ADD_ALL;
	/** Trash icon */
	public final static ImageDescriptor ELCL16_TRASH;
	/** Clear icon */
	public final static ImageDescriptor ELCL16_CLEAR;
	/** Refresh icon */
	public final static ImageDescriptor ELCL16_REFRESH;
	/** Linked with icon */
	public final static ImageDescriptor ELCL16_SYNCED;
	/** Filter icon */
	public final static ImageDescriptor ELCL16_FILTER;

	/** Filter icon */
	public final static ImageDescriptor ELCL16_COLUMN_LAYOUT;

	/** Enabled, checked, checkbox image */
	public final static ImageDescriptor CHECKBOX_ENABLED_CHECKED;
	/** Enabled, unchecked, checkbox image */
	public final static ImageDescriptor CHECKBOX_ENABLED_UNCHECKED;
	/** Disabled, checked, checkbox image */
	public final static ImageDescriptor CHECKBOX_DISABLED_CHECKED;
	/** Disabled, unchecked, checkbox image */
	public final static ImageDescriptor CHECKBOX_DISABLED_UNCHECKED;
	/** Edit configuration */
	public final static ImageDescriptor EDITCONFIG;
	/** Create Patch Wizard banner */
	public final static ImageDescriptor WIZBAN_CREATE_PATCH;

	/** Import Wizard banner */
	public final static ImageDescriptor WIZBAN_IMPORT_REPO;

	/** Connect Wizard banner */
	public final static ImageDescriptor WIZBAN_CONNECT_REPO;

	/** Commit Wizard banner */
	public final static ImageDescriptor WIZBAN_COMMIT;

	/** Fetch from Gerrit Wizard banner */
	public final static ImageDescriptor WIZBAN_FETCH_GERRIT;

	/** Fetch Wizard banner */
	public final static ImageDescriptor WIZBAN_FETCH;

	/** Pull Wizard banner */
	public final static ImageDescriptor WIZBAN_PULL;

	/** Push to Gerrit Wizard banner */
	public final static ImageDescriptor WIZBAN_PUSH_GERRIT;

	/** Push Wizard banner */
	public final static ImageDescriptor WIZBAN_PUSH;

	/** Synchronize Wizard banner */
	public final static ImageDescriptor WIZBAN_SYNCHRONIZE;

	/** History view, show full repo history */
	public final static ImageDescriptor FILTERNONE;

	/** History view, select all version in same project */
	public final static ImageDescriptor FILTERPROJECT;

	/** History view, select all version in same folder */
	public final static ImageDescriptor FILTERFOLDER;

	/** History view, select all version of resource */
	public final static ImageDescriptor FILTERRESOURCE;

	/** Import button */
	public final static ImageDescriptor FETCH;

	/** Import button */
	public final static ImageDescriptor PULL;

	/** Export button */
	public final static ImageDescriptor PUSH;

	/** Collapse all button */
	public final static ImageDescriptor COLLAPSEALL;

	/** Repository tree node */
	public final static ImageDescriptor REPOSITORY;

	/** Gerrit Repository tree node */
	public final static ImageDescriptor REPOSITORY_GERRIT;

	/** New Repository button */
	public final static ImageDescriptor NEW_REPOSITORY;

	/** Create Repository button */
	public final static ImageDescriptor CREATE_REPOSITORY;

	/** Remote Repository tree node */
	public final static ImageDescriptor REMOTE_REPOSITORY;

	/** Reset */
	public final static ImageDescriptor RESET;

	/** Remote Repository tree node */
	public final static ImageDescriptor REMOTE_SPEC;

	/** Branches tree node */
	public final static ImageDescriptor BRANCHES;

	/** Checked-out decorator for branch */
	public final static ImageDescriptor OVR_CHECKEDOUT;

	/** Tags icon */
	public final static ImageDescriptor TAGS;

	/** Tag icon */
	public final static ImageDescriptor TAG;

	/** Create Tag icon */
	public final static ImageDescriptor CREATE_TAG;

	/** Branch icon */
	public final static ImageDescriptor BRANCH;

	/** Create Branch icon */
	public final static ImageDescriptor CREATE_BRANCH;

	/** Clone Icon */
	public final static ImageDescriptor CLONEGIT;

	/** Changeset Icon */
	public final static ImageDescriptor CHANGESET;

	/** Gerrit Icon */
	public final static ImageDescriptor GERRIT;

	/** Expand all icon */
	public final static ImageDescriptor EXPAND_ALL;

	/** Checkout icon */
	public final static ImageDescriptor CHECKOUT;

	/** Signed Off By icon */
	public final static ImageDescriptor SIGNED_OFF;

	/** Check all icon */
	public final static ImageDescriptor CHECK_ALL;

	/** Uncheck all icon */
	public final static ImageDescriptor UNCHECK_ALL;

	/** Amend commit icon */
	public final static ImageDescriptor AMEND_COMMIT;

	/** Untracked file icon */
	public final static ImageDescriptor UNTRACKED_FILE;

	/** Commit note icon */
	public final static ImageDescriptor NOTE;

	/** Show Annotation icon */
	public final static ImageDescriptor ANNOTATE;

	/** Commit icon */
	public final static ImageDescriptor COMMIT;

	/** Cherry-pick icon */
	public final static ImageDescriptor CHERRY_PICK;

	/** Rebase icon */
	public final static ImageDescriptor REBASE;

	/** Rebase continue icon */
	public final static ImageDescriptor REBASE_CONTINUE;

	/** Rebase skip icon */
	public final static ImageDescriptor REBASE_SKIP;

	/** Rebase abort icon */
	public final static ImageDescriptor REBASE_ABORT;

	/** Rebase process steps icon */
	public final static ImageDescriptor REBASE_PROCESS_STEPS;

	/** Merge icon */
	public final static ImageDescriptor MERGE;

	/** Annotated tag icon */
	public final static ImageDescriptor TAG_ANNOTATED;

	/** Submodules icon */
	public final static ImageDescriptor SUBMODULES;

	/** Clean icon */
	public final static ImageDescriptor CLEAN;

	/** Stash icon */
	public final static ImageDescriptor STASH;

	/** Stash apply icon */
	public final static ImageDescriptor STASH_APPLY;

	/** Stash apply icon */
	public final static ImageDescriptor STASH_CREATE;

	/** History view icon */
	public final static ImageDescriptor HISTORY;

	/** Search commit icon */
	public final static ImageDescriptor SEARCH_COMMIT;

	/** Hierarchy layout icon */
	public final static ImageDescriptor HIERARCHY;

	/** Flat presentation icon */
	public final static ImageDescriptor FLAT;

	/** Compact tree presentation icon */
	public final static ImageDescriptor COMPACT;

	/** Squash icon arrow up */
	public final static ImageDescriptor SQUASH_UP;

	/** Squash icon arrow down */
	public final static ImageDescriptor SQUASH_DOWN;

	/** Fixup icon arrow up */
	public final static ImageDescriptor FIXUP_UP;

	/** Fixup icon arrow down */
	public final static ImageDescriptor FIXUP_DOWN;

	/** Revert icon */
	public final static ImageDescriptor REVERT;

	/** Reword icon */
	public final static ImageDescriptor REWORD;

	/** Icon for done rebase step */
	public final static ImageDescriptor DONE_STEP;

	/** Reword for current rebase step */
	public final static ImageDescriptor CURRENT_STEP;

	/** Sort alphabetically icon */
	public final static ImageDescriptor ALPHABETICALLY_SORT;

	/** Sort by state icon */
	public final static ImageDescriptor STATE_SORT;

	/** Unstage icon */
	public final static ImageDescriptor UNSTAGE;

	/** "Unstage all" icon */
	public final static ImageDescriptor UNSTAGE_ALL;

	/** Assume Unchanged icon */
	public final static ImageDescriptor ASSUME_UNCHANGED;

	/** Untrack icon */
	public final static ImageDescriptor UNTRACK;

	/** {@link #BRANCH} overlaid with {@link #OVR_CHECKEDOUT}. */
	public final static ImageDescriptor CHECKED_OUT_BRANCH;

	/** Ignore icon */
	public final static ImageDescriptor IGNORE;

	/** go to input icon */
	public final static ImageDescriptor GOTO_INPUT;

	/** Icon for "sign with GPG" */
	public final static ImageDescriptor SIGN_COMMIT;

	/**
	 * Icon for merge tool. Don't confuse with {@link #MERGE} commit label icon.
	 */
	public final static ImageDescriptor MERGE_TOOL;

	/** base URL */
	public final static URL base;

	static {
		base = init();
		OVR_CHECKEDOUT = map("ovr/checkedout_ov.png"); //$NON-NLS-1$
		OVR_STAGED = map("ovr/staged.png"); //$NON-NLS-1$
		OVR_STAGED_ADD = map("ovr/staged_added.png"); //$NON-NLS-1$
		OVR_STAGED_REMOVE = map("ovr/staged_removed.png"); //$NON-NLS-1$
		OVR_STAGED_RENAME = map("ovr/staged_renamed.png"); //$NON-NLS-1$
		OVR_UNTRACKED = map("ovr/untracked.png"); //$NON-NLS-1$
		OVR_CONFLICT = map("ovr/conflict.png"); //$NON-NLS-1$
		OVR_ASSUMEUNCHANGED = map("ovr/assume_unchanged.png"); //$NON-NLS-1$
		OVR_DIRTY = map("ovr/dirty.png"); //$NON-NLS-1$
		OVR_SYMLINK = map("ovr/symlink_ovr.png"); //$NON-NLS-1$
		ELCL16_FIND = map("elcl16/find.png"); //$NON-NLS-1$
		ELCL16_COMPARE_VIEW = map("elcl16/compare_view.png"); //$NON-NLS-1$
		ELCL16_NEXT = map("elcl16/next_nav.png"); //$NON-NLS-1$
		ELCL16_PREVIOUS = map("elcl16/prev_nav.png"); //$NON-NLS-1$
		WIZBAN_CREATE_PATCH = map("wizban/createpatch_wizban.png"); //$NON-NLS-1$
		WIZBAN_IMPORT_REPO = map("wizban/import_wiz.png"); //$NON-NLS-1$
		WIZBAN_CONNECT_REPO = map("wizban/newconnect_wizban.png"); //$NON-NLS-1$
		WIZBAN_COMMIT = map("wizban/commit_wizban.png"); //$NON-NLS-1$
		WIZBAN_FETCH_GERRIT = map("wizban/fetch_gerrit_wizban.png"); //$NON-NLS-1$
		WIZBAN_FETCH = map("wizban/fetch_wizban.png"); //$NON-NLS-1$
		WIZBAN_PULL = map("wizban/pull_wizban.png"); //$NON-NLS-1$
		WIZBAN_PUSH_GERRIT = map("wizban/push_gerrit_wizban.png"); //$NON-NLS-1$
		WIZBAN_PUSH = map("wizban/push_wizban.png"); //$NON-NLS-1$
		WIZBAN_SYNCHRONIZE = map("wizban/synchronize_wizban.png"); //$NON-NLS-1$
		EDITCONFIG = map("obj16/editconfig.png"); //$NON-NLS-1$
		ELCL16_COMMIT = map("elcl16/commit.png"); //$NON-NLS-1$
		ELCL16_COMMENTS = map("elcl16/comment.png"); //$NON-NLS-1$
		ELCL16_AUTHOR = map("elcl16/author.png"); //$NON-NLS-1$
		ELCL16_COMMITTER = map("elcl16/committer.png"); //$NON-NLS-1$
		ELCL16_DELETE = map("elcl16/delete.png"); //$NON-NLS-1$
		ELCL16_ADD = map("elcl16/add.png"); //$NON-NLS-1$
		ELCL16_ADD_ALL = map("elcl16/add_all.png"); //$NON-NLS-1$
		// For Photon and newer, use the new "flat look" trash icon
		ELCL16_TRASH = map(Platform.getBundle("org.eclipse.ui").getVersion() //$NON-NLS-1$
				.compareTo(Version.valueOf("3.109.100")) >= 0 ? //$NON-NLS-1$
						"elcl16/trash_flat.png" : "elcl16/trash.png"); //$NON-NLS-1$ //$NON-NLS-2$
		ELCL16_CLEAR = map("elcl16/clear_co.png"); //$NON-NLS-1$
		ELCL16_REFRESH = map("elcl16/refresh.png"); //$NON-NLS-1$
		ELCL16_SYNCED = map("elcl16/synced.png"); //$NON-NLS-1$
		ELCL16_FILTER = map("elcl16/filter_ps.png"); //$NON-NLS-1$
		ELCL16_ID = map("elcl16/sha1.png"); //$NON-NLS-1$
		ELCL16_COLUMN_LAYOUT = map("elcl16/horizontal_view.png"); //$NON-NLS-1$
		CHECKBOX_ENABLED_CHECKED = map("checkboxes/enabled_checked.png"); //$NON-NLS-1$
		CHECKBOX_ENABLED_UNCHECKED = map("checkboxes/enabled_unchecked.png"); //$NON-NLS-1$
		CHECKBOX_DISABLED_CHECKED = map("checkboxes/disabled_checked.png"); //$NON-NLS-1$
		CHECKBOX_DISABLED_UNCHECKED = map("checkboxes/disabled_unchecked.png"); //$NON-NLS-1$
		FILTERNONE = map("elcl16/filter_none.png"); //$NON-NLS-1$
		FILTERRESOURCE = map("elcl16/filterresource.png"); //$NON-NLS-1$
		FILTERPROJECT = map("elcl16/filterproject.png"); //$NON-NLS-1$
		FILTERFOLDER = map("elcl16/filterfolder.png"); //$NON-NLS-1$
		FETCH = map("obj16/fetch.png"); //$NON-NLS-1$
		PUSH = map("obj16/push.png"); //$NON-NLS-1$
		PULL = map("obj16/pull.png"); //$NON-NLS-1$
		REPOSITORY = map("obj16/repository_rep.png"); //$NON-NLS-1$
		REPOSITORY_GERRIT = map("obj16/repository_gerrit.png"); //$NON-NLS-1$
		NEW_REPOSITORY = map("etool16/newlocation_wiz.png"); //$NON-NLS-1$
		REMOTE_REPOSITORY = map("obj16/remote_entry_tbl.png"); //$NON-NLS-1$
		REMOTE_SPEC = map("obj16/synchronize.png"); //$NON-NLS-1$
		BRANCHES = map("obj16/branches_obj.png"); //$NON-NLS-1$
		TAGS = map("obj16/tags.png"); //$NON-NLS-1$
		TAG = map("obj16/version_rep.png"); //$NON-NLS-1$
		CREATE_TAG = map("obj16/new_tag_obj.png"); //$NON-NLS-1$
		BRANCH = map("obj16/branch_obj.png"); //$NON-NLS-1$
		CREATE_BRANCH = map("obj16/new_branch_obj.png"); //$NON-NLS-1$
		COLLAPSEALL = map("elcl16/collapseall.png"); //$NON-NLS-1$
		CLONEGIT = map("obj16/cloneGit.png"); //$NON-NLS-1$
		RESET = map("obj16/reset.png"); //$NON-NLS-1$
		CHANGESET = map("obj16/changelog_obj.png"); //$NON-NLS-1$
		GERRIT = map("obj16/gerrit_obj.png"); //$NON-NLS-1$
		EXPAND_ALL = map("elcl16/expandall.png"); //$NON-NLS-1$
		CHECKOUT = map("obj16/checkout.png"); //$NON-NLS-1$
		SIGNED_OFF = map("obj16/signed-off.png"); //$NON-NLS-1$
		CHECK_ALL = map("obj16/check_all.png"); //$NON-NLS-1$
		UNCHECK_ALL = map("obj16/uncheck_all.png"); //$NON-NLS-1$
		AMEND_COMMIT = map("obj16/commit_amend.png"); //$NON-NLS-1$
		UNTRACKED_FILE = map("obj16/untracked_file.png"); //$NON-NLS-1$
		NOTE = map("obj16/note.png"); //$NON-NLS-1$
		ANNOTATE = map("etool16/annotate.png"); //$NON-NLS-1$
		COMMIT = map("obj16/commit.png"); //$NON-NLS-1$
		CHERRY_PICK = map("obj16/cherry-pick.png"); //$NON-NLS-1$
		REBASE = map("obj16/rebase.png"); //$NON-NLS-1$
		REBASE_CONTINUE = map("elcl16/continue.png"); //$NON-NLS-1$
		REBASE_SKIP = map("elcl16/skip.png"); //$NON-NLS-1$
		REBASE_ABORT = map("elcl16/progress_stop.png"); //$NON-NLS-1$
		REBASE_PROCESS_STEPS = map("elcl16/start.png"); //$NON-NLS-1$
		OVR_ERROR = map("ovr/error.png"); //$NON-NLS-1$
		MERGE = map("obj16/merge.png"); //$NON-NLS-1$
		TAG_ANNOTATED = map("obj16/annotated-tag.png"); //$NON-NLS-1$
		CREATE_REPOSITORY = map("etool16/createRepository.png"); //$NON-NLS-1$
		SUBMODULES = map("obj16/submodules.png"); //$NON-NLS-1$
		CLEAN = map("obj16/clean_obj.png"); //$NON-NLS-1$
		STASH = map("obj16/stash.png"); //$NON-NLS-1$
		STASH_APPLY = map("obj16/stash-apply.png"); //$NON-NLS-1$
		STASH_CREATE = map("obj16/stash-create.png"); //$NON-NLS-1$
		HISTORY = map("obj16/history.png"); //$NON-NLS-1$
		SEARCH_COMMIT = map("obj16/search-commit.png"); //$NON-NLS-1$
		HIERARCHY = map("elcl16/hierarchicalLayout.png"); //$NON-NLS-1$
		FLAT = map("elcl16/flatLayout.png"); //$NON-NLS-1$
		COMPACT = map("elcl16/compactLayout.png"); //$NON-NLS-1$
		SQUASH_UP = map("obj16/squash-up.png"); //$NON-NLS-1$
		SQUASH_DOWN = map("obj16/squash-down.png"); //$NON-NLS-1$
		FIXUP_UP = map("obj16/fixup-up.png"); //$NON-NLS-1$
		FIXUP_DOWN = map("obj16/fixup-down.png"); //$NON-NLS-1$
		REVERT = map("obj16/revert.png"); //$NON-NLS-1$
		REWORD = map("obj16/reword.png"); //$NON-NLS-1$
		DONE_STEP = map("obj16/done_step.png"); //$NON-NLS-1$
		CURRENT_STEP = map("obj16/current_step.png"); //$NON-NLS-1$
		ALPHABETICALLY_SORT = map("obj16/alphab_sort_co.png"); //$NON-NLS-1$
		STATE_SORT = map("obj16/state_sort_co.png"); //$NON-NLS-1$
		UNSTAGE = map("obj16/unstage.png"); //$NON-NLS-1$
		UNSTAGE_ALL = map("elcl16/unstage_all.png"); //$NON-NLS-1$
		ASSUME_UNCHANGED = map("obj16/assume_unchanged.png"); //$NON-NLS-1$
		UNTRACK = map("obj16/untrack.png"); //$NON-NLS-1$
		IGNORE = map("obj16/ignore.png"); //$NON-NLS-1$
		GOTO_INPUT = map("elcl16/goto_input.png"); //$NON-NLS-1$
		CHECKED_OUT_BRANCH = new DecorationOverlayDescriptor(BRANCH,
				OVR_CHECKEDOUT, IDecoration.TOP_LEFT);
		SIGN_COMMIT = map("obj16/sign-commit.png"); //$NON-NLS-1$
		MERGE_TOOL = map("obj16/mergetool.png"); //$NON-NLS-1$
	}

	private static ImageDescriptor map(final String icon) {
		if (base != null) {
			try {
				return ImageDescriptor.createFromURL(new URL(base, icon));
			} catch (MalformedURLException mux) {
				Activator.logError(UIText.UIIcons_errorLoadingPluginImage, mux);
			}
		}
		return ImageDescriptor.getMissingImageDescriptor();
	}

	private static URL init() {
		try {
			return new URL(Activator.getDefault().getBundle().getEntry("/"), //$NON-NLS-1$
					"icons/"); //$NON-NLS-1$
		} catch (MalformedURLException mux) {
			Activator.logError(UIText.UIIcons_errorDeterminingIconBase, mux);
			return null;
		}
	}

	/**
	 * Get the image for the given descriptor from the resource manager which
	 * handles disposal of the image when the resource manager itself is
	 * disposed.
	 *
	 * @param resourceManager
	 *            {code ResourceManager} managing the image resources
	 * @param descriptor
	 *            object describing an image
	 * @return the image for the given descriptor
	 */
	public static Image getImage(ResourceManager resourceManager,
			ImageDescriptor descriptor) {
		return (Image) resourceManager.get(descriptor);
	}
}

Back to the top