Temporarily removed all references to com.quantum.util.connection.NotConnectedException
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / PHPEclipseBasePreferencePage.java
index 9da4482..3262fb0 100644 (file)
@@ -1,9 +1,9 @@
 package net.sourceforge.phpeclipse;
 
+import net.sourceforge.phpdt.internal.ui.util.PHPFileUtil;
 import net.sourceforge.phpeclipse.preferences.PHPPreferencesMessages;
 
 import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.jface.preference.DirectoryFieldEditor;
 import org.eclipse.jface.preference.FileFieldEditor;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferencePage;
@@ -20,6 +20,9 @@ import org.eclipse.ui.IWorkbenchPreferencePage;
 
 public class PHPEclipseBasePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
 
+  StringFieldEditor phpParserExtensionsSFE;
+  StringFieldEditor xamppStartSFE;
+  StringFieldEditor xamppStopSFE;
   StringFieldEditor apacheStartSFE;
 
   StringFieldEditor apacheStopSFE;
@@ -52,6 +55,9 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
   }
 
   protected void performDefaults() {
+    phpParserExtensionsSFE.loadDefault();
+    xamppStartSFE.loadDefault();
+    xamppStopSFE.loadDefault();
     apacheStartSFE.loadDefault();
     apacheStopSFE.loadDefault();
     apacheRestartSFE.loadDefault();
@@ -67,7 +73,10 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
   }
 
   public boolean performOk() {
-
+    PHPFileUtil.setExtensions(null); 
+    phpParserExtensionsSFE.store();
+    xamppStartSFE.store();
+    xamppStopSFE.store();
     apacheStartSFE.store();
     apacheStopSFE.store();
     apacheRestartSFE.store();
@@ -90,6 +99,16 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
     composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
     composite.setLayout(new GridLayout());
 
+    // allowed PHP file extensions for parsing
+    Composite phpParserExtensionsComposite = new Composite(composite, SWT.NULL);
+    phpParserExtensionsComposite.setLayout(new GridLayout());
+    phpParserExtensionsComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); 
+    phpParserExtensionsSFE = new StringFieldEditor(IPreferenceConstants.PHP_EXTENSION_PREFS, PHPPreferencesMessages
+        .getString("PHPBasePreferencePage.phpExtensionPrefs"), phpParserExtensionsComposite);
+    phpParserExtensionsSFE.setPreferencePage(this);
+    phpParserExtensionsSFE.setPreferenceStore(getPreferenceStore());
+    phpParserExtensionsSFE.load();
+    
     //Create apache
     Composite apacheSettingsComposite = new Composite(composite, SWT.NULL);
     apacheSettingsComposite.setLayout(new GridLayout());
@@ -99,6 +118,21 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
     apacheSettingsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
     apacheSettingsGroup.setLayout(new GridLayout());
 
+    
+    xamppStartSFE = new StringFieldEditor(IPreferenceConstants.XAMPP_START_PREF, PHPPreferencesMessages
+        .getString("PHPBasePreferencePage.apacheGroup.xampp_start"), apacheSettingsGroup);
+    xamppStartSFE.setPreferencePage(this);
+    xamppStartSFE.setPreferenceStore(getPreferenceStore());
+    xamppStartSFE.load();
+    new Label(apacheSettingsGroup, SWT.NONE);
+    
+    xamppStopSFE = new StringFieldEditor(IPreferenceConstants.XAMPP_STOP_PREF, PHPPreferencesMessages
+        .getString("PHPBasePreferencePage.apacheGroup.xampp_stop"), apacheSettingsGroup);
+    xamppStopSFE.setPreferencePage(this);
+    xamppStopSFE.setPreferenceStore(getPreferenceStore());
+    xamppStopSFE.load();
+    new Label(apacheSettingsGroup, SWT.NONE);
+    
     apacheStartBFE = new BooleanFieldEditor(PHPeclipsePlugin.APACHE_START_BACKGROUND, PHPPreferencesMessages
         .getString("PHPBasePreferencePage.apacheGroup.start_background"), apacheSettingsGroup);
     apacheStartBFE.setPreferencePage(this);