Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 331260 | Differences between
and this patch

Collapse All | Expand All

(-)Application.e4xmi (-1 / +1 lines)
Lines 10-16 Link Here
10
      </children>
10
      </children>
11
    </children>
11
    </children>
12
    <mainMenu xmi:id="menu:org.eclipse.ui.main.menu" elementId="menu:org.eclipse.ui.main.menu">
12
    <mainMenu xmi:id="menu:org.eclipse.ui.main.menu" elementId="menu:org.eclipse.ui.main.menu">
13
      <children xsi:type="menu:Menu" xmi:id="_SeXUD-8EEd6FC9cDb6iV7g" elementId="_SeXUD-8EEd6FC9cDb6iV7g" label="File">
13
      <children xsi:type="menu:Menu" xmi:id="_SeXUD-8EEd6FC9cDb6iV7g" elementId="_SeXUD-8EEd6FC9cDb6iV7g" label="%fileMenu">
14
        <children xsi:type="menu:HandledMenuItem" xmi:id="_SeXUEO8EEd6FC9cDb6iV7g" elementId="_SeXUEO8EEd6FC9cDb6iV7g" label="Save" iconURI="platform:/plugin/org.eclipse.e4.demo.contacts/icons/silk/disk.png" command="contacts.save"/>
14
        <children xsi:type="menu:HandledMenuItem" xmi:id="_SeXUEO8EEd6FC9cDb6iV7g" elementId="_SeXUEO8EEd6FC9cDb6iV7g" label="Save" iconURI="platform:/plugin/org.eclipse.e4.demo.contacts/icons/silk/disk.png" command="contacts.save"/>
15
        <children xsi:type="menu:HandledMenuItem" xmi:id="_SeXUEe8EEd6FC9cDb6iV7g" elementId="_SeXUEe8EEd6FC9cDb6iV7g" label="Delete" iconURI="platform:/plugin/org.eclipse.e4.demo.contacts/icons/silk/user_delete.png" command="contacts.delete"/>
15
        <children xsi:type="menu:HandledMenuItem" xmi:id="_SeXUEe8EEd6FC9cDb6iV7g" elementId="_SeXUEe8EEd6FC9cDb6iV7g" label="Delete" iconURI="platform:/plugin/org.eclipse.e4.demo.contacts/icons/silk/user_delete.png" command="contacts.delete"/>
16
        <children xsi:type="menu:DirectMenuItem" xmi:id="_SeXUEu8EEd6FC9cDb6iV7g" elementId="_SeXUEu8EEd6FC9cDb6iV7g" label="Direct Exit" contributionURI="platform:/plugin/org.eclipse.e4.demo.contacts/org.eclipse.e4.demo.contacts.handlers.ExitHandler"/>
16
        <children xsi:type="menu:DirectMenuItem" xmi:id="_SeXUEu8EEd6FC9cDb6iV7g" elementId="_SeXUEu8EEd6FC9cDb6iV7g" label="Direct Exit" contributionURI="platform:/plugin/org.eclipse.e4.demo.contacts/org.eclipse.e4.demo.contacts.handlers.ExitHandler"/>
(-)build.properties (-1 / +3 lines)
Lines 10-13 Link Here
10
               css/,\
10
               css/,\
11
               splash.bmp,\
11
               splash.bmp,\
12
               plugin_customization.ini,\
12
               plugin_customization.ini,\
13
               vcards/
13
               vcards/,\
14
               plugin_ru.properties,\
15
               plugin.properties
(-)META-INF/MANIFEST.MF (-1 / +3 lines)
Lines 24-35 Link Here
24
 org.eclipse.e4.ui.bindings;bundle-version="0.9.0",
24
 org.eclipse.e4.ui.bindings;bundle-version="0.9.0",
25
 org.eclipse.e4.ui.css.swt.theme;bundle-version="0.9.0",
25
 org.eclipse.e4.ui.css.swt.theme;bundle-version="0.9.0",
26
 org.eclipse.e4.ui.css.swt;bundle-version="0.9.1",
26
 org.eclipse.e4.ui.css.swt;bundle-version="0.9.1",
27
 org.eclipse.e4.ui.di;bundle-version="0.9.0"
27
 org.eclipse.e4.ui.di;bundle-version="0.9.0",
28
 org.eclipse.e4.core.services;bundle-version="0.9.1"
28
Bundle-ActivationPolicy: lazy
29
Bundle-ActivationPolicy: lazy
29
Bundle-Vendor: Eclipse.org
30
Bundle-Vendor: Eclipse.org
30
Import-Package: javax.annotation;version="1.0.0",
31
Import-Package: javax.annotation;version="1.0.0",
31
 javax.inject;version="1.0.0"
