Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 58c2474f7a10deeddc392dd378c2d5268eede8a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*******************************************************************************
 * Copyright (c) 2000, 2005 IBM Corporation and others.
 * 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
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.team.internal.ccvs.ui;

import org.eclipse.compare.CompareUI;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.IPreferencePageContainer;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.team.internal.ui.SWTUtils;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;

/**
 * Preference page for configuring CVS comparisons
 */
public class ComparePreferencePage extends CVSFieldEditorPreferencePage {

    /* (non-Javadoc)
     * @see org.eclipse.team.internal.ccvs.ui.CVSFieldEditorPreferencePage#getPageHelpContextId()
     */
    protected String getPageHelpContextId() {
        return IHelpContextIds.COMPARE_PREFERENCE_PAGE;
    }

    /* (non-Javadoc)
     * @see org.eclipse.team.internal.ccvs.ui.CVSFieldEditorPreferencePage#getPageDescription()
     */
    protected String getPageDescription() {
        return CVSUIMessages.ComparePreferencePage_0; //$NON-NLS-1$
    }

    /* (non-Javadoc)
     * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
     */
    protected void createFieldEditors() {
		addField(new BooleanFieldEditor(
		        ICVSUIConstants.PREF_CONSIDER_CONTENTS, 
				CVSUIMessages.ComparePreferencePage_4,  //$NON-NLS-1$
				BooleanFieldEditor.DEFAULT, 
				getFieldEditorParent()) {
            protected Button getChangeControl(Composite parent) {
                Button button = super.getChangeControl(parent);
                WorkbenchHelp.setHelp(button, IHelpContextIds.PREF_CONSIDER_CONTENT);
                return button;
            }
		});
		addField(new BooleanFieldEditor(
		        ICVSUIConstants.PREF_SHOW_COMPARE_REVISION_IN_DIALOG, 
		        CVSUIMessages.ComparePreferencePage_3,  //$NON-NLS-1$
				BooleanFieldEditor.DEFAULT, 
				getFieldEditorParent()));
		addField(new BooleanFieldEditor(
		        ICVSUIConstants.PREF_SHOW_AUTHOR_IN_EDITOR, 
		        CVSUIMessages.ComparePreferencePage_1, //$NON-NLS-1$
				BooleanFieldEditor.DEFAULT, 
				getFieldEditorParent()));
		addField(new BooleanFieldEditor(
		        ICVSUIConstants.PREF_COMMIT_SET_DEFAULT_ENABLEMENT, 
		        CVSUIMessages.ComparePreferencePage_2, //$NON-NLS-1$
				BooleanFieldEditor.DEFAULT, 
				getFieldEditorParent()));
        
        IPreferencePageContainer container = getContainer();
        if (container instanceof IWorkbenchPreferenceContainer) {
            IWorkbenchPreferenceContainer workbenchContainer = (IWorkbenchPreferenceContainer) container;
            SWTUtils.createPreferenceLink(workbenchContainer, getFieldEditorParent(),
                    CompareUI.PREFERENCE_PAGE_ID, CVSUIMessages.ComparePreferencePage_6); //$NON-NLS-1$ //$NON-NLS-2$
        }
    }
    
    /* (non-Javadoc)
     * @see org.eclipse.team.internal.ccvs.ui.CVSFieldEditorPreferencePage#pushPreferences()
     */
    protected void pushPreferences() {
        super.pushPreferences();
    }
}

Back to the top