1 package net.sourceforge.phpeclipse.preferences;
3 import net.sourceforge.phpeclipse.IPreferenceConstants;
4 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
6 import org.eclipse.jface.preference.IPreferenceStore;
7 import org.eclipse.jface.preference.PreferencePage;
8 import org.eclipse.jface.preference.RadioGroupFieldEditor;
9 import org.eclipse.jface.preference.StringFieldEditor;
10 import org.eclipse.swt.SWT;
11 import org.eclipse.swt.layout.GridData;
12 import org.eclipse.swt.layout.GridLayout;
13 import org.eclipse.swt.widgets.Composite;
14 import org.eclipse.swt.widgets.Control;
15 import org.eclipse.swt.widgets.Group;
16 import org.eclipse.ui.IWorkbench;
17 import org.eclipse.ui.IWorkbenchPreferencePage;
19 public class PHPEclipseParserPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
21 // private SelectionListener SelectionListener;
22 // private ModifyListener ModifyListener;
23 // private ModifyListener TextModifyListener;
25 // private ArrayList CheckBoxes = new ArrayList();
26 // private ArrayList ComboBoxes = new ArrayList();
27 // private ArrayList TextBoxes = new ArrayList();
28 // private ArrayList RadioButtons = new ArrayList();
31 // RadioGroupFieldEditor chooseParser;
32 StringFieldEditor externalParserSFE;
33 // BooleanFieldEditor parseOnSave;
35 public PHPEclipseParserPreferencePage() {
37 setPreferenceStore(PHPeclipsePlugin.getDefault().getPreferenceStore());
38 setDescription(PHPPreferencesMessages.getString("PHPBasePreferencePage.description")); //$NON-NLS-1$
41 public void init(IWorkbench workbench) {
43 protected void performDefaults() {
44 // chooseParser.loadDefault();
45 externalParserSFE.loadDefault();
46 // parseOnSave.loadDefault();
47 super.performDefaults();
50 public boolean performOk() {
51 // chooseParser.store();
52 externalParserSFE.store();
53 // parseOnSave.store();
54 return super.performOk();
57 protected Control createContents(Composite parent) {
58 initializeDialogUnits(parent);
59 final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
60 Composite composite = new Composite(parent, SWT.LEFT);
61 composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
62 composite.setLayout(new GridLayout());
64 //Create parser settings composite
65 Composite parserSettingsComposite = new Composite(composite, SWT.NONE);
66 parserSettingsComposite.setLayout(new GridLayout());
67 parserSettingsComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
68 Group parserSettingsGroup = new Group(parserSettingsComposite, SWT.NONE);
69 parserSettingsGroup.setText(PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers"));
70 parserSettingsGroup.setLayout(new GridLayout());
71 parserSettingsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
74 // new RadioGroupFieldEditor(
75 // IPreferenceConstants.PHP_PARSER_DEFAULT,
76 // PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.choose"),
79 // { PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.internal"), IPreferenceConstants.PHP_INTERNAL_PARSER },
81 // PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.external"), IPreferenceConstants.PHP_EXTERNAL_PARSER }
82 // }, parserSettingsGroup);
83 // chooseParser.setPreferencePage(this);
84 // chooseParser.setPreferenceStore(getPreferenceStore());
85 // chooseParser.load();
86 //create a copmposte just for the StringEditor - makes layout simpler
87 Composite externalParserCompo = new Composite(parserSettingsGroup, SWT.NONE);
89 new StringFieldEditor(
90 IPreferenceConstants.EXTERNAL_PARSER_PREF,
91 PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.extcommand"),
93 /*parserSettingsGroup*/
95 externalParserSFE.setPreferencePage(this);
96 externalParserSFE.setPreferenceStore(getPreferenceStore());
97 externalParserSFE.load();
100 // new BooleanFieldEditor(
101 // PHPeclipsePlugin.PHP_PARSE_ON_SAVE,
102 // PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.pos"),
103 // parserSettingsGroup);
104 // parseOnSave.setPreferencePage(this);
105 // parseOnSave.setPreferenceStore(getPreferenceStore());
106 // parseOnSave.load();