32
 javax.inject;version="1.0.0"
32
Bundle-Activator: org.eclipse.e4.demo.contacts.BundleActivatorImpl
33
Bundle-Activator: org.eclipse.e4.demo.contacts.BundleActivatorImpl
33
Export-Package: org.eclipse.e4.demo.contacts.model
34
Export-Package: org.eclipse.e4.demo.contacts.model
35
Bundle-Localization: plugin
34
36
35
37
(-)plugin.properties (+11 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2011 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
# 
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
fileMenu = &File
(-)plugin_ru.properties (+11 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2011 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
# 
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
fileMenu = &\u0424\u0430\u0439\u043B
(-)src/org/eclipse/e4/demo/contacts/model/internal/BinaryTranslatorProvider.java (+31 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.e4.demo.contacts.model.internal;
12
13
import org.eclipse.e4.core.services.translation.TranslationService;
14
15
public class BinaryTranslatorProvider extends TranslationService {
16
17
	@Override
18
	public String translate(String key, String contributorURI) {
19
		if (key == null)
20
			return null;
21
		char[] charArray = key.toCharArray();
22
		StringBuffer tmp = new StringBuffer();
23
		tmp.append("0x");
24
		for(int i = 0; i < charArray.length; i++) {
25
			int value = charArray[i];
26
			tmp.append(Integer.toHexString(value));
27
		}
28
		return tmp.toString();
29
	}
30
31
}
(-)src/org/eclipse/e4/demo/contacts/model/internal/ModelLifeCycleExtension.java (+34 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.e4.demo.contacts.model.internal;
12
13
import javax.inject.Inject;
14
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
15
import org.eclipse.e4.core.contexts.IEclipseContext;
16
import org.eclipse.e4.core.services.translation.TranslationService;
17
import org.eclipse.e4.ui.model.application.MApplication;
18
import org.eclipse.e4.ui.workbench.lifecycle.ProcessRemovals;
19
20
public class ModelLifeCycleExtension {
21
	
22
	@Inject
23
	public ModelLifeCycleExtension() {
24
		// placeholder
25
	}
26
27
	@ProcessRemovals
28
	public void overrideTranslation(MApplication application) {
29
		IEclipseContext appContext = application.getContext();
30
		BinaryTranslatorProvider translationService = ContextInjectionFactory.make(BinaryTranslatorProvider.class, appContext);
31
		appContext.set(TranslationService.class, translationService);
32
	}
33
34
}
(-)src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java (-1 / +14 lines)
Lines 25-32 Link Here
25
import org.eclipse.e4.core.contexts.RunAndTrack;
25
import org.eclipse.e4.core.contexts.RunAndTrack;
26
import org.eclipse.e4.core.services.events.IEventBroker;
26
import org.eclipse.e4.core.services.events.IEventBroker;
27
import org.eclipse.e4.core.services.log.Logger;
27
import org.eclipse.e4.core.services.log.Logger;
28
import org.eclipse.e4.core.services.translation.TranslationService;
28
import org.eclipse.e4.ui.internal.workbench.ContributionsAnalyzer;
29
import org.eclipse.e4.ui.internal.workbench.ContributionsAnalyzer;
29
import org.eclipse.e4.ui.model.application.MApplication;
30
import org.eclipse.e4.ui.model.application.MApplication;
31
import org.eclipse.e4.ui.model.application.MApplicationElement;
30
import org.eclipse.e4.ui.model.application.ui.MCoreExpression;
32
import org.eclipse.e4.ui.model.application.ui.MCoreExpression;
31
import org.eclipse.e4.ui.model.application.ui.MElementContainer;
33
import org.eclipse.e4.ui.model.application.ui.MElementContainer;
32
import org.eclipse.e4.ui.model.application.ui.MUIElement;
34
import org.eclipse.e4.ui.model.application.ui.MUIElement;
Lines 754-760 Link Here
754
		if (text == null || text.length() == 0) {
756
		if (text == null || text.length() == 0) {
755
			return NO_LABEL;
757
			return NO_LABEL;
756
		}
758
		}
757
		return text;
759
		// XXX
760
		return translate(text, menuModel);
761
	}
762
763
	private String translate(String key, MApplicationElement element) {
764
		IEclipseContext parentContext = modelService
765
				.getContainingContext((MUIElement) element);
766
		TranslationService translation = parentContext
767
				.get(TranslationService.class);
768
		String translated = translation.translate(key,
769
				element.getContributorURI());
770
		return translated;
758
	}
771
	}
759
772
760
	private ImageDescriptor getImageDescriptor(MUILabel element) {
773
	private ImageDescriptor getImageDescriptor(MUILabel element) {

Return to bug 331260