Have icon for "reset" entry in reflog
[egit/eclipse.git] / org.eclipse.egit.ui / src / org / eclipse / egit / ui / internal / preferences / ProjectsPreferencePage.java
blobabe08032585a375e8b2a937fe9e7a5febae24132
1 /*******************************************************************************
2 * Copyright (C) 2011, 2017 Matthias Sohn <matthias.sohn@sap.com> and others
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
9 * SPDX-License-Identifier: EPL-2.0
11 * Contributors:
12 * Thomas Wolf <thomas.wolf@paranor.ch> - Bug 498548
13 *******************************************************************************/
14 package org.eclipse.egit.ui.internal.preferences;
16 import org.eclipse.core.runtime.preferences.InstanceScope;
17 import org.eclipse.egit.core.Activator;
18 import org.eclipse.egit.core.GitCorePreferences;
19 import org.eclipse.egit.ui.UIPreferences;
20 import org.eclipse.egit.ui.internal.UIText;
21 import org.eclipse.jface.preference.BooleanFieldEditor;
22 import org.eclipse.jface.preference.IPreferenceStore;
23 import org.eclipse.ui.IWorkbench;
24 import org.eclipse.ui.IWorkbenchPreferencePage;
25 import org.eclipse.ui.preferences.ScopedPreferenceStore;
27 /** Preference page for project preferences */
28 public class ProjectsPreferencePage extends DoublePreferencesPreferencePage
29 implements IWorkbenchPreferencePage {
31 /**
32 * The default constructor
34 public ProjectsPreferencePage() {
35 super(GRID);
38 @Override
39 protected IPreferenceStore doGetPreferenceStore() {
40 return new ScopedPreferenceStore(InstanceScope.INSTANCE,
41 Activator.getPluginId());
44 @Override
45 protected IPreferenceStore doGetSecondaryPreferenceStore() {
46 return org.eclipse.egit.ui.Activator.getDefault().getPreferenceStore();
49 @Override
50 public void init(final IWorkbench workbench) {
51 // Do nothing.
54 @Override
55 protected void createFieldEditors() {
56 addField(new BooleanFieldEditor(GitCorePreferences.core_autoShareProjects,
57 UIText.ProjectsPreferencePage_AutoShareProjects,
58 getFieldEditorParent()));
59 addField(new BooleanFieldEditor(UIPreferences.CHECKOUT_PROJECT_RESTORE,
60 UIText.ProjectsPreferencePage_RestoreBranchProjects,
61 getFieldEditorParent()) {
62 @Override
63 public IPreferenceStore getPreferenceStore() {
64 return getSecondaryPreferenceStore();
66 });
67 addField(new BooleanFieldEditor(
68 GitCorePreferences.core_autoIgnoreDerivedResources,
69 UIText.ProjectsPreferencePage_AutoIgnoreDerivedResources,
70 getFieldEditorParent()));