1 24 package org.objectweb.dolphin.preferences; 25 26 import org.eclipse.jface.preference.*; 27 import org.eclipse.ui.IWorkbenchPreferencePage; 28 import org.eclipse.ui.IWorkbench; 29 import org.objectweb.dolphin.DolphinPlugin; 30 31 44 45 public class SamplePreferencePage 46 extends FieldEditorPreferencePage 47 implements IWorkbenchPreferencePage { 48 49 52 public SamplePreferencePage() { 53 super(GRID); 54 setPreferenceStore(DolphinPlugin.getDefault().getPreferenceStore()); 55 setDescription("A demonstration of a preference page implementation"); 56 } 57 58 64 public void createFieldEditors() { 65 addField(new DirectoryFieldEditor(PreferenceConstants.P_PATH, 66 "&Directory preference:", getFieldEditorParent())); 67 addField( 68 new BooleanFieldEditor( 69 PreferenceConstants.P_BOOLEAN, 70 "&An example of a boolean preference", 71 getFieldEditorParent())); 72 73 addField(new RadioGroupFieldEditor( 74 PreferenceConstants.P_CHOICE, 75 "An example of a multiple-choice preference", 76 1, 77 new String [][] { { "&Choice 1", "choice1" }, { 78 "C&hoice 2", "choice2" } 79 }, getFieldEditorParent())); 80 addField( 81 new StringFieldEditor(PreferenceConstants.P_STRING, "A &text preference:", getFieldEditorParent())); 82 } 83 84 87 public void init(IWorkbench workbench) { 88 } 89 90 } | Popular Tags |