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.StringFieldEditor;
9 import org.eclipse.swt.SWT;
10 import org.eclipse.swt.layout.GridData;
11 import org.eclipse.swt.layout.GridLayout;
12 import org.eclipse.swt.widgets.Composite;
13 import org.eclipse.swt.widgets.Control;
14 import org.eclipse.swt.widgets.Group;
15 import org.eclipse.ui.IWorkbench;
16 import org.eclipse.ui.IWorkbenchPreferencePage;
18 public class PHPEclipseParserPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
20 // private SelectionListener SelectionListener;
21 // private ModifyListener ModifyListener;
22 // private ModifyListener TextModifyListener;
24 // private ArrayList CheckBoxes = new ArrayList();
25 // private ArrayList ComboBoxes = new ArrayList();
26 // private ArrayList TextBoxes = new ArrayList();
27 // private ArrayList RadioButtons = new ArrayList();
30 // RadioGroupFieldEditor chooseParser;
31 StringFieldEditor externalParserSFE;
32 // BooleanFieldEditor parseOnSave;
34 public PHPEclipseParserPreferencePage() {
36 setPreferenceStore(PHPeclipsePlugin.getDefault().getPreferenceStore());
37 setDescription(PHPPreferencesMessages.getString("PHPBasePreferencePage.description")); //$NON-NLS-1$
40 public void init(IWorkbench workbench) {
42 protected void performDefaults() {
43 // chooseParser.loadDefault();
44 externalParserSFE.loadDefault();
45 // parseOnSave.loadDefault();
46 super.performDefaults();
49 public boolean performOk() {
50 // chooseParser.store();
51 externalParserSFE.store();
52 // parseOnSave.store();
53 return super.performOk();
56 protected Control createContents(Composite parent) {
57 initializeDialogUnits(parent);
58 final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
59 Composite composite = new Composite(parent, SWT.LEFT);
60 composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
61 composite.setLayout(new GridLayout());
63 //Create parser settings composite
64 Composite parserSettingsComposite = new Composite(composite, SWT.NONE);
65 parserSettingsComposite.setLayout(new GridLayout());
66 parserSettingsComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
67 Group parserSettingsGroup = new Group(parserSettingsComposite, SWT.NONE);
68 parserSettingsGroup.setText(PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers"));
69 parserSettingsGroup.setLayout(new GridLayout());
70 parserSettingsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
73 // new RadioGroupFieldEditor(
74 // IPreferenceConstants.PHP_PARSER_DEFAULT,
75 // PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.choose"),
78 // { PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.internal"), IPreferenceConstants.PHP_INTERNAL_PARSER },
80 // PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.external"), IPreferenceConstants.PHP_EXTERNAL_PARSER }
81 // }, parserSettingsGroup);
82 // chooseParser.setPreferencePage(this);
83 // chooseParser.setPreferenceStore(getPreferenceStore());
84 // chooseParser.load();
85 //create a copmposte just for the StringEditor - makes layout simpler
86 Composite externalParserCompo = new Composite(parserSettingsGroup, SWT.NONE);
88 new StringFieldEditor(
89 IPreferenceConstants.EXTERNAL_PARSER_PREF,
90 PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.extcommand"),
92 /*parserSettingsGroup*/
94 externalParserSFE.setPreferencePage(this);
95 externalParserSFE.setPreferenceStore(getPreferenceStore());
96 externalParserSFE.load();
99 // new BooleanFieldEditor(
100 // PHPeclipsePlugin.PHP_PARSE_ON_SAVE,
101 // PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.pos"),
102 // parserSettingsGroup);
103 // parseOnSave.setPreferencePage(this);
104 // parseOnSave.setPreferenceStore(getPreferenceStore());
105 // parseOnSave.load();