1 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 25 public class ComparePreferencePage extends CVSFieldEditorPreferencePage { 26 27 30 protected String getPageHelpContextId() { 31 return IHelpContextIds.COMPARE_PREFERENCE_PAGE; 32 } 33 34 37 protected String getPageDescription() { 38 return CVSUIMessages.ComparePreferencePage_0; 39 } 40 41 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); } 83 } 84 85 88 protected void pushPreferences() { 89 super.pushPreferences(); 90 } 91 } 92 | Popular Tags |