aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian de Alwis2011-08-20 13:22:45 (EDT)
committerPaul Webster2011-08-25 10:22:04 (EDT)
commitb32c69f18bd47e52d9733d8a9eead0bbf85d29c6 (patch)
treedd2271b0ad2c9789338d11fd68d35d887fdc2e06
parent72329906ce9d57061bc244bfb47490ca5877c9ca (diff)
downloadeclipse.platform.ui-b32c69f18bd47e52d9733d8a9eead0bbf85d29c6.zip
eclipse.platform.ui-b32c69f18bd47e52d9733d8a9eead0bbf85d29c6.tar.gz
eclipse.platform.ui-b32c69f18bd47e52d9733d8a9eead0bbf85d29c6.tar.bz2
Modify contacts to use localized strings for Theme menu
-rw-r--r--examples/org.eclipse.e4.demo.contacts/Application.e4xmi8
-rw-r--r--examples/org.eclipse.e4.demo.contacts/plugin.properties1
-rw-r--r--examples/org.eclipse.e4.demo.contacts/src/org/eclipse/e4/demo/contacts/processors/MenuThemeProcessor.java6
3 files changed, 10 insertions, 5 deletions
diff --git a/examples/org.eclipse.e4.demo.contacts/Application.e4xmi b/examples/org.eclipse.e4.demo.contacts/Application.e4xmi
index 4e0de1a..6e3cb8f 100644
--- a/examples/org.eclipse.e4.demo.contacts/Application.e4xmi
+++ b/examples/org.eclipse.e4.demo.contacts/Application.e4xmi
@@ -39,10 +39,10 @@
<children xmi:id="_SeXUEO8EEd6FC9cDb6iV7w" elementId="org.eclipse.ui.contexts.window" name="In Windows"/>
<children xmi:id="_SeXUEO8EEd6FC9cDb6iV7x" elementId="org.eclipse.ui.contexts.dialog" name="In Dialogs"/>
</rootContext>
- <commands xmi:id="contacts.exit" elementId="contacts.exit" commandName="Exit" description=""/>
- <commands xmi:id="contacts.save" elementId="contacts.save" commandName="Save" description=""/>
- <commands xmi:id="contacts.delete" elementId="contacts.delete" commandName="Delete" description=""/>
- <commands xmi:id="contacts.switchTheme" elementId="contacts.switchTheme" commandName="Switch Theme" description="">
+ <commands xmi:id="contacts.exit" elementId="contacts.exit" commandName="%menuLabelExit" description=""/>
+ <commands xmi:id="contacts.save" elementId="contacts.save" commandName="%menuLabelSave" description=""/>
+ <commands xmi:id="contacts.delete" elementId="contacts.delete" commandName="%menuLabelDelete" description=""/>
+ <commands xmi:id="contacts.switchTheme" elementId="contacts.switchTheme" commandName="%menuLabelSwitchTheme" description="">
<parameters xmi:id="contacts.commands.switchtheme.themeid" elementId="contacts.commands.switchtheme.themeid" name="Theme Id" typeId="" optional="false"/>
</commands>
<addons xmi:id="_XGB3wPZlEd-XstlTZ6nTXg" elementId="org.eclipse.e4.core.commands.service" contributionURI="platform:/plugin/org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/>
diff --git a/examples/org.eclipse.e4.demo.contacts/plugin.properties b/examples/org.eclipse.e4.demo.contacts/plugin.properties
index 049afed..7e88838 100644
--- a/examples/org.eclipse.e4.demo.contacts/plugin.properties
+++ b/examples/org.eclipse.e4.demo.contacts/plugin.properties
@@ -9,6 +9,7 @@
# IBM Corporation - initial API and implementation
###############################################################################
fileMenu = &File
+switchThemeMenu = &Theme
partDetails = Details
contactsList = Contacts List
menuLabelSave = &Save
diff --git a/examples/org.eclipse.e4.demo.contacts/src/org/eclipse/e4/demo/contacts/processors/MenuThemeProcessor.java b/examples/org.eclipse.e4.demo.contacts/src/org/eclipse/e4/demo/contacts/processors/MenuThemeProcessor.java
index bfd5b01..27dd71d 100644
--- a/examples/org.eclipse.e4.demo.contacts/src/org/eclipse/e4/demo/contacts/processors/MenuThemeProcessor.java
+++ b/examples/org.eclipse.e4.demo.contacts/src/org/eclipse/e4/demo/contacts/processors/MenuThemeProcessor.java
@@ -24,6 +24,8 @@ import org.eclipse.emf.ecore.EObject;
public class MenuThemeProcessor extends AbstractThemeProcessor {
+ private static final String BUNDLE_ID = "platform:/plugin/org.eclipse.e4.demo.contacts"; //$NON-NLS-1$
+
@Inject
@Named("menu:org.eclipse.ui.main.menu")
private MMenu menu;
@@ -37,7 +39,8 @@ public class MenuThemeProcessor extends AbstractThemeProcessor {
@Override
protected void preprocess() {
themesMenu = MMenuFactory.INSTANCE.createMenu();
- themesMenu.setLabel("Theme"); //$NON-NLS-1$
+ themesMenu.setLabel("%switchThemeMenu"); //$NON-NLS-1$
+ themesMenu.setContributorURI(BUNDLE_ID);
}
@Override
@@ -48,6 +51,7 @@ public class MenuThemeProcessor extends AbstractThemeProcessor {
menuItem.setLabel(name);
menuItem.setCommand(switchCommand);
menuItem.getParameters().add(themeId);
+ menuItem.setContributorURI(BUNDLE_ID);
if (iconURI != null) {
menuItem.setIconURI(iconURI);
}