Initial EGit contribution to eclipse.org
[egit.git] / org.eclipse.egit.ui / src / org / eclipse / egit / ui / UIIcons.java
blobb66ebb322f4860ad6594c2b78a8a8324e74befec
1 /*******************************************************************************
2 * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>
3 * Copyright (C) 2008, Roger C. Soares <rogersoares@intelinet.com.br>
4 * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>
6 * All rights reserved. This program and the accompanying materials
7 * are made available under the terms of the Eclipse Public License v1.0
8 * which accompanies this distribution, and is available at
9 * http://www.eclipse.org/legal/epl-v10.html
10 *******************************************************************************/
11 package org.eclipse.egit.ui;
13 import java.net.MalformedURLException;
14 import java.net.URL;
16 import org.eclipse.jface.resource.ImageDescriptor;
18 /**
19 * Icons for the the Eclipse plugin. Mostly decorations.
21 public class UIIcons {
23 /** Decoration for resource in the index but not yet committed. */
24 public static final ImageDescriptor OVR_STAGED;
26 /** Decoration for resource added to index but not yet committed. */
27 public static final ImageDescriptor OVR_STAGED_ADD;
29 /** Decoration for resource removed from the index but not commit. */
30 public static final ImageDescriptor OVR_STAGED_REMOVE;
32 /** Decoration for resource not being tracked by Git */
33 public static final ImageDescriptor OVR_UNTRACKED;
35 /** Decoration for tracked resource with a merge conflict. */
36 public static final ImageDescriptor OVR_CONFLICT;
38 /** Decoration for tracked resources that we want to ignore changes in. */
39 public static final ImageDescriptor OVR_ASSUMEVALID;
41 /** Find icon */
42 public static final ImageDescriptor ELCL16_FIND;
43 /** Next arrow icon */
44 public static final ImageDescriptor ELCL16_NEXT;
45 /** Previous arrow icon */
46 public static final ImageDescriptor ELCL16_PREVIOUS;
47 /** Commit icon */
48 public static final ImageDescriptor ELCL16_COMMIT;
49 /** Comments icon */
50 public static final ImageDescriptor ELCL16_COMMENTS;
51 /** Author icon */
52 public static final ImageDescriptor ELCL16_AUTHOR;
53 /** Committer icon */
54 public static final ImageDescriptor ELCL16_COMMITTER;
55 /** Delete icon */
56 public static final ImageDescriptor ELCL16_DELETE;
57 /** Add icon */
58 public static final ImageDescriptor ELCL16_ADD;
59 /** Trash icon */
60 public static final ImageDescriptor ELCL16_TRASH;
61 /** Clear icon */
62 public static final ImageDescriptor ELCL16_CLEAR;
64 /** Enabled, checked, checkbox image */
65 public static final ImageDescriptor CHECKBOX_ENABLED_CHECKED;
66 /** Enabled, unchecked, checkbox image */
67 public static final ImageDescriptor CHECKBOX_ENABLED_UNCHECKED;
68 /** Disabled, checked, checkbox image */
69 public static final ImageDescriptor CHECKBOX_DISABLED_CHECKED;
70 /** Disabled, unchecked, checkbox image */
71 public static final ImageDescriptor CHECKBOX_DISABLED_UNCHECKED;
73 /** Import Wizard banner */
74 public static final ImageDescriptor WIZBAN_IMPORT_REPO;
76 /** Connect Wizard banner */
77 public static final ImageDescriptor WIZBAN_CONNECT_REPO;
79 /** History filter, select all version in repo */
80 public static ImageDescriptor FILTERREPO;
82 /** History filter, select all version in same project */
83 public static ImageDescriptor FILTERPROJECT;
85 /** History filter, select all version in same folder */
86 public static ImageDescriptor FILTERFOLDER;
88 private static final URL base;
90 static {
91 base = init();
92 OVR_STAGED = map("ovr/staged.gif");
93 OVR_STAGED_ADD = map("ovr/staged_added.gif");
94 OVR_STAGED_REMOVE = map("ovr/staged_removed.gif");
95 OVR_UNTRACKED = map("ovr/untracked.gif");
96 OVR_CONFLICT = map("ovr/conflict.gif");
97 OVR_ASSUMEVALID = map("ovr/assume_valid.gif");
98 ELCL16_FIND = map("elcl16/find.gif");
99 ELCL16_NEXT = map("elcl16/next.gif");
100 ELCL16_PREVIOUS = map("elcl16/previous.gif");
101 WIZBAN_IMPORT_REPO = map("wizban/import_wiz.png");
102 WIZBAN_CONNECT_REPO = map("wizban/newconnect_wizban.png");
103 ELCL16_COMMIT = map("elcl16/commit.gif");
104 ELCL16_COMMENTS = map("elcl16/comment.gif");
105 ELCL16_AUTHOR = map("elcl16/author.gif");
106 ELCL16_COMMITTER = map("elcl16/committer.gif");
107 ELCL16_DELETE = map("elcl16/delete.gif");
108 ELCL16_ADD = map("elcl16/add.gif");
109 ELCL16_TRASH = map("elcl16/trash.gif");
110 ELCL16_CLEAR = map("elcl16/clear.gif");
111 CHECKBOX_ENABLED_CHECKED = map("checkboxes/enabled_checked.gif");
112 CHECKBOX_ENABLED_UNCHECKED = map("checkboxes/enabled_unchecked.gif");
113 CHECKBOX_DISABLED_CHECKED = map("checkboxes/disabled_checked.gif");
114 CHECKBOX_DISABLED_UNCHECKED = map("checkboxes/disabled_unchecked.gif");
115 FILTERREPO = map("elcl16/filterrepo.gif");
116 FILTERPROJECT = map("elcl16/filterproject.gif");
117 FILTERFOLDER = map("elcl16/filterfolder.gif");
120 private static ImageDescriptor map(final String icon) {
121 if (base != null) {
122 try {
123 return ImageDescriptor.createFromURL(new URL(base, icon));
124 } catch (MalformedURLException mux) {
125 Activator.logError("Can't load plugin image.", mux);
128 return ImageDescriptor.getMissingImageDescriptor();
131 private static URL init() {
132 try {
133 return new URL(Activator.getDefault().getBundle().getEntry("/"),
134 "icons/");
135 } catch (MalformedURLException mux) {
136 Activator.logError("Can't determine icon base.", mux);
137 return null;