KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > ui > ComparePreferencePage


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.internal.ccvs.ui;
12
13 import org.eclipse.compare.CompareUI;
14 import org.eclipse.jface.preference.BooleanFieldEditor;
15 import org.eclipse.jface.preference.IPreferencePageContainer;
16 import org.eclipse.swt.widgets.Button;
17 import org.eclipse.swt.widgets.Composite;
18 import org.eclipse.team.internal.ui.SWTUtils;
19 import org.eclipse.ui.PlatformUI;
20 import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
21
22 /**
23  * Preference page for configuring CVS comparisons
24  */

25 public class ComparePreferencePage extends CVSFieldEditorPreferencePage {
26
27     /* (non-Javadoc)
28      * @see org.eclipse.team.internal.ccvs.ui.CVSFieldEditorPreferencePage#getPageHelpContextId()
29      */

30     protected String JavaDoc getPageHelpContextId() {
31         return IHelpContextIds.COMPARE_PREFERENCE_PAGE;
32     }
33
34     /* (non-Javadoc)
35      * @see org.eclipse.team.internal.ccvs.ui.CVSFieldEditorPreferencePage#getPageDescription()
36      */

37     protected String JavaDoc getPageDescription() {
38         return CVSUIMessages.ComparePreferencePage_0;
39     }
40
41     /* (non-Javadoc)
42      * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
43      */

44     protected void createFieldEditors() {
45         addField(new BooleanFieldEditor(
46                 ICVSUIConstants.PREF_CONSIDER_CONTENTS,
47                 CVSUIMessages.ComparePreferencePage_4,
48                 BooleanFieldEditor.DEFAULT,
49                 getFieldEditorParent()) {
50             protected Button getChangeControl(Composite parent) {
51                 Button button = super.getChangeControl(parent);
52                 PlatformUI.getWorkbench().getHelpSystem().setHelp(button, IHelpContextIds.PREF_CONSIDER_CONTENT);
53                 return button;
54             }
55         });
56         addField(new BooleanFieldEditor(
57                 ICVSUIConstants.PREF_SHOW_COMPARE_REVISION_IN_DIALOG,
58                 CVSUIMessages.ComparePreferencePage_3,
59                 BooleanFieldEditor.DEFAULT,
60                 getFieldEditorParent()));
61         addField(new BooleanFieldEditor(
62                 ICVSUIConstants.PREF_COMMIT_SET_DEFAULT_ENABLEMENT,
63                 CVSUIMessages.ComparePreferencePage_2,
64                 BooleanFieldEditor.DEFAULT,
65                 getFieldEditorParent()));
66         addField(new BooleanFieldEditor(
67                 ICVSUIConstants.PREF_ENABLE_MODEL_SYNC,
68                 CVSUIMessages.ComparePreferencePage_7,
69                 BooleanFieldEditor.DEFAULT,
70                 getFieldEditorParent()));
71         addField(new BooleanFieldEditor(
72                 ICVSUIConstants.PREF_OPEN_COMPARE_EDITOR_FOR_SINGLE_FILE,
73                 CVSUIMessages.ComparePreferencePage_8,
74                 BooleanFieldEditor.DEFAULT,
75                 getFieldEditorParent()));
76         
77         IPreferencePageContainer container = getContainer();
78         if (container instanceof IWorkbenchPreferenceContainer) {
79             IWorkbenchPreferenceContainer workbenchContainer = (IWorkbenchPreferenceContainer) container;
80             SWTUtils.createPreferenceLink(workbenchContainer, getFieldEditorParent(),
81                     CompareUI.PREFERENCE_PAGE_ID, CVSUIMessages.ComparePreferencePage_6); //
82
}
83     }
84     
85     /* (non-Javadoc)
86      * @see org.eclipse.team.internal.ccvs.ui.CVSFieldEditorPreferencePage#pushPreferences()
87      */

88     protected void pushPreferences() {
89         super.pushPreferences();
90     }
91 }
92
Popular Tags