Remove Unused Texts from UIText.java and corresponding properties
[egit.git] / org.eclipse.egit.ui / src / org / eclipse / egit / ui / UIPreferences.java
blob62201da332390bedebfc9e653496603b32e0d687
1 /*******************************************************************************
2 * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
3 * Copyright (C) 2008, Roger C. Soares <rogersoares@intelinet.com.br>
4 * Copyright (C) 2008, 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 org.eclipse.core.runtime.Preferences;
15 /**
16 * Preferences used by the plugin.
17 * All plugin preferences shall be referenced by a constant in this class.
19 public class UIPreferences {
20 /** */
21 public final static String RESOURCEHISTORY_SHOW_COMMENT_WRAP = "resourcehistory_show_comment_wrap"; //$NON-NLS-1$
22 /** */
23 public static final String RESOURCEHISTORY_SHOW_COMMENT_FILL = "resourcehistory_fill_comment_paragraph"; //$NON-NLS-1$
24 /** */
25 public final static String RESOURCEHISTORY_SHOW_REV_DETAIL = "resourcehistory_show_rev_detail"; //$NON-NLS-1$
26 /** */
27 public final static String RESOURCEHISTORY_SHOW_REV_COMMENT = "resourcehistory_show_rev_comment"; //$NON-NLS-1$
28 /** */
29 public final static String RESOURCEHISTORY_GRAPH_SPLIT = "resourcehistory_graph_split"; //$NON-NLS-1$
30 /** */
31 public final static String RESOURCEHISTORY_REV_SPLIT = "resourcehistory_rev_split"; //$NON-NLS-1$
32 /** */
33 public final static String RESOURCEHISTORY_SHOW_TOOLTIPS = "resourcehistory_show_tooltips"; //$NON-NLS-1$
34 /** */
35 public final static String RESOURCEHISTORY_SHOW_FINDTOOLBAR = "resourcehistory_show_findtoolbar"; //$NON-NLS-1$
36 /** */
37 public final static String FINDTOOLBAR_IGNORE_CASE = "findtoolbar_ignore_case"; //$NON-NLS-1$
38 /** */
39 public final static String FINDTOOLBAR_COMMIT_ID = "findtoolbar_commit_id"; //$NON-NLS-1$
40 /** */
41 public final static String FINDTOOLBAR_COMMENTS = "findtoolbar_comments"; //$NON-NLS-1$
42 /** */
43 public final static String FINDTOOLBAR_AUTHOR = "findtoolbar_author"; //$NON-NLS-1$
44 /** */
45 public final static String FINDTOOLBAR_COMMITTER = "findtoolbar_committer"; //$NON-NLS-1$
46 /** */
47 public final static String FINDTOOLBAR_FIND_IN = "findtoolbar_find_in"; //$NON-NLS-1$
49 /** */
50 public final static String THEME_CommitGraphNormalFont = "org.eclipse.egit.ui.CommitGraphNormalFont"; //$NON-NLS-1$
51 /** */
52 public final static String THEME_CommitGraphHighlightFont = "org.eclipse.egit.ui.CommitGraphHighlightFont"; //$NON-NLS-1$
53 /** */
54 public final static String THEME_CommitMessageFont = "org.eclipse.egit.ui.CommitMessageFont"; //$NON-NLS-1$
55 /** */
56 public final static String THEME_UncommittedChangeForegroundColor = "org.eclipse.egit.ui.UncommittedChangeForegroundColor"; //$NON-NLS-1$
57 /** */
58 public final static String THEME_UncommittedChangeBackgroundColor = "org.eclipse.egit.ui.UncommittedChangeBackgroundColor"; //$NON-NLS-1$
59 /** */
60 public final static String THEME_UncommittedChangeFont = "org.eclipse.egit.ui.UncommittedChangeFont"; //$NON-NLS-1$
62 /** */
63 public final static String DECORATOR_RECOMPUTE_ANCESTORS = "decorator_recompute_ancestors"; //$NON-NLS-1$
64 /** */
65 public final static String DECORATOR_RECURSIVE_LIMIT = "decorator_recursive_limit"; //$NON-NLS-1$
66 /** */
67 public final static String DECORATOR_FILETEXT_DECORATION = "decorator_filetext_decoration"; //$NON-NLS-1$
68 /** */
69 public final static String DECORATOR_FOLDERTEXT_DECORATION = "decorator_foldertext_decoration"; //$NON-NLS-1$
70 /** */
71 public final static String DECORATOR_PROJECTTEXT_DECORATION = "decorator_projecttext_decoration"; //$NON-NLS-1$
72 /** */
73 public final static String DECORATOR_SHOW_TRACKED_ICON = "decorator_show_tracked_icon"; //$NON-NLS-1$
74 /** */
75 public final static String DECORATOR_SHOW_UNTRACKED_ICON = "decorator_show_untracked_icon"; //$NON-NLS-1$
76 /** */
77 public final static String DECORATOR_SHOW_STAGED_ICON = "decorator_show_staged_icon"; //$NON-NLS-1$
78 /** */
79 public final static String DECORATOR_SHOW_CONFLICTS_ICON = "decorator_show_conflicts_icon"; //$NON-NLS-1$
80 /** */
81 public final static String DECORATOR_SHOW_ASSUME_VALID_ICON = "decorator_show_assume_valid_icon"; //$NON-NLS-1$
83 /**
84 * Get the preference values associated with a fixed integer array.
86 * @param prefs
87 * the store to read.
88 * @param key
89 * key name.
90 * @param cnt
91 * number of entries in the returned array.
92 * @return the preference values for the array.
94 public static int[] getIntArray(final Preferences prefs, final String key,
95 final int cnt) {
96 final String s = prefs.getString(key);
97 final int[] r = new int[cnt];
98 if (s != null) {
99 final String[] e = s.split(","); //$NON-NLS-1$
100 for (int i = 0; i < Math.min(e.length, r.length); i++)
101 r[i] = Integer.parseInt(e[i].trim());
103 return r;
107 * Set the preference values associated with a fixed integer array.
109 * @param prefs
110 * the store to read.
111 * @param key
112 * key name.
113 * @param data
114 * entries to store.
116 public static void setValue(final Preferences prefs, final String key,
117 final int[] data) {
118 final StringBuilder s = new StringBuilder();
119 for (int i = 0; i < data.length; i++) {
120 if (i > 0)
121 s.append(',');
122 s.append(data[i]);
124 prefs.setValue(key, s.toString());
128 * Set the preference values associated with a fixed integer array.
130 * @param prefs
131 * the store to read.
132 * @param key
133 * key nam
134 * @param data
135 * entries to store.
137 public static void setDefault(final Preferences prefs, final String key,
138 final int[] data) {
139 final StringBuilder s = new StringBuilder();
140 for (int i = 0; i < data.length; i++) {
141 if (i > 0)
142 s.append(',');
143 s.append(data[i]);
145 prefs.setDefault(key, s.toString());