1 /*******************************************************************************
2 * Copyright (C) 2008, Roger C. Soares <rogersoares@intelinet.com.br>
3 * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
4 * Copyright (C) 2010, Mathias Kinzler <mathias.kinzler@sap.com>
5 * Copyright (C) 2012, Daniel Megert <daniel_megert@ch.ibm.com>
6 * Copyright (C) 2013, Robin Stocker <robin@nibor.org>
7 * Copyright (C) 2015, Jan-Ove Weichel <ovi.weichel@gmail.com>
8 * Copyright (C) 2015, SAP SE (Christian Georgi <christian.georgi@sap.com>)
9 * Copyright (C) 2016, Thomas Wolf <thomas.wolf@paranor.ch>
11 * All rights reserved. This program and the accompanying materials
12 * are made available under the terms of the Eclipse Public License 2.0
13 * which accompanies this distribution, and is available at
14 * https://www.eclipse.org/legal/epl-2.0/
16 * SPDX-License-Identifier: EPL-2.0
17 *******************************************************************************/
18 package org
.eclipse
.egit
.ui
;
20 import org
.eclipse
.core
.resources
.IMarker
;
21 import org
.eclipse
.core
.runtime
.preferences
.AbstractPreferenceInitializer
;
22 import org
.eclipse
.egit
.ui
.internal
.decorators
.GitLightweightDecorator
;
23 import org
.eclipse
.egit
.ui
.internal
.history
.FindToolbar
;
24 import org
.eclipse
.egit
.ui
.internal
.staging
.StagingView
;
25 import org
.eclipse
.jface
.preference
.IPreferenceStore
;
28 * Plugin extension point to initialize the plugin runtime preferences.
30 public class PluginPreferenceInitializer
extends AbstractPreferenceInitializer
{
33 public static final String COMMITTING_PREFERENCE_PAGE_WARN_BLOCK_ERRORS
= String
34 .valueOf(IMarker
.SEVERITY_ERROR
);
37 public static final String COMMITTING_PREFERENCE_PAGE_WARN_BLOCK_WARNINGS_AND_ERRORS
= String
38 .valueOf(IMarker
.SEVERITY_WARNING
);
41 * Calls super constructor.
43 public PluginPreferenceInitializer() {
48 * This method initializes the plugin preferences with default values.
51 public void initializeDefaultPreferences() {
52 IPreferenceStore store
= Activator
.getDefault().getPreferenceStore();
55 store
.setDefault(UIPreferences
.RESOURCEHISTORY_SHOW_RELATIVE_DATE
, true);
56 store
.setDefault(UIPreferences
.RESOURCEHISTORY_SHOW_EMAIL_ADDRESSES
, false);
57 store
.setDefault(UIPreferences
.RESOURCEHISTORY_SHOW_NOTES
, false);
58 store
.setDefault(UIPreferences
.RESOURCEHISTORY_SHOW_COMMENT_WRAP
, true);
59 store
.setDefault(UIPreferences
.RESOURCEHISTORY_SHOW_REV_DETAIL
, true);
60 store
.setDefault(UIPreferences
.RESOURCEHISTORY_SHOW_REV_COMMENT
, true);
61 store
.setDefault(UIPreferences
.RESOURCEHISTORY_SHOW_TOOLTIPS
, false);
62 store
.setDefault(UIPreferences
.RESOURCEHISTORY_SHOW_ALL_BRANCHES
, false);
63 store
.setDefault(UIPreferences
.RESOURCEHISTORY_SHOW_ADDITIONAL_REFS
,
65 store
.setDefault(UIPreferences
.RESOURCEHISTORY_FOLLOW_RENAMES
, true);
66 store
.setDefault(UIPreferences
.RESOURCEHISTORY_COMPARE_MODE
, true);
68 store
.setDefault(UIPreferences
.DECORATOR_RECOMPUTE_ANCESTORS
, true);
69 store
.setDefault(UIPreferences
.DECORATOR_FILETEXT_DECORATION
,
70 GitLightweightDecorator
.DecorationHelper
.FILE_FORMAT_DEFAULT
);
71 store
.setDefault(UIPreferences
.DECORATOR_FOLDERTEXT_DECORATION
,
72 GitLightweightDecorator
.DecorationHelper
.FOLDER_FORMAT_DEFAULT
);
73 store
.setDefault(UIPreferences
.DECORATOR_PROJECTTEXT_DECORATION
,
74 GitLightweightDecorator
.DecorationHelper
.PROJECT_FORMAT_DEFAULT
);
75 store
.setDefault(UIPreferences
.DECORATOR_SUBMODULETEXT_DECORATION
,
76 GitLightweightDecorator
.DecorationHelper
.SUBMODULE_FORMAT_DEFAULT
);
77 store
.setDefault(UIPreferences
.DECORATOR_SHOW_TRACKED_ICON
, true);
78 store
.setDefault(UIPreferences
.DECORATOR_SHOW_UNTRACKED_ICON
, true);
79 store
.setDefault(UIPreferences
.DECORATOR_SHOW_STAGED_ICON
, true);
80 store
.setDefault(UIPreferences
.DECORATOR_SHOW_CONFLICTS_ICON
, true);
81 store
.setDefault(UIPreferences
.DECORATOR_SHOW_ASSUME_UNCHANGED_ICON
, true);
82 store
.setDefault(UIPreferences
.DECORATOR_SHOW_DIRTY_ICON
, false);
83 store
.setDefault(UIPreferences
.WARN_BEFORE_COMMITTING
, false);
84 store
.setDefault(UIPreferences
.WARN_BEFORE_COMMITTING_LEVEL
,
85 COMMITTING_PREFERENCE_PAGE_WARN_BLOCK_ERRORS
);
86 store
.setDefault(UIPreferences
.BLOCK_COMMIT
, false);
87 store
.setDefault(UIPreferences
.BLOCK_COMMIT_LEVEL
,
88 COMMITTING_PREFERENCE_PAGE_WARN_BLOCK_ERRORS
);
90 w
= new int[] { 500, 500 };
91 store
.setDefault(UIPreferences
.RESOURCEHISTORY_GRAPH_SPLIT
, UIPreferences
.intArrayToString(w
));
92 w
= new int[] { 700, 300 };
93 store
.setDefault(UIPreferences
.RESOURCEHISTORY_REV_SPLIT
, UIPreferences
.intArrayToString(w
));
95 store
.setDefault(UIPreferences
.FINDTOOLBAR_IGNORE_CASE
, true);
96 store
.setDefault(UIPreferences
.FINDTOOLBAR_FIND_IN
,
97 FindToolbar
.PREFS_FINDIN_ALL
);
98 store
.setDefault(UIPreferences
.ALWAYS_USE_STAGING_VIEW
, true);
99 store
.setDefault(UIPreferences
.AUTO_STAGE_ON_COMMIT
, true);
100 store
.setDefault(UIPreferences
.COMMIT_DIALOG_HARD_WRAP_MESSAGE
, true);
101 store
.setDefault(UIPreferences
.COMMIT_DIALOG_WARN_ABOUT_MESSAGE_SECOND_LINE
, true);
102 store
.setDefault(UIPreferences
.COMMIT_DIALOG_SIGNED_OFF_BY
, false);
104 store
.setDefault(UIPreferences
.REFESH_INDEX_INTERVAL
, 5 * 60);
105 store
.setDefault(UIPreferences
.REFESH_ON_INDEX_CHANGE
, true);
106 store
.setDefault(UIPreferences
.REFESH_ONLY_WHEN_ACTIVE
, true);
108 store
.setDefault(UIPreferences
.SHOW_REBASE_CONFIRM
, true);
109 store
.setDefault(UIPreferences
.SHOW_INITIAL_CONFIG_DIALOG
, true);
110 store
.setDefault(UIPreferences
.SHOW_FETCH_POPUP_SUCCESS
, true);
111 store
.setDefault(UIPreferences
.SHOW_PUSH_POPUP_SUCCESS
, true);
112 store
.setDefault(UIPreferences
.SHOW_HOME_DIR_WARNING
, true);
113 store
.setDefault(UIPreferences
.LFS_AUTO_CONFIGURATION
, false);
114 store
.setDefault(UIPreferences
.SHOW_DETACHED_HEAD_WARNING
, true);
115 store
.setDefault(UIPreferences
.SHOW_CHECKOUT_CONFIRMATION
, true);
116 store
.setDefault(UIPreferences
.SHOW_RUNNING_LAUNCH_ON_CHECKOUT_WARNING
,
120 store
.setDefault(UIPreferences
.SYNC_VIEW_CHANGESET_LABEL_FORMAT
,
121 UIPreferences
.DEFAULT_CHANGESET_FORMAT
);
122 store
.setDefault(UIPreferences
.SYNC_VIEW_ALWAYS_SHOW_CHANGESET_MODEL
,
124 store
.setDefault(UIPreferences
.SYNC_VIEW_FETCH_BEFORE_LAUNCH
, true);
125 store
.setDefault(UIPreferences
.DATE_FORMAT
,
126 UIPreferences
.DEFAULT_DATE_FORMAT
);
127 store
.setDefault(UIPreferences
.DATE_FORMAT_CHOICE
,
128 UIPreferences
.DEFAULT_DATE_FORMAT_CHOICE
);
129 store
.setDefault(UIPreferences
.HISTORY_MAX_NUM_COMMITS
, 10000);
130 store
.setDefault(UIPreferences
.HISTORY_SHOW_BRANCH_SEQUENCE
, true);
131 store
.setDefault(UIPreferences
.HISTORY_SHOW_TAG_SEQUENCE
, false);
132 store
.setDefault(UIPreferences
.BLAME_IGNORE_WHITESPACE
, false);
133 store
.setDefault(UIPreferences
.REMOTE_CONNECTION_TIMEOUT
, 30 /* seconds */);
134 store
.setDefault(UIPreferences
.STAGING_VIEW_PRESENTATION
,
135 StagingView
.Presentation
.LIST
.name());
136 store
.setDefault(UIPreferences
.STAGING_VIEW_FILENAME_MODE
, true);
137 store
.setDefault(UIPreferences
.STAGING_VIEW_COMPARE_MODE
, true);
138 store
.setDefault(UIPreferences
.STAGING_VIEW_MAX_LIMIT_LIST_MODE
, 10000);
139 store
.setDefault(UIPreferences
.STAGING_VIEW_PRESENTATION_CHANGED
,
141 store
.setDefault(UIPreferences
.CLONE_WIZARD_STORE_SECURESTORE
, false);
142 store
.setDefault(UIPreferences
.COMMIT_DIALOG_HISTORY_SIZE
, 10);
143 store
.setDefault(UIPreferences
.CHECKOUT_PROJECT_RESTORE
, true);
144 store
.setDefault(UIPreferences
.HISTORY_MAX_TAG_LENGTH
, 18);
145 store
.setDefault(UIPreferences
.HISTORY_MAX_BRANCH_LENGTH
, 18);
146 store
.setDefault(UIPreferences
.HISTORY_MAX_DIFF_LINES
, 1000);
147 store
.setDefault(UIPreferences
.CLONE_WIZARD_SHOW_DETAILED_FAILURE_DIALOG
, true);
148 store
.setDefault(UIPreferences
.MERGE_MODE
, "2"); //$NON-NLS-1$
149 store
.setDefault(UIPreferences
.USE_LOGICAL_MODEL
, true);
151 store
.setDefault(UIPreferences
.REBASE_INTERACTIVE_SYNC_SELECTION
, true);
153 store
.setDefault(UIPreferences
.HISTORY_COLUMN_ID
, true);
154 store
.setDefault(UIPreferences
.HISTORY_COLUMN_AUTHOR
, true);
155 store
.setDefault(UIPreferences
.HISTORY_COLUMN_AUTHOR_DATE
, true);
156 store
.setDefault(UIPreferences
.HISTORY_COLUMN_COMMITTER
, true);
157 store
.setDefault(UIPreferences
.HISTORY_COLUMN_COMMITTER_DATE
, true);