1 package net.sourceforge.phpeclipse.xdebug.ui.preference;
3 import net.sourceforge.phpeclipse.externaltools.ExternalToolsPlugin;
4 import net.sourceforge.phpeclipse.xdebug.core.IXDebugPreferenceConstants;
5 import net.sourceforge.phpeclipse.xdebug.core.XDebugCorePlugin;
7 import org.eclipse.jface.preference.FieldEditorPreferencePage;
8 import org.eclipse.jface.preference.FileFieldEditor;
9 import org.eclipse.jface.preference.IPreferenceStore;
10 import org.eclipse.jface.preference.IntegerFieldEditor;
11 import org.eclipse.ui.IWorkbench;
12 import org.eclipse.ui.IWorkbenchPreferencePage;
15 public class XDebugPreferencePage extends FieldEditorPreferencePage implements
16 IWorkbenchPreferencePage {
18 /* Preference page for the default XDebug-Settings */
20 public XDebugPreferencePage() {
21 super(FieldEditorPreferencePage.GRID);
23 // Set the preference store for the preference page.
24 IPreferenceStore store =
25 XDebugCorePlugin.getDefault().getPreferenceStore();
26 store.setDefault(IXDebugPreferenceConstants.DEBUGPORT_PREFERENCE,IXDebugPreferenceConstants.DEFAULT_DEBUGPORT);
27 // get the default form the externalToolsPlugin
28 String interpreter=ExternalToolsPlugin.getDefault().getPreferenceStore().getString(ExternalToolsPlugin.PHP_RUN_PREF);
29 store.setDefault(IXDebugPreferenceConstants.PHP_INTERPRETER_PREFERENCE,interpreter);
30 setPreferenceStore(store);
33 public void init(IWorkbench workbench) {
34 setDescription("Default Entries for XDebug:");
37 protected void createFieldEditors() {
38 IntegerFieldEditor debugPort = new IntegerFieldEditor(IXDebugPreferenceConstants.DEBUGPORT_PREFERENCE, "&Debugport:", getFieldEditorParent(),5);
39 debugPort.setValidRange(1025,65535);
40 debugPort.setErrorMessage("Debugport must be between 1024 and 65536");
43 FileFieldEditor phpInterpreter = new FileFieldEditor(IXDebugPreferenceConstants.PHP_INTERPRETER_PREFERENCE, "PHP &Interpreter:",true,getFieldEditorParent());
44 phpInterpreter.setErrorMessage("File not found");
45 addField(phpInterpreter);