Git Repositories View: use the new, cool icons
[egit.git] / org.eclipse.egit.ui / src / org / eclipse / egit / ui / UIIcons.java
blob072ea44a504305259f88e384e8737f3c42d2dc31
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 /** Compare / View icon */
44 public static final ImageDescriptor ELCL16_COMPARE_VIEW;
45 /** Next arrow icon */
46 public static final ImageDescriptor ELCL16_NEXT;
47 /** Previous arrow icon */
48 public static final ImageDescriptor ELCL16_PREVIOUS;
49 /** Commit icon */
50 public static final ImageDescriptor ELCL16_COMMIT;
51 /** Comments icon */
52 public static final ImageDescriptor ELCL16_COMMENTS;
53 /** Author icon */
54 public static final ImageDescriptor ELCL16_AUTHOR;
55 /** Committer icon */
56 public static final ImageDescriptor ELCL16_COMMITTER;
57 /** Delete icon */
58 public static final ImageDescriptor ELCL16_DELETE;
59 /** Add icon */
60 public static final ImageDescriptor ELCL16_ADD;
61 /** Trash icon */
62 public static final ImageDescriptor ELCL16_TRASH;
63 /** Clear icon */
64 public static final ImageDescriptor ELCL16_CLEAR;
65 /** Refresh icon */
66 public static final ImageDescriptor ELCL16_REFRESH;
67 /** Linked with icon */
68 public static final ImageDescriptor ELCL16_SYNCED;
70 /** Enabled, checked, checkbox image */
71 public static final ImageDescriptor CHECKBOX_ENABLED_CHECKED;
72 /** Enabled, unchecked, checkbox image */
73 public static final ImageDescriptor CHECKBOX_ENABLED_UNCHECKED;
74 /** Disabled, checked, checkbox image */
75 public static final ImageDescriptor CHECKBOX_DISABLED_CHECKED;
76 /** Disabled, unchecked, checkbox image */
77 public static final ImageDescriptor CHECKBOX_DISABLED_UNCHECKED;
79 /** Create Patch Wizard banner */
80 public static final ImageDescriptor WIZBAN_CREATE_PATCH;
82 /** Import Wizard banner */
83 public static final ImageDescriptor WIZBAN_IMPORT_REPO;
85 /** Connect Wizard banner */
86 public static final ImageDescriptor WIZBAN_CONNECT_REPO;
88 /** History filter, select all version in repo */
89 public static ImageDescriptor FILTERREPO;
91 /** History filter, select all version in same project */
92 public static ImageDescriptor FILTERPROJECT;
94 /** History filter, select all version in same folder */
95 public static ImageDescriptor FILTERFOLDER;
97 /** Import button */
98 public static ImageDescriptor FETCH;
100 /** Export button */
101 public static ImageDescriptor PUSH;
103 /** Collapse all button */
104 public static ImageDescriptor COLLAPSEALL;
106 /** Repository tree node */
107 public static ImageDescriptor REPOSITORY;
109 /** New Repository button */
110 public static ImageDescriptor NEW_REPOSITORY;
112 /** Remote Repository tree node */
113 public static ImageDescriptor REMOTE_REPOSITORY;
115 /** Remote Repository tree node */
116 public static ImageDescriptor REMOTE_SPEC;
118 /** Branches tree node */
119 public static ImageDescriptor BRANCHES;
121 /** Checked-out decorator for branch */
122 public static ImageDescriptor OVR_CHECKEDOUT;
124 /** Tags icon */
125 public static ImageDescriptor TAGS;
127 /** Tag icon */
128 public static ImageDescriptor TAG;
130 /** Branch icon */
131 public static ImageDescriptor BRANCH;
133 /** Clone Icon */
134 public static ImageDescriptor CLONEGIT;
136 private static final URL base;
138 static {
139 base = init();
140 OVR_STAGED = map("ovr/staged.gif"); //$NON-NLS-1$
141 OVR_STAGED_ADD = map("ovr/staged_added.gif"); //$NON-NLS-1$
142 OVR_STAGED_REMOVE = map("ovr/staged_removed.gif"); //$NON-NLS-1$
143 OVR_UNTRACKED = map("ovr/untracked.gif"); //$NON-NLS-1$
144 OVR_CONFLICT = map("ovr/conflict.gif"); //$NON-NLS-1$
145 OVR_ASSUMEVALID = map("ovr/assume_valid.gif"); //$NON-NLS-1$
146 ELCL16_FIND = map("elcl16/find.gif"); //$NON-NLS-1$
147 ELCL16_COMPARE_VIEW = map("elcl16/compare_view.gif"); //$NON-NLS-1$
148 ELCL16_NEXT = map("elcl16/next.gif"); //$NON-NLS-1$
149 ELCL16_PREVIOUS = map("elcl16/previous.gif"); //$NON-NLS-1$
150 WIZBAN_CREATE_PATCH = map("wizban/createpatch_wizban.png"); //$NON-NLS-1$
151 WIZBAN_IMPORT_REPO = map("wizban/import_wiz.png"); //$NON-NLS-1$
152 WIZBAN_CONNECT_REPO = map("wizban/newconnect_wizban.png"); //$NON-NLS-1$
153 ELCL16_COMMIT = map("elcl16/commit.gif"); //$NON-NLS-1$
154 ELCL16_COMMENTS = map("elcl16/comment.gif"); //$NON-NLS-1$
155 ELCL16_AUTHOR = map("elcl16/author.gif"); //$NON-NLS-1$
156 ELCL16_COMMITTER = map("elcl16/committer.gif"); //$NON-NLS-1$
157 ELCL16_DELETE = map("elcl16/delete.gif"); //$NON-NLS-1$
158 ELCL16_ADD = map("elcl16/add.gif"); //$NON-NLS-1$
159 ELCL16_TRASH = map("elcl16/trash.gif"); //$NON-NLS-1$
160 ELCL16_CLEAR = map("elcl16/clear.gif"); //$NON-NLS-1$
161 ELCL16_REFRESH = map("elcl16/refresh.gif"); //$NON-NLS-1$
162 ELCL16_SYNCED = map("elcl16/synced.gif"); //$NON-NLS-1$
163 CHECKBOX_ENABLED_CHECKED = map("checkboxes/enabled_checked.gif"); //$NON-NLS-1$
164 CHECKBOX_ENABLED_UNCHECKED = map("checkboxes/enabled_unchecked.gif"); //$NON-NLS-1$
165 CHECKBOX_DISABLED_CHECKED = map("checkboxes/disabled_checked.gif"); //$NON-NLS-1$
166 CHECKBOX_DISABLED_UNCHECKED = map("checkboxes/disabled_unchecked.gif"); //$NON-NLS-1$
167 FILTERREPO = map("elcl16/filterrepo.gif"); //$NON-NLS-1$
168 FILTERPROJECT = map("elcl16/filterproject.gif"); //$NON-NLS-1$
169 FILTERFOLDER = map("elcl16/filterfolder.gif"); //$NON-NLS-1$
170 FETCH = map("obj16/pull.gif"); //$NON-NLS-1$
171 PUSH = map("obj16/commit.gif"); //$NON-NLS-1$
172 REPOSITORY = map("obj16/repository_rep.gif"); //$NON-NLS-1$
173 NEW_REPOSITORY = map("etool16/newlocation_wiz.gif"); //$NON-NLS-1$
174 REMOTE_REPOSITORY = map("obj16/remote_entry_tbl.gif"); //$NON-NLS-1$
175 REMOTE_SPEC = map("obj16/remotespec.gif"); //$NON-NLS-1$
176 BRANCHES = map("obj16/branches_rep.gif"); //$NON-NLS-1$
177 OVR_CHECKEDOUT = map("ovr/checkedout_ov.gif"); //$NON-NLS-1$
178 TAGS = map("obj16/versions_rep.gif"); //$NON-NLS-1$
179 TAG = map("obj16/version_rep.gif"); //$NON-NLS-1$
180 BRANCH = map("obj16/branch.gif"); //$NON-NLS-1$
181 COLLAPSEALL = map("elcl16/collapseall.gif"); //$NON-NLS-1$
182 CLONEGIT = map("obj16/cloneGit.gif"); //$NON-NLS-1$
185 private static ImageDescriptor map(final String icon) {
186 if (base != null) {
187 try {
188 return ImageDescriptor.createFromURL(new URL(base, icon));
189 } catch (MalformedURLException mux) {
190 Activator.logError(UIText.UIIcons_errorLoadingPluginImage, mux);
193 return ImageDescriptor.getMissingImageDescriptor();
196 private static URL init() {
197 try {
198 return new URL(Activator.getDefault().getBundle().getEntry("/"), //$NON-NLS-1$
199 "icons/"); //$NON-NLS-1$
200 } catch (MalformedURLException mux) {
201 Activator.logError(UIText.UIIcons_errorDeterminingIconBase, mux);
202 return null;