<?xml version="1.0" encoding="UTF-8"?>
<application:Application xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:application="http://www.eclipse.org/ui/2010/UIModel/application" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmi:id="_6wlLcMgZEeSyMNYR5xypkQ" elementId="Sample.application" bindingContexts="_6wlLecgZEeSyMNYR5xypkQ">
- <children xsi:type="basic:TrimmedWindow" xmi:id="_6wlLccgZEeSyMNYR5xypkQ" elementId="Sample.window.main" label="Sample RCP4" iconURI="platform:/plugin/net.mograsim.rcp/icons/app/ico_16t.png" width="500" height="400">
+ <children xsi:type="basic:TrimmedWindow" xmi:id="_6wlLccgZEeSyMNYR5xypkQ" elementId="Sample.window.main" label="%trimmedwindow.label.1" iconURI="platform:/plugin/net.mograsim.rcp/icons/app/ico_16t.png" width="500" height="400">
<children xsi:type="basic:PartSashContainer" xmi:id="_6wlLksgZEeSyMNYR5xypkQ" elementId="Sample.partsashcontainer.sample">
<children xsi:type="basic:PartStack" xmi:id="_6wlLk8gZEeSyMNYR5xypkQ" elementId="Sample.partstack.sample">
- <children xsi:type="basic:Part" xmi:id="_6wlLlMgZEeSyMNYR5xypkQ" elementId="Sample.part.sample" contributionURI="bundleclass://net.mograsim.rcp/net.mograsim.rcp.parts.SamplePart" label="Sample Part" iconURI="platform:/plugin/net.mograsim.rcp/icons/home.png"/>
- <children xsi:type="basic:Part" xmi:id="_cldhcH1HEema06ZDPR6BSw" elementId="net.mograsim.rcp.part.logicui" contributionURI="bundleclass://net.mograsim.rcp/net.mograsim.rcp.parts.LogicUIPart" label="LogicUI part"/>
+ <children xsi:type="basic:Part" xmi:id="_6wlLlMgZEeSyMNYR5xypkQ" elementId="Sample.part.sample" contributionURI="bundleclass://net.mograsim.rcp/net.mograsim.rcp.parts.SamplePart" label="%part.label.1" iconURI="platform:/plugin/net.mograsim.rcp/icons/home.png"/>
+ <children xsi:type="basic:Part" xmi:id="_cldhcH1HEema06ZDPR6BSw" elementId="net.mograsim.rcp.part.logicui" contributionURI="bundleclass://net.mograsim.rcp/net.mograsim.rcp.parts.LogicUIPart" label="%part.label.2"/>
</children>
<children xsi:type="basic:PartStack" xmi:id="_l2EzYG6wEemo__tDmTCqCQ" elementId="sample.partstack.0">
- <children xsi:type="basic:Part" xmi:id="_mW1XEG6wEemo__tDmTCqCQ" elementId="sample.part.none" label="None" tooltip="Something"/>
+ <children xsi:type="basic:Part" xmi:id="_mW1XEG6wEemo__tDmTCqCQ" elementId="sample.part.none" label="%part.label.3" tooltip="%part.tooltip.1"/>
</children>
</children>
<mainMenu xmi:id="_6wlLicgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.main.menu">
- <children xsi:type="menu:Menu" xmi:id="_6wlLisgZEeSyMNYR5xypkQ" elementId="file" label="File">
- <children xsi:type="menu:HandledMenuItem" xmi:id="_6wlLi8gZEeSyMNYR5xypkQ" elementId="Sample.handleditem.file.open" label="Open" iconURI="platform:/plugin/net.mograsim.rcp/icons/open_in_app.png" command="_6wlLgMgZEeSyMNYR5xypkQ"/>
- <children xsi:type="menu:HandledMenuItem" xmi:id="_6wlLjMgZEeSyMNYR5xypkQ" elementId="Sample.handleditem.save" label="Save" iconURI="platform:/plugin/net.mograsim.rcp/icons/save_edit.png" command="_6wlLg8gZEeSyMNYR5xypkQ"/>
- <children xsi:type="menu:HandledMenuItem" xmi:id="_6wlLjcgZEeSyMNYR5xypkQ" elementId="Sample.handleditem.quit" label="Quit" command="_6wlLfMgZEeSyMNYR5xypkQ"/>
+ <children xsi:type="menu:Menu" xmi:id="_6wlLisgZEeSyMNYR5xypkQ" elementId="file" label="%menu.label.1">
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_6wlLi8gZEeSyMNYR5xypkQ" elementId="Sample.handleditem.file.open" label="%handledmenuitem.label.1" iconURI="platform:/plugin/net.mograsim.rcp/icons/open_in_app.png" command="_6wlLgMgZEeSyMNYR5xypkQ"/>
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_6wlLjMgZEeSyMNYR5xypkQ" elementId="Sample.handleditem.save" label="%handledmenuitem.label.2" iconURI="platform:/plugin/net.mograsim.rcp/icons/save_edit.png" command="_6wlLg8gZEeSyMNYR5xypkQ"/>
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_6wlLjcgZEeSyMNYR5xypkQ" elementId="Sample.handleditem.quit" label="%handledmenuitem.label.3" command="_6wlLfMgZEeSyMNYR5xypkQ"/>
</children>
- <children xsi:type="menu:Menu" xmi:id="_6wlLjsgZEeSyMNYR5xypkQ" elementId="help" label="Help">
- <children xsi:type="menu:HandledMenuItem" xmi:id="_6wlLj8gZEeSyMNYR5xypkQ" elementId="Sample.handleditem.about" label="About" command="_6wlLhsgZEeSyMNYR5xypkQ"/>
+ <children xsi:type="menu:Menu" xmi:id="_6wlLjsgZEeSyMNYR5xypkQ" elementId="help" label="%menu.label.2">
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_6wlLj8gZEeSyMNYR5xypkQ" elementId="Sample.handleditem.about" label="%handledmenuitem.label.4" command="_6wlLhsgZEeSyMNYR5xypkQ"/>
+ </children>
+ <children xsi:type="menu:Menu" xmi:id="_iemosIZTEemVfN3A_OcXgw" elementId="net.mograsim.rcp.menu.lang" label="Lang">
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_JldvcIZUEemVfN3A_OcXgw" elementId="net.mograsim.rcp.handledmenuitem.de" label="DE" command="_LfFjgIZUEemVfN3A_OcXgw">
+ <parameters xmi:id="_klSy8IZUEemVfN3A_OcXgw" elementId="net.mograsim.rcp.parameter.0" name="change_lang_locale" value="de"/>
+ </children>
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_zzPj0IZUEemVfN3A_OcXgw" elementId="net.mograsim.rcp.handledmenuitem.en" label="EN" command="_LfFjgIZUEemVfN3A_OcXgw">
+ <parameters xmi:id="_2orf4IZUEemVfN3A_OcXgw" elementId="net.mograsim.rcp.parameter.1" name="change_lang_locale" value="en"/>
+ </children>
</children>
</mainMenu>
<trimBars xmi:id="_6wlLlcgZEeSyMNYR5xypkQ" elementId="Sample.trimbar.top">
<handlers xmi:id="_6wlLgcgZEeSyMNYR5xypkQ" elementId="sample.handler.openCommand" contributionURI="bundleclass://net.mograsim.rcp/net.mograsim.rcp.handlers.OpenHandler" command="_6wlLgMgZEeSyMNYR5xypkQ"/>
<handlers xmi:id="_6wlLhMgZEeSyMNYR5xypkQ" elementId="sample.handler.saveCommand" contributionURI="bundleclass://net.mograsim.rcp/net.mograsim.rcp.handlers.SaveHandler" command="_6wlLg8gZEeSyMNYR5xypkQ"/>
<handlers xmi:id="_6wlLh8gZEeSyMNYR5xypkQ" elementId="sample.handler.aboutCommand" contributionURI="bundleclass://net.mograsim.rcp/net.mograsim.rcp.handlers.AboutHandler" command="_6wlLhsgZEeSyMNYR5xypkQ"/>
+ <handlers xmi:id="_89lMcIZUEemVfN3A_OcXgw" elementId="net.mograsim.rcp.handler.0" contributionURI="bundleclass://net.mograsim.rcp/net.mograsim.rcp.handlers.LangHandler" command="_LfFjgIZUEemVfN3A_OcXgw"/>
<bindingTables xmi:id="_6wlLfsgZEeSyMNYR5xypkQ" elementId="Sample.bindingtable" bindingContext="_6wlLecgZEeSyMNYR5xypkQ">
<bindings xmi:id="_6wlLf8gZEeSyMNYR5xypkQ" elementId="Sample.keybinding.m1q" keySequence="M1+Q" command="_6wlLfMgZEeSyMNYR5xypkQ"/>
<bindings xmi:id="_6wlLgsgZEeSyMNYR5xypkQ" elementId="Sample.keybinding.m1o" keySequence="M1+O" command="_6wlLgMgZEeSyMNYR5xypkQ"/>
<children xmi:id="_6wlLesgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.contexts.window" name="In Windows"/>
<children xmi:id="_6wlLe8gZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.contexts.dialog" name="In Dialogs"/>
</rootContext>
- <commands xmi:id="_6wlLfMgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.file.exit" commandName="quitCommand"/>
- <commands xmi:id="_6wlLgMgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.file.open" commandName="openCommand"/>
- <commands xmi:id="_6wlLg8gZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.file.save" commandName="saveCommand"/>
- <commands xmi:id="_6wlLhsgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.help.aboutAction" commandName="aboutCommand"/>
+ <commands xmi:id="_6wlLfMgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.file.exit" commandName="%command.commandname.1"/>
+ <commands xmi:id="_6wlLgMgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.file.open" commandName="%command.commandname.2"/>
+ <commands xmi:id="_6wlLg8gZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.file.save" commandName="%command.commandname.3"/>
+ <commands xmi:id="_6wlLhsgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.help.aboutAction" commandName="%command.commandname.4"/>
+ <commands xmi:id="_LfFjgIZUEemVfN3A_OcXgw" elementId="net.mograsim.rcp.command.changelang" commandName="changeLang">
+ <parameters xmi:id="_NW29cIZUEemVfN3A_OcXgw" elementId="change_lang_locale" name="locale" optional="false"/>
+ </commands>
<addons xmi:id="_6wlLcsgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.core.commands.service" contributionURI="bundleclass://org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/>
<addons xmi:id="_6wlLc8gZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="bundleclass://org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/>
<addons xmi:id="_6wlLdMgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.bindings.service" contributionURI="bundleclass://org.eclipse.e4.ui.bindings/org.eclipse.e4.ui.bindings.BindingServiceAddon"/>
Bundle-SymbolicName: net.mograsim.rcp;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: %Bundle-Vendor
+Bundle-Localization: OSGI-INF/l10n/bundle
+Export-Package: net.mograsim.rcp.handlers;uses:="org.eclipse.swt.widgets,org.eclipse.e4.ui.workbench,org.eclipse.e4.ui.workbench.modeling",
+ net.mograsim.rcp.parts;uses:="org.eclipse.swt.widgets",
+ net.mograsim.rcp.splashhandlers
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.15.200",
org.eclipse.e4.ui.model.workbench;bundle-version="2.1.300",
org.eclipse.jface;bundle-version="3.15.100",
org.eclipse.e4.ui.di;bundle-version="1.2.500",
org.eclipse.ui.workbench;bundle-version="3.113.0",
javax.annotation;bundle-version="1.2.0",
- net.mograsim.logic.ui
+ net.mograsim.logic.ui,
+ org.eclipse.osgi.services;bundle-version="3.8.0",
+ org.eclipse.e4.core.services;bundle-version="2.1.400"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: Sample
-Export-Package: net.mograsim.rcp.handlers;uses:="org.eclipse.swt.widgets,org.eclipse.e4.ui.workbench,org.eclipse.e4.ui.workbench.modeling",
- net.mograsim.rcp.parts;uses:="org.eclipse.swt.widgets",
- net.mograsim.rcp.splashhandlers
+Import-Package: javax.inject;version="1.0.0"
Bundle-Name = Sample
product.name = Sample
extension-point.name = Splash Extensions
-product.name.0 = Simulator WIP
\ No newline at end of file
+product.name = Simulator WIP
+trimmedwindow.label.1 = Sample RCP4
+part.label.1 = Sample Part
+part.label.2 = LogicUI part
+part.label.3 = None
+part.tooltip.1 = Something
+menu.label.1 = File
+handledmenuitem.label.1 = Open
+handledmenuitem.label.2 = Save
+handledmenuitem.label.3 = Quit
+menu.label.2 = Help
+handledmenuitem.label.4 = About
+command.commandname.1 = quitCommand
+command.commandname.2 = openCommand
+command.commandname.3 = saveCommand
+command.commandname.4 = aboutCommand
+sample_part_input_hint = Enter text to mark part as dirty
--- /dev/null
+#Properties file for Sample
+Bundle-Vendor = ICH
+Bundle-Name = Beispiel
+product.name = Beispiel
+extension-point.name = Splash Extensions
+product.name = Simulator WIP
+trimmedwindow.label.1 = Beispiel RCP4
+part.label.1 = Sample Part
+part.label.2 = LogicUI part
+part.label.3 = Nix
+part.tooltip.1 = Irgendwas
+menu.label.1 = Datei
+handledmenuitem.label.1 = Öffnen
+handledmenuitem.label.2 = Speichern
+handledmenuitem.label.3 = Schließen
+menu.label.2 = Hilfe
+handledmenuitem.label.4 = Über
+command.commandname.1 = quitCommand
+command.commandname.2 = openCommand
+command.commandname.3 = saveCommand
+command.commandname.4 = aboutCommand
+sample_part_input_hint = ALKSKSKS
css/,\
splash.bmp,\
schema/,\
- OSGI-INF/l10n/bundle.properties,\
OSGI-INF/
source.. = src/
src.includes = Application.e4xmi,\
- OSGI-INF/l10n/bundle.properties,\
css/,\
icons/,\
schema/,\
splash.bmp
+javacProjectSettings = true
point="org.eclipse.core.runtime.products">
<product
application="org.eclipse.e4.ui.workbench.swt.E4Application"
- name="Simulator WIP">
+ name="%product.name">
<property
name="applicationCSS"
value="platform:/plugin/net.mograsim.rcp/css/default.css">
</property>
<property
name="appName"
- value="Simulator WIP">
+ value="%product.name">
</property>
<property
name="windowImages"
splashId="net.mograsim.rcp.splashHandlers.extensible">
</splashHandlerProductBinding>
</extension>
- <extension
- point="net.mograsim.rcp.splashExtension">
- <splashExtension
- icon="icons/af.png"
- id="af"
- tooltip="Application Framework">
- </splashExtension>
- <splashExtension
- icon="icons/embedded.png"
- id="embedded"
- tooltip="Embedded">
- </splashExtension>
- <splashExtension
- icon="icons/enterprise.png"
- id="enterprise"
- tooltip="Enterprise">
- </splashExtension>
- <splashExtension
- icon="icons/languages.png"
- id="languages"
- tooltip="Languages">
- </splashExtension>
- <splashExtension
- icon="icons/rcp.png"
- id="rcp"
- tooltip="RCP">
- </splashExtension>
- </extension>
</plugin>
--- /dev/null
+
+package net.mograsim.rcp.handlers;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.core.services.nls.ILocaleChangeService;
+
+public class LangHandler
+{
+
+ @Inject
+ ILocaleChangeService lcs;
+
+ @Execute
+ public void execute(@Named("change_lang_locale") String change_lang_locale)
+ {
+ lcs.changeApplicationLocale(change_lang_locale);
+ }
+
+}
\ No newline at end of file
--- /dev/null
+package net.mograsim.rcp.i18n;
+
+public class Messages
+{
+ public String sample_part_input_hint;
+}
import javax.annotation.PostConstruct;
import javax.inject.Inject;
+import org.eclipse.e4.core.services.nls.Translation;
import org.eclipse.e4.ui.di.Focus;
import org.eclipse.e4.ui.di.Persist;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
+import net.mograsim.rcp.i18n.Messages;
+
public class SamplePart
{
private TableViewer tableViewer;
+ private Text txtInput;
@Inject
private MPart part;
{
parent.setLayout(new GridLayout(1, false));
- Text txtInput = new Text(parent, SWT.BORDER);
+ txtInput = new Text(parent, SWT.BORDER);
txtInput.setMessage("Enter text to mark part as dirty");
txtInput.addModifyListener(e -> part.setDirty(true));
txtInput.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
{
return Arrays.asList("Sample item 1", "Sample item 2", "Sample item 3", "Sample item 4", "Sample item 5");
}
+
+ @Inject
+ public void translate(@Translation Messages m)
+ {
+ if (txtInput != null && !txtInput.isDisposed())
+ txtInput.setMessage(m.sample_part_input_hint);
+ }
}
\ No newline at end of file