1 11 package org.eclipse.team.internal.ccvs.ui; 12 13 import org.eclipse.jface.dialogs.Dialog; 14 import org.eclipse.jface.preference.FieldEditorPreferencePage; 15 import org.eclipse.jface.preference.IPreferenceStore; 16 import org.eclipse.swt.widgets.Composite; 17 import org.eclipse.swt.widgets.Control; 18 import org.eclipse.ui.*; 19 20 24 public abstract class CVSFieldEditorPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { 25 26 public static IPreferenceStore getCVSPreferenceStore() { 27 return CVSUIPlugin.getPlugin().getPreferenceStore(); 28 } 29 30 33 public CVSFieldEditorPreferencePage() { 34 super(GRID); 35 setPreferenceStore(getCVSPreferenceStore()); 36 String description = getPageDescription(); 37 if (description != null) 38 setDescription(description); 39 } 40 41 44 protected Control createContents(Composite parent) { 45 Control control = super.createContents(parent); 46 String id = getPageHelpContextId(); 47 if (id != null) 48 PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), id); 49 Dialog.applyDialogFont(control); 50 return control; 51 } 52 53 56 public void init(IWorkbench workbench) { 57 } 58 59 65 protected abstract String getPageHelpContextId(); 66 67 72 protected abstract String getPageDescription(); 73 74 77 public boolean performOk() { 78 if (!super.performOk()) return false; 79 pushPreferences(); 80 return true; 81 } 82 83 86 protected void pushPreferences() { 87 } 89 90 } 91 | Popular Tags |