1 package net.sourceforge.phpdt.externaltools.preferences;
3 import net.sourceforge.phpeclipse.externaltools.ExternalToolsPlugin;
5 import org.eclipse.jface.preference.FileFieldEditor;
6 import org.eclipse.jface.preference.PreferencePage;
7 import org.eclipse.swt.SWT;
8 import org.eclipse.swt.layout.GridData;
9 import org.eclipse.swt.layout.GridLayout;
10 import org.eclipse.swt.widgets.Composite;
11 import org.eclipse.swt.widgets.Control;
12 import org.eclipse.ui.IWorkbench;
13 import org.eclipse.ui.IWorkbenchPreferencePage;
15 public class XamppPrefencePage extends PreferencePage implements
16 IWorkbenchPreferencePage {
18 FileFieldEditor xamppStartSFE;
20 FileFieldEditor xamppStopSFE;
22 public XamppPrefencePage() {
24 setPreferenceStore(ExternalToolsPlugin.getDefault()
25 .getPreferenceStore());
28 protected Control createContents(Composite parent) {
29 initializeDialogUnits(parent);
30 Composite composite = new Composite(parent, SWT.LEFT);
31 composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
32 composite.setLayout(new GridLayout());
34 xamppStartSFE = new FileFieldEditor(
35 ExternalToolsPlugin.XAMPP_START_PREF,
36 PHPPreferencesMessages
37 .getString("PHPBasePreferencePage.apacheGroup.xampp_start"),
39 xamppStartSFE.setPage(this);
40 xamppStartSFE.setPreferenceStore(getPreferenceStore());
43 xamppStopSFE = new FileFieldEditor(
44 ExternalToolsPlugin.XAMPP_STOP_PREF,
45 PHPPreferencesMessages
46 .getString("PHPBasePreferencePage.apacheGroup.xampp_stop"),
48 xamppStopSFE.setPage(this);
49 xamppStopSFE.setPreferenceStore(getPreferenceStore());
54 public void init(IWorkbench workbench) {
57 protected void performDefaults() {
58 xamppStartSFE.loadDefault();
59 xamppStopSFE.loadDefault();
60 super.performDefaults();
63 public boolean performOk() {
64 xamppStartSFE.store();
66 return super.performOk();