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;
public class PHPEclipseBasePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+ StringFieldEditor phpParserExtensionsSFE;
+ FileFieldEditor xamppStartSFE;
+ FileFieldEditor xamppStopSFE;
StringFieldEditor apacheStartSFE;
StringFieldEditor apacheStopSFE;
FileFieldEditor apacheRunFFE;
+ FileFieldEditor httpdConfFFE;
+
+ FileFieldEditor etcHostsFFE;
+
FileFieldEditor mysqlRunFFE;
FileFieldEditor phpRunFFE;
}
protected void performDefaults() {
+ phpParserExtensionsSFE.loadDefault();
+ xamppStartSFE.loadDefault();
+ xamppStopSFE.loadDefault();
apacheStartSFE.loadDefault();
apacheStopSFE.loadDefault();
apacheRestartSFE.loadDefault();
mySQLCommandSFE.loadDefault();
phpRunFFE.loadDefault();
apacheRunFFE.loadDefault();
+ httpdConfFFE.loadDefault();
+ etcHostsFFE.loadDefault();
mysqlRunFFE.loadDefault();
apacheStartBFE.loadDefault();
apacheStopBFE.loadDefault();
}
public boolean performOk() {
-
+ PHPFileUtil.setExtensions(null);
+ phpParserExtensionsSFE.store();
+ xamppStartSFE.store();
+ xamppStopSFE.store();
apacheStartSFE.store();
apacheStopSFE.store();
apacheRestartSFE.store();
mySQLCommandSFE.store();
phpRunFFE.store();
apacheRunFFE.store();
+ httpdConfFFE.store();
+ etcHostsFFE.store();
mysqlRunFFE.store();
apacheStartBFE.store();
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());
apacheSettingsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
apacheSettingsGroup.setLayout(new GridLayout());
+ xamppStartSFE = new FileFieldEditor(IPreferenceConstants.XAMPP_START_PREF, PHPPreferencesMessages
+ .getString("PHPBasePreferencePage.apacheGroup.xampp_start"), apacheSettingsGroup);
+ xamppStartSFE.setPreferencePage(this);
+ xamppStartSFE.setPreferenceStore(getPreferenceStore());
+ xamppStartSFE.load();
+
+ xamppStopSFE = new FileFieldEditor(IPreferenceConstants.XAMPP_STOP_PREF, PHPPreferencesMessages
+ .getString("PHPBasePreferencePage.apacheGroup.xampp_stop"), apacheSettingsGroup);
+ xamppStopSFE.setPreferencePage(this);
+ xamppStopSFE.setPreferenceStore(getPreferenceStore());
+ xamppStopSFE.load();
+
apacheStartBFE = new BooleanFieldEditor(PHPeclipsePlugin.APACHE_START_BACKGROUND, PHPPreferencesMessages
.getString("PHPBasePreferencePage.apacheGroup.start_background"), apacheSettingsGroup);
apacheStartBFE.setPreferencePage(this);
apacheRunFFE.setPreferenceStore(getPreferenceStore());
apacheRunFFE.load();
+ httpdConfFFE = new FileFieldEditor(IPreferenceConstants.HTTPD_CONF_PATH_PREF, PHPPreferencesMessages
+ .getString("PHPBasePreferencePage.apacheGroup.httpdconf"), apacheSettingsGroup);
+ httpdConfFFE.setPreferencePage(this);
+ httpdConfFFE.setPreferenceStore(getPreferenceStore());
+ httpdConfFFE.load();
+
+ etcHostsFFE = new FileFieldEditor(IPreferenceConstants.ETC_HOSTS_PATH_PREF, PHPPreferencesMessages
+ .getString("PHPBasePreferencePage.apacheGroup.etchosts"), apacheSettingsGroup);
+ etcHostsFFE.setPreferencePage(this);
+ etcHostsFFE.setPreferenceStore(getPreferenceStore());
+ etcHostsFFE.load();
+
phpRunFFE = new FileFieldEditor(IPreferenceConstants.PHP_RUN_PREF, PHPPreferencesMessages
.getString("PHPBasePreferencePage.console.php"), apacheSettingsGroup);
phpRunFFE.setPreferencePage(this);