1 8 package com.mountainminds.eclemma.internal.ui.dialogs; 9 10 import org.eclipse.jface.dialogs.MessageDialogWithToggle; 11 import org.eclipse.jface.preference.BooleanFieldEditor; 12 import org.eclipse.jface.preference.FieldEditorPreferencePage; 13 import org.eclipse.swt.SWT; 14 import org.eclipse.swt.widgets.Composite; 15 import org.eclipse.swt.widgets.Control; 16 import org.eclipse.swt.widgets.Label; 17 import org.eclipse.ui.IWorkbench; 18 import org.eclipse.ui.IWorkbenchPreferencePage; 19 import org.eclipse.ui.dialogs.PreferenceLinkArea; 20 import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer; 21 22 import com.mountainminds.eclemma.internal.ui.ContextHelp; 23 import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 24 import com.mountainminds.eclemma.internal.ui.UIMessages; 25 import com.mountainminds.eclemma.internal.ui.UIPreferences; 26 27 33 public class CoveragePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { 34 35 private static final String DECORATORS_PAGE = "org.eclipse.ui.preferencePages.Decorators"; private static final String ANNOTATIONS_PAGE = "org.eclipse.ui.editors.preferencePages.Annotations"; 38 public CoveragePreferencePage() { 39 super(GRID); 40 setDescription(UIMessages.CoveragePreferences_description); 41 setPreferenceStore(EclEmmaUIPlugin.getInstance().getPreferenceStore()); 42 } 43 44 public void createControl(Composite parent) { 45 super.createControl(parent); 46 ContextHelp.setHelp(getControl(), ContextHelp.COVERAGE_PREFERENCES); 47 } 48 49 protected Control createContents(Composite parent) { 50 parent = (Composite) super.createContents(parent); 51 new Label(parent, SWT.NONE); 52 new PreferenceLinkArea(parent, SWT.NONE, DECORATORS_PAGE, 53 UIMessages.CoveragePreferencesDecoratorsLink_label, 54 (IWorkbenchPreferenceContainer) getContainer(), null); 55 new PreferenceLinkArea(parent, SWT.NONE, ANNOTATIONS_PAGE, 56 UIMessages.CoveragePreferencesAnnotationsLink_label, 57 (IWorkbenchPreferenceContainer) getContainer(), null); 58 return parent; 59 } 60 61 protected void createFieldEditors() { 62 addField(new BooleanFieldEditor(UIPreferences.PREF_SHOW_COVERAGE_VIEW, 63 UIMessages.CoveragePreferencesShowCoverageView_label, 64 getFieldEditorParent())); 65 addField(new BooleanFieldEditor(UIPreferences.PREF_ACTICATE_NEW_SESSIONS, 66 UIMessages.CoveragePreferencesActivateNewSessions_label, 67 getFieldEditorParent())); 68 addField(new BooleanFieldEditor(UIPreferences.PREF_AUTO_REMOVE_SESSIONS, 69 UIMessages.CoveragePreferencesAutoRemoveSessions_label, 70 getFieldEditorParent())); 71 addField(new ToggleValueFieldEditor(UIPreferences.PREF_ALLOW_INPLACE_INSTRUMENTATION, 72 UIMessages.CoveragePreferencesShowInplaceWarning_label, 73 getFieldEditorParent(), 74 MessageDialogWithToggle.PROMPT, MessageDialogWithToggle.ALWAYS)); 75 } 76 77 public void init(IWorkbench workbench) { 78 } 80 81 } 82 | Popular Tags |