new update site
[phpeclipse.git] / net.sourceforge.phpeclipse.xdebug.ui / src / net / sourceforge / phpeclipse / xdebug / ui / preference / XDebugPreferencePage.java
1 package net.sourceforge.phpeclipse.xdebug.ui.preference;
2
3 import net.sourceforge.phpeclipse.externaltools.ExternalToolsPlugin;
4 import net.sourceforge.phpeclipse.xdebug.core.IXDebugPreferenceConstants;
5 import net.sourceforge.phpeclipse.xdebug.core.XDebugCorePlugin;
6
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;
13
14
15 public class XDebugPreferencePage extends FieldEditorPreferencePage implements
16                 IWorkbenchPreferencePage {
17
18         /* Preference page for the default XDebug-Settings */
19         
20         public XDebugPreferencePage() {
21                 super(FieldEditorPreferencePage.GRID);
22
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);
31         }
32
33         public void init(IWorkbench workbench) {
34                 setDescription("Default Entries for XDebug:");
35         }
36
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");
41                 addField(debugPort);
42                 
43                 FileFieldEditor phpInterpreter = new FileFieldEditor(IXDebugPreferenceConstants.PHP_INTERPRETER_PREFERENCE, "PHP &Interpreter:",true,getFieldEditorParent());
44             phpInterpreter.setErrorMessage("File not found");
45                 addField(phpInterpreter);
46                 
47         }
48
49
50
51
52 }