From 3ea91305c2f2c1ddd81a4d3724278e754d11c554 Mon Sep 17 00:00:00 2001 From: choochter Date: Wed, 5 Feb 2003 13:49:36 +0000 Subject: [PATCH 1/1] Add field for external parser to pref page --- .../phpeclipse/PHPEclipseBasePreferencePage.java | 22 ++++++++++++++++++- .../newPHPPreferencesMessages_DE.properties | 1 + .../newPHPPreferencesMessages_FR.properties | 1 + .../newPHPPreferencesMessages_en_GB.properties | 1 + .../newPHPPreferencesMessages_es_ES.properties | 1 + .../preferences/PHPPreferencesMessages.java | 6 +++++ 6 files changed, 30 insertions(+), 2 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPEclipseBasePreferencePage.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPEclipseBasePreferencePage.java index 439b0b5..8df6345 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPEclipseBasePreferencePage.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPEclipseBasePreferencePage.java @@ -18,6 +18,7 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; @@ -41,6 +42,7 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor StringFieldEditor apacheRestartSFE; StringFieldEditor mySQLCommandSFE; RadioGroupFieldEditor chooseParser; + StringFieldEditor externalParserSFE; BooleanFieldEditor parseOnSave; public PHPEclipseBasePreferencePage() { @@ -60,6 +62,7 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor apacheRestartSFE.loadDefault(); mySQLCommandSFE.loadDefault(); chooseParser.loadDefault(); + externalParserSFE.loadDefault(); parseOnSave.loadDefault(); super.performDefaults(); } @@ -74,6 +77,7 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor apacheRestartSFE.store(); mySQLCommandSFE.store(); chooseParser.store(); + externalParserSFE.store(); parseOnSave.store(); return super.performOk(); } @@ -91,7 +95,7 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor Group webSettingsGroup = new Group(webSettingsComposite, SWT.NONE); webSettingsGroup.setText(PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup")); webSettingsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - webSettingsGroup.setLayout(new GridLayout()); + webSettingsGroup.setLayout(new GridLayout()); localHostSFE = new StringFieldEditor( IPreferenceConstants.LOCALHOST_PREF, @@ -108,6 +112,7 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor documentRootDFE.setPreferencePage(this); documentRootDFE.setPreferenceStore(getPreferenceStore()); documentRootDFE.load(); +new Label(webSettingsGroup, SWT.NONE); externalBrowserBFE = new BooleanFieldEditor( IPreferenceConstants.USE_EXTERNAL_BROWSER_PREF, @@ -116,6 +121,7 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor externalBrowserBFE.setPreferencePage(this); externalBrowserBFE.setPreferenceStore(getPreferenceStore()); externalBrowserBFE.load(); +new Label(webSettingsGroup, SWT.NONE); externalBrowserSFE = new StringFieldEditor( IPreferenceConstants.EXTERNAL_BROWSER_PREF, @@ -198,7 +204,19 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor chooseParser.setPreferencePage(this); chooseParser.setPreferenceStore(getPreferenceStore()); chooseParser.load(); - parseOnSave = new BooleanFieldEditor(PHPeclipsePlugin.PHP_PARSE_ON_SAVE, "&Parse automatically on save", parserSettingsGroup); + //create a copmposte just for the StringEditor - makes layout simpler + Composite externalParserCompo = new Composite(parserSettingsGroup, SWT.NONE); + externalParserSFE = + new StringFieldEditor( + IPreferenceConstants.EXTERNAL_PARSER_PREF, + PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.extcommand"), + externalParserCompo/*parserSettingsGroup*/); + externalParserSFE.setPreferencePage(this); + externalParserSFE.setPreferenceStore(getPreferenceStore()); + externalParserSFE.load(); + + parseOnSave = new BooleanFieldEditor(PHPeclipsePlugin.PHP_PARSE_ON_SAVE, + PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.pos"), parserSettingsGroup); parseOnSave.setPreferencePage(this); parseOnSave.setPreferenceStore(getPreferenceStore()); parseOnSave.load(); diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/newPHPPreferencesMessages_DE.properties b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/newPHPPreferencesMessages_DE.properties index 07239fc..7088b03 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/newPHPPreferencesMessages_DE.properties +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/newPHPPreferencesMessages_DE.properties @@ -34,6 +34,7 @@ PHPBasePreferencePage.parsers=Parser Einstellungen PHPBasePreferencePage.parsers.pos=Parse beim Sichern PHPBasePreferencePage.parsers.external=Externer Parser PHPBasePreferencePage.parsers.internal=Interner Parser +PHPBasePreferencePage.parsers.extcommand=Parser command PHPBasePreferencePage.parsers.choose=PHP Parser auswählen PHPEditorSyntaxPreferencePage.description:PHP Editor Preferences diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/newPHPPreferencesMessages_FR.properties b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/newPHPPreferencesMessages_FR.properties index c1b3ff4..c380d9a 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/newPHPPreferencesMessages_FR.properties +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/newPHPPreferencesMessages_FR.properties @@ -34,6 +34,7 @@ PHPBasePreferencePage.parsers=Configuration de parsing PHPBasePreferencePage.parsers.pos=Parser à la sauvegarde PHPBasePreferencePage.parsers.external=Externe PHPBasePreferencePage.parsers.internal=Interne +PHPBasePreferencePage.parsers.extcommand=Parser command PHPBasePreferencePage.parsers.choose=Choisissez un parseur PHP PHPEditorSyntaxPreferencePage.description:Configuration de l'éditeur PHP diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/newPHPPreferencesMessages_en_GB.properties b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/newPHPPreferencesMessages_en_GB.properties index ef33d3f..a0bce66 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/newPHPPreferencesMessages_en_GB.properties +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/newPHPPreferencesMessages_en_GB.properties @@ -34,6 +34,7 @@ PHPBasePreferencePage.parsers=Parsing settings PHPBasePreferencePage.parsers.pos=Parse on save PHPBasePreferencePage.parsers.external=External PHPBasePreferencePage.parsers.internal=Internal +PHPBasePreferencePage.parsers.extcommand=Parser command PHPBasePreferencePage.parsers.choose=Choose PHP Parser PHPEditorSyntaxPreferencePage.description:PHP Editor Preferences diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/newPHPPreferencesMessages_es_ES.properties b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/newPHPPreferencesMessages_es_ES.properties index 286d746..0a98fc3 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/newPHPPreferencesMessages_es_ES.properties +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/newPHPPreferencesMessages_es_ES.properties @@ -34,6 +34,7 @@ PHPBasePreferencePage.parsers=Configuraci PHPBasePreferencePage.parsers.pos=Parsear al guardar PHPBasePreferencePage.parsers.external=Externo PHPBasePreferencePage.parsers.internal=Interno +PHPBasePreferencePage.parsers.extcommand=Parser command PHPBasePreferencePage.parsers.choose=Escoja Parser PHP PHPEditorSyntaxPreferencePage.description:Preferencias Editor PHP diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPPreferencesMessages.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPPreferencesMessages.java index 97f3c42..3ef3d5f 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPPreferencesMessages.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPPreferencesMessages.java @@ -43,4 +43,10 @@ public class PHPPreferencesMessages { public static ResourceBundle getResourceBundle() { return resourceBundle; } + + public static void switchBundle() { + String resourceBundleName = store.getString(IPreferenceConstants.RESOURCE_BUNDLE); + resourceBundle = ResourceBundle.getBundle(resourceBundleName); + + } } -- 1.7.1