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 private IntegerFieldEditor debugPort;
22 public XDebugPreferencePage() {
23 super(FieldEditorPreferencePage.GRID);
25 // Set the preference store for the preference page.
26 IPreferenceStore store =
27 XDebugCorePlugin.getDefault().getPreferenceStore();
28 store.setDefault(IXDebugPreferenceConstants.DEBUGPORT_PREFERENCE,IXDebugPreferenceConstants.DEFAULT_DEBUGPORT);
29 // get the default from the externalToolsPlugin
31 if (ExternalToolsPlugin.getDefault () != null) {
32 String interpreter = ExternalToolsPlugin.getDefault ().getPreferenceStore().getString(ExternalToolsPlugin.PHP_RUN_PREF);
33 store.setDefault(IXDebugPreferenceConstants.PHP_INTERPRETER_PREFERENCE,interpreter);
35 setPreferenceStore(store);
38 public void init(IWorkbench workbench) {
39 setDescription("Default Entries for XDebug:");
42 protected void createFieldEditors() {
43 debugPort = new IntegerFieldEditor(IXDebugPreferenceConstants.DEBUGPORT_PREFERENCE, "&Debugport:", getFieldEditorParent(),5);
44 debugPort.setValidRange(1025,65535);
46 debugPort.setErrorMessage("Debugport must be between 1024 and 65536");
49 FileFieldEditor phpInterpreter = new FileFieldEditor(IXDebugPreferenceConstants.PHP_INTERPRETER_PREFERENCE, "PHP &Interpreter:",true,getFieldEditorParent());
50 phpInterpreter.setErrorMessage("File not found");
51 addField(phpInterpreter);
55 public void performApply() {
57 //XDebugCorePlugin.getDefault().setProxyPort(debugPort.getIntValue());