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
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
{
32 * The default constructor
34 public ProjectsPreferencePage() {
39 protected IPreferenceStore
doGetPreferenceStore() {
40 return new ScopedPreferenceStore(InstanceScope
.INSTANCE
,
41 Activator
.getPluginId());
45 protected IPreferenceStore
doGetSecondaryPreferenceStore() {
46 return org
.eclipse
.egit
.ui
.Activator
.getDefault().getPreferenceStore();
50 public void init(final IWorkbench workbench
) {
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()) {
63 public IPreferenceStore
getPreferenceStore() {
64 return getSecondaryPreferenceStore();
67 addField(new BooleanFieldEditor(
68 GitCorePreferences
.core_autoIgnoreDerivedResources
,
69 UIText
.ProjectsPreferencePage_AutoIgnoreDerivedResources
,
70 getFieldEditorParent()));