Git Repositories View: CloneGit Icon
[egit.git] / org.eclipse.egit.ui / src / org / eclipse / egit / ui / UIIcons.java
blobd005c107ce7620ec7bdae6a8e1f1bd01119a38c4
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 /** Import Wizard banner */
80 public static final ImageDescriptor WIZBAN_IMPORT_REPO;
82 /** Connect Wizard banner */
83 public static final ImageDescriptor WIZBAN_CONNECT_REPO;
85 /** History filter, select all version in repo */
86 public static ImageDescriptor FILTERREPO;
88 /** History filter, select all version in same project */
89 public static ImageDescriptor FILTERPROJECT;
91 /** History filter, select all version in same folder */
92 public static ImageDescriptor FILTERFOLDER;
94 /** Import button */
95 public static ImageDescriptor IMPORT;
97 /** Export button */
98 public static ImageDescriptor EXPORT;
100 /** Collapse all button */
101 public static ImageDescriptor COLLAPSEALL;
103 /** Repository tree node */
104 public static ImageDescriptor REPOSITORY;
106 /** New Repository button */
107 public static ImageDescriptor NEW_REPOSITORY;
109 /** Remote Repository tree node */
110 public static ImageDescriptor REMOTE_REPOSITORY;
112 /** Branches tree node */
113 public static ImageDescriptor BRANCHES;
115 /** Checked-out decorator for branch */
116 public static ImageDescriptor OVR_CHECKEDOUT;
118 /** Tags icon */
119 public static ImageDescriptor TAGS;
121 /** Tag icon */
122 public static ImageDescriptor TAG;
124 /** Branch icon */
125 public static ImageDescriptor BRANCH;
127 /** Clone Icon */
128 public static ImageDescriptor CLONEGIT;
130 private static final URL base;
132 static {
133 base = init();
134 OVR_STAGED = map("ovr/staged.gif"); //$NON-NLS-1$
135 OVR_STAGED_ADD = map("ovr/staged_added.gif"); //$NON-NLS-1$
136 OVR_STAGED_REMOVE = map("ovr/staged_removed.gif"); //$NON-NLS-1$
137 OVR_UNTRACKED = map("ovr/untracked.gif"); //$NON-NLS-1$
138 OVR_CONFLICT = map("ovr/conflict.gif"); //$NON-NLS-1$
139 OVR_ASSUMEVALID = map("ovr/assume_valid.gif"); //$NON-NLS-1$
140 ELCL16_FIND = map("elcl16/find.gif"); //$NON-NLS-1$
141 ELCL16_COMPARE_VIEW = map("elcl16/compare_view.gif"); //$NON-NLS-1$
142 ELCL16_NEXT = map("elcl16/next.gif"); //$NON-NLS-1$
143 ELCL16_PREVIOUS = map("elcl16/previous.gif"); //$NON-NLS-1$
144 WIZBAN_IMPORT_REPO = map("wizban/import_wiz.png"); //$NON-NLS-1$
145 WIZBAN_CONNECT_REPO = map("wizban/newconnect_wizban.png"); //$NON-NLS-1$
146 ELCL16_COMMIT = map("elcl16/commit.gif"); //$NON-NLS-1$
147 ELCL16_COMMENTS = map("elcl16/comment.gif"); //$NON-NLS-1$
148 ELCL16_AUTHOR = map("elcl16/author.gif"); //$NON-NLS-1$
149 ELCL16_COMMITTER = map("elcl16/committer.gif"); //$NON-NLS-1$
150 ELCL16_DELETE = map("elcl16/delete.gif"); //$NON-NLS-1$
151 ELCL16_ADD = map("elcl16/add.gif"); //$NON-NLS-1$
152 ELCL16_TRASH = map("elcl16/trash.gif"); //$NON-NLS-1$
153 ELCL16_CLEAR = map("elcl16/clear.gif"); //$NON-NLS-1$
154 ELCL16_REFRESH = map("elcl16/refresh.gif"); //$NON-NLS-1$
155 ELCL16_SYNCED = map("elcl16/synced.gif"); //$NON-NLS-1$
156 CHECKBOX_ENABLED_CHECKED = map("checkboxes/enabled_checked.gif"); //$NON-NLS-1$
157 CHECKBOX_ENABLED_UNCHECKED = map("checkboxes/enabled_unchecked.gif"); //$NON-NLS-1$
158 CHECKBOX_DISABLED_CHECKED = map("checkboxes/disabled_checked.gif"); //$NON-NLS-1$
159 CHECKBOX_DISABLED_UNCHECKED = map("checkboxes/disabled_unchecked.gif"); //$NON-NLS-1$
160 FILTERREPO = map("elcl16/filterrepo.gif"); //$NON-NLS-1$
161 FILTERPROJECT = map("elcl16/filterproject.gif"); //$NON-NLS-1$
162 FILTERFOLDER = map("elcl16/filterfolder.gif"); //$NON-NLS-1$
163 IMPORT = map("etool16/import_wiz.gif"); //$NON-NLS-1$
164 EXPORT = map("etool16/export_wiz.gif"); //$NON-NLS-1$
165 REPOSITORY = map("obj16/repository_rep.gif"); //$NON-NLS-1$
166 NEW_REPOSITORY = map("etool16/newlocation_wiz.gif"); //$NON-NLS-1$
167 REMOTE_REPOSITORY = map("obj16/remote_entry_tbl.gif"); //$NON-NLS-1$
168 BRANCHES = map("obj16/branches_rep.gif"); //$NON-NLS-1$
169 OVR_CHECKEDOUT = map("ovr/checkedout_ov.gif"); //$NON-NLS-1$
170 TAGS = map("obj16/versions_rep.gif"); //$NON-NLS-1$
171 TAG = map("obj16/version_rep.gif"); //$NON-NLS-1$
172 BRANCH = map("obj16/branch.gif"); //$NON-NLS-1$
173 COLLAPSEALL = map("elcl16/collapseall.gif"); //$NON-NLS-1$
174 CLONEGIT = map("obj16/cloneGit.gif"); //$NON-NLS-1$
177 private static ImageDescriptor map(final String icon) {
178 if (base != null) {
179 try {
180 return ImageDescriptor.createFromURL(new URL(base, icon));
181 } catch (MalformedURLException mux) {
182 Activator.logError(UIText.UIIcons_errorLoadingPluginImage, mux);
185 return ImageDescriptor.getMissingImageDescriptor();
188 private static URL init() {
189 try {
190 return new URL(Activator.getDefault().getBundle().getEntry("/"), //$NON-NLS-1$
191 "icons/"); //$NON-NLS-1$
192 } catch (MalformedURLException mux) {
193 Activator.logError(UIText.UIIcons_errorDeterminingIconBase, mux);
194 return null;