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() {
27 if (ExternalToolsPlugin.getDefault () != null) {
28 setPreferenceStore (ExternalToolsPlugin.getDefault().getPreferenceStore());
32 public void init(IWorkbench workbench) {
35 protected void performDefaults() {
36 externalParserSFE.loadDefault();
37 phpRunFFE.loadDefault();
38 super.performDefaults();
41 public boolean performOk() {
42 externalParserSFE.store();
44 return super.performOk();
47 protected Control createContents(Composite parent) {
48 initializeDialogUnits(parent);
49 Composite composite = new Composite(parent, SWT.LEFT);
50 composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
52 phpRunFFE = new FileFieldEditor(ExternalToolsPlugin.PHP_RUN_PREF,
53 PHPPreferencesMessages
54 .getString("PHPBasePreferencePage.console.php"),
56 phpRunFFE.setPage(this);
57 phpRunFFE.setPreferenceStore(getPreferenceStore());
60 externalParserSFE = new StringFieldEditor(
61 ExternalToolsPlugin.EXTERNAL_PARSER_PREF,
62 PHPPreferencesMessages
63 .getString("PHPBasePreferencePage.parsers.extcommand"),
65 externalParserSFE.setPage(this);
66 externalParserSFE.setPreferenceStore(getPreferenceStore());
67 externalParserSFE.load();
68 new Label(composite, SWT.NONE);
70 composite.setLayout(new GridLayout(3, false));