Better align repository hyperlink in commit viewer
[egit/eclipse.git] / org.eclipse.egit.ui / src / org / eclipse / egit / ui / UIPreferences.java
blob96d582f19719e756b7bd6d9434c1b0b752797ae2
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>
5 * Copyright (C) 2010, Mathias Kinzler <mathias.kinzler@sap.com>
6 * Copyright (C) 2012, Daniel Megert <daniel_megert@ch.ibm.com>
7 * Copyright (C) 2013, Tobias Pfeifer <to.pfeifer@sap.com>
8 * Copyright (C) 2014, Marc Khouzam <marc.khouzam@ericsson.com>
9 * Copyright (C) 2015, Jan-Ove Weichel <ovi.weichel@gmail.com>
10 * Copyright (C) 2015, SAP SE (Christian Georgi <christian.georgi@sap.com>)
11 * Copyright (C) 2016, Thomas Wolf <thomas.wolf@paranor.ch>
13 * All rights reserved. This program and the accompanying materials
14 * are made available under the terms of the Eclipse Public License v1.0
15 * which accompanies this distribution, and is available at
16 * http://www.eclipse.org/legal/epl-v10.html
17 *******************************************************************************/
18 package org.eclipse.egit.ui;
20 /**
21 * Preferences used by the EGit UI plug-in.
22 * <p>
23 * All plug-in preferences shall be referenced by a constant in this class.
25 public class UIPreferences {
26 /** */
27 public final static String RESOURCEHISTORY_SHOW_RELATIVE_DATE = "resourcehistory_show_relative_date"; //$NON-NLS-1$
28 /** */
29 public final static String RESOURCEHISTORY_SHOW_EMAIL_ADDRESSES = "resourcehistory_show_email_addresses"; //$NON-NLS-1$
30 /** */
31 public final static String RESOURCEHISTORY_SHOW_NOTES = "resourcehistory_show_notes"; //$NON-NLS-1$
32 /** */
33 public final static String RESOURCEHISTORY_SHOW_COMMENT_WRAP = "resourcehistory_show_comment_wrap"; //$NON-NLS-1$
34 /** */
35 public static final String RESOURCEHISTORY_SHOW_COMMENT_FILL = "resourcehistory_fill_comment_paragraph"; //$NON-NLS-1$
36 /** */
37 public final static String RESOURCEHISTORY_SHOW_REV_DETAIL = "resourcehistory_show_rev_detail"; //$NON-NLS-1$
38 /** */
39 public final static String RESOURCEHISTORY_SHOW_REV_COMMENT = "resourcehistory_show_rev_comment"; //$NON-NLS-1$
40 /** */
41 public final static String RESOURCEHISTORY_GRAPH_SPLIT = "resourcehistory_graph_split"; //$NON-NLS-1$
42 /** */
43 public final static String RESOURCEHISTORY_REV_SPLIT = "resourcehistory_rev_split"; //$NON-NLS-1$
44 /** */
45 public final static String RESOURCEHISTORY_SHOW_TOOLTIPS = "resourcehistory_show_tooltips"; //$NON-NLS-1$
46 /** */
47 public final static String RESOURCEHISTORY_SHOW_FINDTOOLBAR = "resourcehistory_show_findtoolbar"; //$NON-NLS-1$
48 /** */
49 public final static String RESOURCEHISTORY_SHOW_ALL_BRANCHES = "resourcehistory_show_all_branches"; //$NON-NLS-1$
50 /** */
51 public final static String RESOURCEHISTORY_SHOW_ADDITIONAL_REFS = "resourcehistory_show_additionalrefs"; //$NON-NLS-1$
52 /** */
53 public static final String RESOURCEHISTORY_FOLLOW_RENAMES = "resourcehistory_follow_renames"; //$NON-NLS-1$
54 /** */
55 public final static String RESOURCEHISTORY_COMPARE_MODE = "resourcehistory_compare_mode"; //$NON-NLS-1$
56 /** */
57 public final static String FINDTOOLBAR_IGNORE_CASE = "findtoolbar_ignore_case"; //$NON-NLS-1$
58 /** */
59 public final static String FINDTOOLBAR_COMMIT_ID = "findtoolbar_commit_id"; //$NON-NLS-1$
60 /** */
61 public final static String FINDTOOLBAR_COMMENTS = "findtoolbar_comments"; //$NON-NLS-1$
62 /** */
63 public final static String FINDTOOLBAR_AUTHOR = "findtoolbar_author"; //$NON-NLS-1$
64 /** */
65 public final static String FINDTOOLBAR_COMMITTER = "findtoolbar_committer"; //$NON-NLS-1$
66 /** */
67 public final static String FINDTOOLBAR_FIND_IN = "findtoolbar_find_in"; //$NON-NLS-1$
68 /** */
69 public final static String COMMIT_DIALOG_HARD_WRAP_MESSAGE = "commit_dialog_hard_wrap_message"; //$NON-NLS-1$
70 /** */
71 public final static String ALWAYS_USE_STAGING_VIEW = "always_use_staging_view"; //$NON-NLS-1$
72 /** */
73 public final static String AUTO_STAGE_ON_COMMIT = "auto_stage_on_commit"; //$NON-NLS-1$
74 /** */
75 public final static String COMMIT_DIALOG_WARN_ABOUT_MESSAGE_SECOND_LINE = "commit_dialog_warn_about_message_second_line"; //$NON-NLS-1$
76 /** */
77 public final static String COMMIT_DIALOG_SIGNED_OFF_BY = "commit_dialog_signed_off_by"; //$NON-NLS-1$
78 /** */
79 public final static String COMMIT_DIALOG_HISTORY_SIZE = "commit_dialog_history_size"; //$NON-NLS-1$
80 /** */
81 public final static String COMMIT_DIALOG_HISTORY_MESSAGES = "commit_dialog_history_messages"; //$NON-NLS-1$
82 /** */
83 public final static String COMMIT_DIALOG_INCLUDE_UNTRACKED = "commit_dialog_include_untracked"; //$NON-NLS-1$
84 /** */
85 public final static String CHECKOUT_PROJECT_RESTORE = "restore_projects_on_checkout"; //$NON-NLS-1$
86 /** */
87 public final static String THEME_CommitGraphNormalFont = "org.eclipse.egit.ui.CommitGraphNormalFont"; //$NON-NLS-1$
88 /** */
89 public final static String THEME_CommitGraphHighlightFont = "org.eclipse.egit.ui.CommitGraphHighlightFont"; //$NON-NLS-1$
90 /** */
91 public final static String THEME_CommitMessageFont = "org.eclipse.egit.ui.CommitMessageFont"; //$NON-NLS-1$
92 /** */
93 public final static String THEME_CommitMessageEditorFont = "org.eclipse.egit.ui.CommitMessageEditorFont"; //$NON-NLS-1$
94 /** */
95 public final static String THEME_UncommittedChangeForegroundColor = "org.eclipse.egit.ui.UncommittedChangeForegroundColor"; //$NON-NLS-1$
96 /** */
97 public final static String THEME_UncommittedChangeBackgroundColor = "org.eclipse.egit.ui.UncommittedChangeBackgroundColor"; //$NON-NLS-1$
98 /** */
99 public final static String THEME_UncommittedChangeFont = "org.eclipse.egit.ui.UncommittedChangeFont"; //$NON-NLS-1$
100 /** */
101 public final static String THEME_DiffHunkBackgroundColor = "org.eclipse.egit.ui.DiffHunkBackgroundColor"; //$NON-NLS-1$
102 /** */
103 public final static String THEME_DiffHunkForegroundColor = "org.eclipse.egit.ui.DiffHunkForegroundColor"; //$NON-NLS-1$
104 /** */
105 public final static String THEME_DiffHeadlineBackgroundColor = "org.eclipse.egit.ui.DiffHeadlineBackgroundColor"; //$NON-NLS-1$
106 /** */
107 public final static String THEME_DiffHeadlineForegroundColor = "org.eclipse.egit.ui.DiffHeadlineForegroundColor"; //$NON-NLS-1$
108 /** */
109 public final static String THEME_DiffHeadlineFont = "org.eclipse.egit.ui.DiffHeadlineFont"; //$NON-NLS-1$
110 /** */
111 public final static String THEME_DiffAddBackgroundColor = "org.eclipse.egit.ui.DiffAddBackgroundColor"; //$NON-NLS-1$
112 /** */
113 public final static String THEME_DiffAddForegroundColor = "org.eclipse.egit.ui.DiffAddForegroundColor"; //$NON-NLS-1$
114 /** */
115 public final static String THEME_DiffRemoveBackgroundColor = "org.eclipse.egit.ui.DiffRemoveBackgroundColor"; //$NON-NLS-1$
116 /** */
117 public final static String THEME_DiffRemoveForegroundColor = "org.eclipse.egit.ui.DiffRemoveForegroundColor"; //$NON-NLS-1$
118 /** */
119 public final static String THEME_IgnoredResourceForegroundColor = "org.eclipse.egit.ui.IgnoredResourceForegroundColor"; //$NON-NLS-1$
120 /** */
121 public final static String THEME_IgnoredResourceBackgroundColor = "org.eclipse.egit.ui.IgnoredResourceBackgroundColor"; //$NON-NLS-1$
122 /** */
123 public final static String THEME_IgnoredResourceFont = "org.eclipse.egit.ui.IgnoredResourceFont"; //$NON-NLS-1$
124 /** */
125 public final static String DECORATOR_RECOMPUTE_ANCESTORS = "decorator_recompute_ancestors"; //$NON-NLS-1$
126 /** */
127 public final static String DECORATOR_FILETEXT_DECORATION = "decorator_filetext_decoration"; //$NON-NLS-1$
128 /** */
129 public final static String DECORATOR_FOLDERTEXT_DECORATION = "decorator_foldertext_decoration"; //$NON-NLS-1$
130 /** */
131 public final static String DECORATOR_PROJECTTEXT_DECORATION = "decorator_projecttext_decoration"; //$NON-NLS-1$
132 /** */
133 public final static String DECORATOR_SUBMODULETEXT_DECORATION = "decorator_submoduletext_decoration"; //$NON-NLS-1$
134 /** */
135 public final static String DECORATOR_SHOW_TRACKED_ICON = "decorator_show_tracked_icon"; //$NON-NLS-1$
136 /** */
137 public final static String DECORATOR_SHOW_UNTRACKED_ICON = "decorator_show_untracked_icon"; //$NON-NLS-1$
138 /** */
139 public final static String DECORATOR_SHOW_STAGED_ICON = "decorator_show_staged_icon"; //$NON-NLS-1$
140 /** */
141 public final static String DECORATOR_SHOW_CONFLICTS_ICON = "decorator_show_conflicts_icon"; //$NON-NLS-1$
142 /** */
143 public final static String DECORATOR_SHOW_ASSUME_UNCHANGED_ICON = "decorator_show_assume_valid_icon"; //$NON-NLS-1$
144 /** */
145 public final static String DECORATOR_SHOW_DIRTY_ICON = "decorator_show_dirty_icon"; //$NON-NLS-1$
146 /** */
147 public final static String SYNC_VIEW_CHANGESET_LABEL_FORMAT = "sync_view_changeset_pattern"; //$NON-NLS-1$
148 /** */
149 public final static String SYNC_VIEW_ALWAYS_SHOW_CHANGESET_MODEL = "sync_view_show_changeset_model"; //$NON-NLS-1$
150 /** */
151 public final static String SYNC_VIEW_LAST_SELECTED_MODEL = "sync_view_last_selected_model"; //$NON-NLS-1$
152 /** */
153 public static final String SYNC_VIEW_FETCH_BEFORE_LAUNCH = "sync_view_fetch_before_launch"; //$NON-NLS-1$
154 /** */
155 public final static String DATE_FORMAT = "date_format"; //$NON-NLS-1$
156 /** */
157 public final static String DATE_FORMAT_CHOICE = "date_format_choice"; //$NON-NLS-1$
158 /** */
159 public static final String DATE_FORMAT_CUSTOM = "CUSTOM"; //$NON-NLS-1$
160 /** */
161 public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; //$NON-NLS-1$
162 /** */
163 public static final String DEFAULT_DATE_FORMAT_CHOICE = DATE_FORMAT_CUSTOM;
164 /** */
165 public static final String DEFAULT_CHANGESET_FORMAT = "[{author}] ({date}) {short_message}"; //$NON-NLS-1$
167 /** interval in seconds to check for repositories index changes */
168 public static final String REFESH_INDEX_INTERVAL = "refesh_index_interval"; //$NON-NLS-1$
169 /** */
170 public static final String REFESH_ON_INDEX_CHANGE = "refesh_on_index_change"; //$NON-NLS-1$
171 /** */
172 public static final String REFESH_ONLY_WHEN_ACTIVE = "refesh_only_when_active"; //$NON-NLS-1$
173 /** */
174 public static final String REMOTE_CONNECTION_TIMEOUT = "remote_connection_timeout"; //$NON-NLS-1$
176 /** Holds true if the logical model should be used. */
177 public static final String USE_LOGICAL_MODEL = "enable_logical_model"; //$NON-NLS-1$
179 /** */
180 public static final String MERGE_MODE = "merge_mode"; //$NON-NLS-1$
181 /** */
182 public static final String SHOW_REBASE_CONFIRM = "show_rebase_confirm"; //$NON-NLS-1$
183 /** */
184 public static final String SHOW_INITIAL_CONFIG_DIALOG = "show_initial_config_dialog"; //$NON-NLS-1$
185 /** */
186 public static final String SHOW_FETCH_POPUP_SUCCESS = "show_fetch_success_dialog"; //$NON-NLS-1$
187 /** */
188 public static final String SHOW_PUSH_POPUP_SUCCESS = "show_push_success_dialog"; //$NON-NLS-1$
189 /** */
190 public static final String SHOW_HOME_DIR_WARNING = "show_home_drive_warning"; //$NON-NLS-1$
191 /** */
192 public static final String SHOW_DETACHED_HEAD_WARNING = "show_detached_head_warning"; //$NON-NLS-1$
193 /** */
194 public static final String SHOW_CHECKOUT_CONFIRMATION = "show_checkout_confirmation"; //$NON-NLS-1$
195 /** */
196 public static final String SHOW_RUNNING_LAUNCH_ON_CHECKOUT_WARNING = "show_running_launch_on_checkout_warning"; //$NON-NLS-1$
198 /** */
199 public static final String TREE_COMPARE_SHOW_EQUALS = "CompareTreeView_ShowEquals"; //$NON-NLS-1$
200 /** */
201 public static final String TREE_COMPARE_COMPARE_MODE = "CompareTreeView_compare_mode"; //$NON-NLS-1$
203 /** */
204 public static final String HISTORY_MAX_NUM_COMMITS = "HistoryView_MaxNumberOfCommmits"; //$NON-NLS-1$
205 /** */
206 public static final String HISTORY_MAX_TAG_LENGTH = "HistoryView_MaxTagLength"; //$NON-NLS-1$
207 /** */
208 public static final String HISTORY_MAX_BRANCH_LENGTH = "HistoryView_MaxBranchLength"; //$NON-NLS-1$
209 /** */
210 public static final String HISTORY_MAX_DIFF_LINES = "HistoryView_MaxDiffLines"; //$NON-NLS-1$
212 /** */
213 public static final String HISTORY_CUT_AT_START = "HistoryView_CutAtStart"; //$NON-NLS-1$
214 /** */
215 public static final String HISTORY_SHOW_TAG_SEQUENCE = "HistoryView_ShowTagSequence"; //$NON-NLS-1$
216 /** */
217 public static final String HISTORY_SHOW_BRANCH_SEQUENCE = "HistoryView_ShowBranchSequence"; //$NON-NLS-1$
218 /** */
219 public static final String STAGING_VIEW_SHOW_NEW_COMMITS = "StagingView_ShowNewCommits"; //$NON-NLS-1$
220 /** */
221 public static final String STAGING_VIEW_COLUMN_LAYOUT = "StagingView_ColumnLayout"; //$NON-NLS-1$
222 /** */
223 public static final String STAGING_VIEW_SYNC_SELECTION = "StagingView_SyncWithSelection"; //$NON-NLS-1$
224 /** */
225 public static final String STAGING_VIEW_COMPARE_MODE = "StagingView_CompareMode"; //$NON-NLS-1$
226 /** */
227 public static final String STAGING_VIEW_FILENAME_MODE = "StagingView_FileNameMode"; //$NON-NLS-1$
228 /** */
229 public static final String STAGING_VIEW_PRESENTATION = "StagingView_Presentation"; //$NON-NLS-1$
231 /** max number of files in the view to allow for the list mode */
232 public static final String STAGING_VIEW_MAX_LIMIT_LIST_MODE = "StagingView_MaxLimitListMode"; //$NON-NLS-1$
235 * List presentation mode was automatically switched to faster mode
237 public static final String STAGING_VIEW_PRESENTATION_CHANGED = "StagingView_Presentation_Changed"; //$NON-NLS-1$
238 /** */
239 public static final String PAGE_COMMIT_PREFERENCES = "org.eclipse.egit.ui.internal.preferences.CommitDialogPreferencePage"; //$NON-NLS-1$
240 /** */
241 public static final String BLAME_IGNORE_WHITESPACE = "Blame_IgnoreWhitespace"; //$NON-NLS-1$
242 /** */
243 public static final String CLONE_WIZARD_STORE_SECURESTORE = "CloneWizard_StoreInSecureStore"; //$NON-NLS-1$
244 /** */
245 public static final String CLONE_WIZARD_IMPORT_PROJECTS = "CloneWizard_ImportProjects"; //$NON-NLS-1$
246 /** */
247 public static final String CLONE_WIZARD_SHOW_DETAILED_FAILURE_DIALOG = "CloneWizard_ShowDetailedFailureDialog"; //$NON-NLS-1$
248 /** */
249 public final static String REBASE_INTERACTIVE_ORDER_REVERSE = "rebase_interactive_order_reverse"; //$NON-NLS-1$
250 /** */
251 public static final String REBASE_INTERACTIVE_SYNC_SELECTION = "RebaseInteractive_SyncWithSelection"; //$NON-NLS-1$
253 /** */
254 public static final String WARN_BEFORE_COMMITTING = "checkBeforeCommitting"; //$NON-NLS-1$
256 /** */
257 public static final String WARN_BEFORE_COMMITTING_LEVEL = "warnBeforeCommitting"; //$NON-NLS-1$
259 /** */
260 public static final String BLOCK_COMMIT = "blockCommit"; //$NON-NLS-1$
262 /** */
263 public static final String BLOCK_COMMIT_LEVEL = "blockCommitCombo"; //$NON-NLS-1$
266 * Converts a persisted String separated with commas to an integer array
268 * @param value
269 * the String value
270 * @param cnt
271 * number of entries in the returned array
272 * @return the preference values for the array, or null if the string cannot
273 * be parsed or doesn't have {@code cnt} elements, or any value is
274 * <= 0.
276 public static int[] stringToIntArray(final String value, final int cnt) {
277 if (value == null) {
278 return null;
280 final String[] values = value.split(","); //$NON-NLS-1$
281 if (values.length != cnt) {
282 return null;
284 final int[] r = new int[cnt];
285 for (int i = 0; i < values.length; i++) {
286 try {
287 int val = Integer.parseInt(values[i].trim());
288 if (val <= 0) {
289 return null;
291 r[i] = val;
292 } catch (NumberFormatException e) {
293 return null;
296 return r;
300 * Converts an integer array into a String separated by commas
302 * @param data
303 * integers to store
304 * @return the String
306 public static String intArrayToString(final int[] data) {
307 final StringBuilder s = new StringBuilder();
308 for (int i = 0; i < data.length; i++) {
309 if (i > 0)
310 s.append(',');
311 s.append(data[i]);
313 return s.toString();