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.jface.preference.StringFieldEditor;
8 import org.eclipse.swt.SWT;
9 import org.eclipse.swt.layout.GridData;
10 import org.eclipse.swt.layout.GridLayout;
11 import org.eclipse.swt.widgets.Composite;
12 import org.eclipse.swt.widgets.Control;
13 import org.eclipse.swt.widgets.Label;
14 import org.eclipse.ui.IWorkbench;
15 import org.eclipse.ui.IWorkbenchPreferencePage;
17 public class PHPExternalToolsPreferencePage extends PreferencePage implements
18 IWorkbenchPreferencePage {
20 StringFieldEditor externalParserSFE;
22 FileFieldEditor phpRunFFE;
24 public PHPExternalToolsPreferencePage() {
26 setPreferenceStore(ExternalToolsPlugin.getDefault()
27 .getPreferenceStore());
30 public void init(IWorkbench workbench) {
33 protected void performDefaults() {
34 externalParserSFE.loadDefault();
35 phpRunFFE.loadDefault();
36 super.performDefaults();
39 public boolean performOk() {
40 externalParserSFE.store();
42 return super.performOk();
45 protected Control createContents(Composite parent) {
46 initializeDialogUnits(parent);
47 Composite composite = new Composite(parent, SWT.LEFT);
48 composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
50 phpRunFFE = new FileFieldEditor(ExternalToolsPlugin.PHP_RUN_PREF,
51 PHPPreferencesMessages
52 .getString("PHPBasePreferencePage.console.php"),
54 phpRunFFE.setPage(this);
55 phpRunFFE.setPreferenceStore(getPreferenceStore());
58 externalParserSFE = new StringFieldEditor(
59 ExternalToolsPlugin.EXTERNAL_PARSER_PREF,
60 PHPPreferencesMessages
61 .getString("PHPBasePreferencePage.parsers.extcommand"),
63 externalParserSFE.setPage(this);
64 externalParserSFE.setPreferenceStore(getPreferenceStore());
65 externalParserSFE.load();
66 new Label(composite, SWT.NONE);
68 composite.setLayout(new GridLayout(3,false));