Create the import wizard question checkbox properly
[egit/imyousuf.git] / org.spearce.egit.ui / src / org / spearce / egit / ui / UIIcons.java
blob1697542abbc535d6d2efccdc6e200b7b95bee0e5
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 * See LICENSE for the full license text, also available.
9 *******************************************************************************/
10 package org.spearce.egit.ui;
12 import java.net.MalformedURLException;
13 import java.net.URL;
15 import org.eclipse.jface.resource.ImageDescriptor;
17 /**
18 * Icons for the the Eclipse plugin. Mostly decorations.
20 public class UIIcons {
21 /** Decoration for resource added to index but not yet committed. */
22 public static final ImageDescriptor OVR_PENDING_ADD;
24 /** Decoration for resource removed from the index but not commit. */
25 public static final ImageDescriptor OVR_PENDING_REMOVE;
27 /** Decoration for resource tracked and committed in git. */
28 public static final ImageDescriptor OVR_SHARED;
30 /** Decoration for tracked resource with a merge conflict. */
31 public static final ImageDescriptor OVR_CONFLICT;
33 /** Decoration for tracked resources that we want to ignore changes in. */
34 public static final ImageDescriptor OVR_ASSUMEVALID;
36 /** Find icon */
37 public static final ImageDescriptor ELCL16_FIND;
38 /** Next arrow icon */
39 public static final ImageDescriptor ELCL16_NEXT;
40 /** Previous arrow icon */
41 public static final ImageDescriptor ELCL16_PREVIOUS;
42 /** Commit icon */
43 public static final ImageDescriptor ELCL16_COMMIT;
44 /** Comments icon */
45 public static final ImageDescriptor ELCL16_COMMENTS;
46 /** Author icon */
47 public static final ImageDescriptor ELCL16_AUTHOR;
48 /** Committer icon */
49 public static final ImageDescriptor ELCL16_COMMITTER;
50 /** Delete icon */
51 public static final ImageDescriptor ELCL16_DELETE;
52 /** Add icon */
53 public static final ImageDescriptor ELCL16_ADD;
54 /** Trash icon */
55 public static final ImageDescriptor ELCL16_TRASH;
56 /** Clear icon */
57 public static final ImageDescriptor ELCL16_CLEAR;
59 /** Enabled, checked, checkbox image */
60 public static final ImageDescriptor CHECKBOX_ENABLED_CHECKED;
61 /** Enabled, unchecked, checkbox image */
62 public static final ImageDescriptor CHECKBOX_ENABLED_UNCHECKED;
63 /** Disabled, checked, checkbox image */
64 public static final ImageDescriptor CHECKBOX_DISABLED_CHECKED;
65 /** Disabled, unchecked, checkbox image */
66 public static final ImageDescriptor CHECKBOX_DISABLED_UNCHECKED;
68 /** Import Wizard banner */
69 public static final ImageDescriptor WIZBAN_IMPORT_REPO;
71 /** Connect Wizard banner */
72 public static final ImageDescriptor WIZBAN_CONNECT_REPO;
74 private static final URL base;
76 static {
77 base = init();
78 OVR_PENDING_ADD = map("ovr/pending_add.gif");
79 OVR_PENDING_REMOVE = map("ovr/pending_remove.gif");
80 OVR_SHARED = map("ovr/shared.gif");
81 OVR_CONFLICT = map("ovr/conflict.gif");
82 OVR_ASSUMEVALID = map("ovr/assumevalid.gif");
83 ELCL16_FIND = map("elcl16/find.gif");
84 ELCL16_NEXT = map("elcl16/next.gif");
85 ELCL16_PREVIOUS = map("elcl16/previous.gif");
86 WIZBAN_IMPORT_REPO = map("wizban/import_wiz.png");
87 WIZBAN_CONNECT_REPO = map("wizban/newconnect_wizban.png");
88 ELCL16_COMMIT = map("elcl16/commit.gif");
89 ELCL16_COMMENTS = map("elcl16/comment.gif");
90 ELCL16_AUTHOR = map("elcl16/author.gif");
91 ELCL16_COMMITTER = map("elcl16/committer.gif");
92 ELCL16_DELETE = map("elcl16/delete.gif");
93 ELCL16_ADD = map("elcl16/add.gif");
94 ELCL16_TRASH = map("elcl16/trash.gif");
95 ELCL16_CLEAR = map("elcl16/clear.gif");
96 CHECKBOX_ENABLED_CHECKED = map("checkboxes/enabled_checked.gif");
97 CHECKBOX_ENABLED_UNCHECKED = map("checkboxes/enabled_unchecked.gif");
98 CHECKBOX_DISABLED_CHECKED = map("checkboxes/disabled_checked.gif");
99 CHECKBOX_DISABLED_UNCHECKED = map("checkboxes/disabled_unchecked.gif");
102 private static ImageDescriptor map(final String icon) {
103 if (base != null) {
104 try {
105 return ImageDescriptor.createFromURL(new URL(base, icon));
106 } catch (MalformedURLException mux) {
107 Activator.logError("Can't load plugin image.", mux);
110 return ImageDescriptor.getMissingImageDescriptor();
113 private static URL init() {
114 try {
115 return new URL(Activator.getDefault().getBundle().getEntry("/"),
116 "icons/");
117 } catch (MalformedURLException mux) {
118 Activator.logError("Can't determine icon base.", mux);
119 return null;