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 import org.objectweb.dolphin.resources.DolphinResourcesManagment; 31 32 48 public class DolphinPreferencePage 49 extends FieldEditorPreferencePage 50 implements IWorkbenchPreferencePage { 51 52 DirectoryFieldEditor directory; 53 54 57 public DolphinPreferencePage() { 58 super(GRID); 59 60 setPreferenceStore(DolphinPlugin.getDefault().getPreferenceStore()); 61 setDescription("Switch the current workspace to another one"); 62 } 63 64 72 public void createFieldEditors() { 73 directory = new DirectoryFieldEditor(PreferenceConstants.P_WORKSPACE,"&Switch workspace : ", getFieldEditorParent()); 74 directory.setChangeButtonText("Browse"); 75 addField(directory); 76 77 } 95 96 99 public void init(IWorkbench workbench) { 100 } 101 102 106 public boolean performOk() { 107 performApply(); 108 return super.performOk(); 109 } 110 111 115 protected void performApply() { 116 DolphinResourcesManagment.setWorkspace(directory.getStringValue()); 117 } 118 119 122 public boolean performCancel() { 123 return super.performCancel(); 124 } 125 126 127 } | Popular Tags |