1) Reintroduced some out commented methods. (Did break some preference settings)
[phpeclipse.git] / net.sourceforge.phpeclipse.xdebug.ui / src / net / sourceforge / phpeclipse / xdebug / ui / preference / XDebugPreferencePage.java
index 50435bf..2aa0b32 100644 (file)
@@ -11,25 +11,27 @@ import org.eclipse.jface.preference.IntegerFieldEditor;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 
+
 public class XDebugPreferencePage extends FieldEditorPreferencePage implements
                IWorkbenchPreferencePage {
 
        /* Preference page for the default XDebug-Settings */
+       
+       private IntegerFieldEditor debugPort;
 
        public XDebugPreferencePage() {
                super(FieldEditorPreferencePage.GRID);
 
                // Set the preference store for the preference page.
-               IPreferenceStore store = XDebugCorePlugin.getDefault()
-                               .getPreferenceStore();
-               store.setDefault(IXDebugPreferenceConstants.DEBUGPORT_PREFERENCE,
-                               IXDebugPreferenceConstants.DEFAULT_DEBUGPORT);
-               // get the default form the externalToolsPlugin
-               String interpreter = ExternalToolsPlugin.getDefault()
-                               .getPreferenceStore().getString(
-                                               ExternalToolsPlugin.PHP_RUN_PREF);
-               store.setDefault(IXDebugPreferenceConstants.PHP_INTERPRETER_PREFERENCE,
-                               interpreter);
+               IPreferenceStore store =
+                       XDebugCorePlugin.getDefault().getPreferenceStore();
+               store.setDefault(IXDebugPreferenceConstants.DEBUGPORT_PREFERENCE,IXDebugPreferenceConstants.DEFAULT_DEBUGPORT);
+               // get the default from the externalToolsPlugin
+               
+               if (ExternalToolsPlugin.getDefault () != null) {
+                   String interpreter = ExternalToolsPlugin.getDefault ().getPreferenceStore().getString(ExternalToolsPlugin.PHP_RUN_PREF);
+               store.setDefault(IXDebugPreferenceConstants.PHP_INTERPRETER_PREFERENCE,interpreter);
+               }
                setPreferenceStore(store);
        }
 
@@ -38,19 +40,24 @@ public class XDebugPreferencePage extends FieldEditorPreferencePage implements
        }
 
        protected void createFieldEditors() {
-               IntegerFieldEditor debugPort = new IntegerFieldEditor(
-                               IXDebugPreferenceConstants.DEBUGPORT_PREFERENCE, "&Debugport:",
-                               getFieldEditorParent(), 5);
-               debugPort.setValidRange(1025, 65535);
+               debugPort = new IntegerFieldEditor(IXDebugPreferenceConstants.DEBUGPORT_PREFERENCE, "&Debugport:", getFieldEditorParent(),5);
+               debugPort.setValidRange(1025,65535);
+               
                debugPort.setErrorMessage("Debugport must be between 1024 and 65536");
                addField(debugPort);
-
-               FileFieldEditor phpInterpreter = new FileFieldEditor(
-                               IXDebugPreferenceConstants.PHP_INTERPRETER_PREFERENCE,
-                               "PHP &Interpreter:", true, getFieldEditorParent());
-               phpInterpreter.setErrorMessage("File not found");
+               
+               FileFieldEditor phpInterpreter = new FileFieldEditor(IXDebugPreferenceConstants.PHP_INTERPRETER_PREFERENCE, "PHP &Interpreter:",true,getFieldEditorParent());
+           phpInterpreter.setErrorMessage("File not found");
                addField(phpInterpreter);
-
+               
+       }
+       
+       public void performApply() {
+               super.performApply();
+               //XDebugCorePlugin.getDefault().setProxyPort(debugPort.getIntValue());
        }
 
+
+
+
 }