Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2015-09-12 18:03:11 -0400
committerMatthias Sohn2015-09-13 17:18:11 -0400
commitdd2adb23465d983616ffe9ab121f4d78d32f984a (patch)
treef673591d5c18b5a88255a6f63ee4402e5956ef7f
parentb2055bf5822dceb006fad020d6fe5ea2042ec3d7 (diff)
downloadegit-dd2adb23465d983616ffe9ab121f4d78d32f984a.tar.gz
egit-dd2adb23465d983616ffe9ab121f4d78d32f984a.tar.xz
egit-dd2adb23465d983616ffe9ab121f4d78d32f984a.zip
Introduce new preference page for Staging view
Add new preference to configure the threshold for automatically disabling auto-expand and enabling compact tree mode if number of elements exceeds the threshold. Bug: 474064 Change-Id: Ief5d80004c03a76f046339818ee37b56fd70b5ae Signed-off-by: Andrey Loskutov <loskutov@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/plugin.properties1
-rw-r--r--org.eclipse.egit.ui/plugin.xml9
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/StagingViewPreferencePage.java52
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties3
5 files changed, 71 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/plugin.properties b/org.eclipse.egit.ui/plugin.properties
index 2cb645d70..0483621cb 100644
--- a/org.eclipse.egit.ui/plugin.properties
+++ b/org.eclipse.egit.ui/plugin.properties
@@ -115,6 +115,7 @@ GitPreferences_name=Git
GitPreferences_WindowCachePreferencePage_name=Window Cache
GitPreferences_DecoratorPreferencePage_name=Label Decorations
GitPreferences_CommittingPreferencePage_name=Committing
+GitPreferences_StagingViewPreferencePage_name=Staging View
GitPreferences_ProjectPreferencePage_name=Projects
ShareProjectCommand_name=Share with Git
diff --git a/org.eclipse.egit.ui/plugin.xml b/org.eclipse.egit.ui/plugin.xml
index 2c7a9bd00..41e72d425 100644
--- a/org.eclipse.egit.ui/plugin.xml
+++ b/org.eclipse.egit.ui/plugin.xml
@@ -462,6 +462,15 @@
</page>
<page
category="org.eclipse.egit.ui.GitPreferences"
+ class="org.eclipse.egit.ui.internal.preferences.StagingViewPreferencePage"
+ id="org.eclipse.egit.ui.internal.preferences.StagingViewPreferencePage"
+ name="%GitPreferences_StagingViewPreferencePage_name">
+ <keywordReference
+ id="org.eclipse.egit.ui.keyword.git">
+ </keywordReference>
+ </page>
+ <page
+ category="org.eclipse.egit.ui.GitPreferences"
class="org.eclipse.egit.ui.internal.preferences.DialogsPreferencePage"
id="org.eclipse.egit.ui.internal.preferences.DialogsPreferencePage"
name="%DialogsPreferencePage.name">
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
index 168d2829f..3297a2952 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
@@ -5411,6 +5411,12 @@ public class UIText extends NLS {
/** */
public static String DiffStyleRangeFormatter_diffTruncated;
+ /** */
+ public static String StagingViewPreferencePage_title;
+
+ /** */
+ public static String StagingViewPreferencePage_maxLimitListMode;
+
static {
initializeMessages(BUNDLE_NAME, UIText.class);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/StagingViewPreferencePage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/StagingViewPreferencePage.java
new file mode 100644
index 000000000..9a207a0d4
--- /dev/null
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/StagingViewPreferencePage.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (C) 2015 Andrey Loskutov <loskutov@gmx.de>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.ui.internal.preferences;
+
+import org.eclipse.egit.ui.Activator;
+import org.eclipse.egit.ui.UIPreferences;
+import org.eclipse.egit.ui.internal.UIText;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/** Preferences for committing with commit dialog/staging view. */
+public class StagingViewPreferencePage extends FieldEditorPreferencePage
+ implements IWorkbenchPreferencePage {
+
+ /** */
+ public StagingViewPreferencePage() {
+ super(GRID);
+ setTitle(UIText.StagingViewPreferencePage_title);
+ }
+
+ @Override
+ public void init(IWorkbench workbench) {
+ // Nothing to do
+ }
+
+ @Override
+ protected IPreferenceStore doGetPreferenceStore() {
+ return Activator.getDefault().getPreferenceStore();
+ }
+
+ @Override
+ protected void createFieldEditors() {
+ Composite main = getFieldEditorParent();
+
+ IntegerFieldEditor historySize = new IntegerFieldEditor(
+ UIPreferences.STAGING_VIEW_MAX_LIMIT_LIST_MODE,
+ UIText.StagingViewPreferencePage_maxLimitListMode, main);
+ addField(historySize);
+ }
+
+
+}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties
index 58f413731..3f9f3c45f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties
@@ -1900,3 +1900,6 @@ PushMenu_PushHEAD=Push &HEAD...
PushMenu_PushBranch=Push &Branch ''{0}''...
DiffStyleRangeFormatter_diffTruncated=[...] diff truncated after {0} lines.
+
+StagingViewPreferencePage_title=Staging View
+StagingViewPreferencePage_maxLimitListMode=Switch to compact mode if files number exceeds:

Back to the top