Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2014-10-29 11:51:13 -0400
committerTom Schindl2014-10-29 11:51:13 -0400
commit29b3d10e939c0eb2142b6aad89d0f0c68a4e4c57 (patch)
tree970db399bf0c87bdea03aedab1b68df3df7d87e0 /demos/org.eclipse.fx.testcases.l10n.app
parenta9c3370e352cef1f41b668f0be6c2fc11444649c (diff)
downloadorg.eclipse.efxclipse-29b3d10e939c0eb2142b6aad89d0f0c68a4e4c57.tar.gz
org.eclipse.efxclipse-29b3d10e939c0eb2142b6aad89d0f0c68a4e4c57.tar.xz
org.eclipse.efxclipse-29b3d10e939c0eb2142b6aad89d0f0c68a4e4c57.zip
adding sample for language flip
Diffstat (limited to 'demos/org.eclipse.fx.testcases.l10n.app')
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/.classpath7
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/.project28
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/Application.e4xmi27
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/META-INF/MANIFEST.MF52
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/OSGI-INF/l10n/bundle.properties6
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/OSGI-INF/l10n/bundle_de.properties4
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/bin/.gitignore1
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/build.properties7
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/css/default.css1
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/plugin.xml19
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/pom.xml33
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/src/org/eclipse/fx/testcases/l10n/app/SamplePart.java13
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/src/org/eclipse/fx/testcases/l10n/app/SwitchLang.java20
13 files changed, 218 insertions, 0 deletions
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/.classpath b/demos/org.eclipse.fx.testcases.l10n.app/.classpath
new file mode 100644
index 000000000..3bc247511
--- /dev/null
+++ b/demos/org.eclipse.fx.testcases.l10n.app/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/.project b/demos/org.eclipse.fx.testcases.l10n.app/.project
new file mode 100644
index 000000000..1b4de8e2d
--- /dev/null
+++ b/demos/org.eclipse.fx.testcases.l10n.app/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.fx.testcases.l10n.app</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/Application.e4xmi b/demos/org.eclipse.fx.testcases.l10n.app/Application.e4xmi
new file mode 100644
index 000000000..7d8eb6662
--- /dev/null
+++ b/demos/org.eclipse.fx.testcases.l10n.app/Application.e4xmi
@@ -0,0 +1,27 @@
+<?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:advanced="http://www.eclipse.org/ui/2010/UIModel/application/ui/advanced" 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="_UsTVQVr7EeS5TKc3qjGXdA" elementId="org.eclipse.e4.application" bindingContexts="_UsTVQFr7EeS5TKc3qjGXdA">
+ <children xsi:type="basic:TrimmedWindow" xmi:id="_a94oEFr7EeS5TKc3qjGXdA" elementId="org.eclipse.fx.testcases.l10n.app.trimmedwindow.0" label="%trimmedwindow.label.1" x="10" y="10" width="800" height="600">
+ <children xsi:type="basic:PartStack" xmi:id="_vIvX0Fr7EeS5TKc3qjGXdA" elementId="org.eclipse.fx.testcases.l10n.app.partstack.0">
+ <children xsi:type="basic:Part" xmi:id="_viJWUFr7EeS5TKc3qjGXdA" elementId="org.eclipse.fx.testcases.l10n.app.part.1" contributionURI="bundleclass://org.eclipse.fx.testcases.l10n.app/org.eclipse.fx.testcases.l10n.app.SamplePart" label="%part.label.1"/>
+ <children xsi:type="advanced:Placeholder" xmi:id="_ysqKgFr7EeS5TKc3qjGXdA" elementId="org.eclipse.fx.testcases.l10n.app.placeholder.0" ref="_hE97EFr7EeS5TKc3qjGXdA"/>
+ <children xsi:type="basic:Part" xmi:id="_1OaKAFsFEeS5TKc3qjGXdA" elementId="org.eclipse.fx.testcases.l10n.app.part.2" label="%part.label.1"/>
+ </children>
+ <sharedElements xsi:type="basic:Part" xmi:id="_hE97EFr7EeS5TKc3qjGXdA" elementId="org.eclipse.fx.testcases.l10n.app.part.0" contributionURI="bundleclass://org.eclipse.fx.testcases.l10n.app/org.eclipse.fx.testcases.l10n.app.SamplePart" label="%part.label.2"/>
+ <trimBars xmi:id="_MGpRkFr8EeS5TKc3qjGXdA" elementId="org.eclipse.fx.testcases.l10n.app.trimbar.0">
+ <children xsi:type="menu:ToolBar" xmi:id="_Mmuf0Fr8EeS5TKc3qjGXdA" elementId="org.eclipse.fx.testcases.l10n.app.toolbar.0">
+ <children xsi:type="menu:DirectToolItem" xmi:id="_POnvIFr8EeS5TKc3qjGXdA" elementId="org.eclipse.fx.testcases.l10n.app.directtoolitem.0" label="%directtoolitem.label.1" contributionURI="bundleclass://org.eclipse.fx.testcases.l10n.app/org.eclipse.fx.testcases.l10n.app.SwitchLang"/>
+ </children>
+ </trimBars>
+ </children>
+ <rootContext xmi:id="_UsTVQFr7EeS5TKc3qjGXdA" elementId="org.eclipse.ui.contexts.dialogAndWindow" name="In Dialog and Windows">
+ <children xmi:id="_UsTVQlr7EeS5TKc3qjGXdA" elementId="org.eclipse.ui.contexts.window" name="In Windows"/>
+ <children xmi:id="_UsTVQ1r7EeS5TKc3qjGXdA" elementId="org.eclipse.ui.contexts.dialog" name="In Dialogs"/>
+ </rootContext>
+ <addons xmi:id="_UsTVRFr7EeS5TKc3qjGXdA" elementId="org.eclipse.e4.core.commands.service" contributionURI="bundleclass://org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/>
+ <addons xmi:id="_UsTVRVr7EeS5TKc3qjGXdA" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="bundleclass://org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/>
+ <addons xmi:id="_UsTVRlr7EeS5TKc3qjGXdA" elementId="org.eclipse.fx.ui.keybindings.e4.service" contributionURI="bundleclass://org.eclipse.fx.ui.keybindings.e4/org.eclipse.fx.ui.keybindings.e4.BindingServiceAddon"/>
+ <addons xmi:id="_UsTVR1r7EeS5TKc3qjGXdA" elementId="org.eclipse.e4.ui.workbench.commands.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.CommandProcessingAddon"/>
+ <addons xmi:id="_UsTVSFr7EeS5TKc3qjGXdA" elementId="org.eclipse.e4.ui.workbench.contexts.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.ContextProcessingAddon"/>
+ <addons xmi:id="_UsTVSVr7EeS5TKc3qjGXdA" elementId="org.eclipse.fx.ui.keybindings.e4.model" contributionURI="bundleclass://org.eclipse.fx.ui.keybindings.e4/org.eclipse.fx.ui.keybindings.e4.BindingProcessingAddon"/>
+ <addons xmi:id="_UsTVSlr7EeS5TKc3qjGXdA" elementId="org.eclipse.e4.ui.workbench.addons.HandlerProcessingAddon" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon"/>
+</application:Application>
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/META-INF/MANIFEST.MF b/demos/org.eclipse.fx.testcases.l10n.app/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..f4c59385f
--- /dev/null
+++ b/demos/org.eclipse.fx.testcases.l10n.app/META-INF/MANIFEST.MF
@@ -0,0 +1,52 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: My Sample App
+Bundle-SymbolicName: org.eclipse.fx.testcases.l10n.app;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Require-Bundle: org.eclipse.fx.ui.workbench.fx,
+ org.eclipse.e4.ui.model.workbench,
+ org.eclipse.e4.core.services,
+ org.eclipse.e4.core.di,
+ org.eclipse.e4.ui.di,
+ org.eclipse.e4.core.di.extensions,
+ org.eclipse.fx.ui.theme,
+ org.eclipse.fx.ui.di,
+ org.eclipse.e4.core.contexts,
+ org.eclipse.fx.core.databinding,
+ org.eclipse.fx.ui.databinding,
+ org.eclipse.core.databinding,
+ org.eclipse.core.databinding.observable,
+ org.eclipse.core.databinding.property,
+ org.eclipse.e4.ui.workbench,
+ org.eclipse.e4.ui.services,
+ javax.inject
+Import-Package: javafx.animation;version="2.0.0",
+ javafx.application;version="2.0.0",
+ javafx.beans;version="2.0.0",
+ javafx.beans.binding;version="2.0.0",
+ javafx.beans.property;version="2.0.0",
+ javafx.beans.value;version="2.0.0",
+ javafx.collections;version="2.0.0",
+ javafx.concurrent;version="2.0.0",
+ javafx.event;version="2.0.0",
+ javafx.fxml;version="2.0.0",
+ javafx.geometry;version="2.0.0",
+ javafx.scene;version="2.0.0",
+ javafx.scene.chart;version="2.0.0",
+ javafx.scene.control;version="2.0.0",
+ javafx.scene.control.cell;version="2.0.0",
+ javafx.scene.effect;version="2.0.0",
+ javafx.scene.image;version="2.0.0",
+ javafx.scene.input;version="2.0.0",
+ javafx.scene.layout;version="2.0.0",
+ javafx.scene.media;version="2.0.0",
+ javafx.scene.paint;version="2.0.0",
+ javafx.scene.shape;version="2.0.0",
+ javafx.scene.text;version="2.0.0",
+ javafx.scene.transform;version="2.0.0",
+ javafx.scene.web;version="2.0.0",
+ javafx.stage;version="2.0.0",
+ javafx.util;version="2.0.0",
+ javax.annotation;version="1.0.0",
+ javax.inject;version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/OSGI-INF/l10n/bundle.properties b/demos/org.eclipse.fx.testcases.l10n.app/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 000000000..a5dea773c
--- /dev/null
+++ b/demos/org.eclipse.fx.testcases.l10n.app/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,6 @@
+
+trimmedwindow.label.1 = Test l10n app
+part.label.1 = Sample
+part.label.2 = Shared Sample
+
+directtoolitem.label.1 = Flip
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/OSGI-INF/l10n/bundle_de.properties b/demos/org.eclipse.fx.testcases.l10n.app/OSGI-INF/l10n/bundle_de.properties
new file mode 100644
index 000000000..b1e573b90
--- /dev/null
+++ b/demos/org.eclipse.fx.testcases.l10n.app/OSGI-INF/l10n/bundle_de.properties
@@ -0,0 +1,4 @@
+trimmedwindow.label.1 = Test l10n Anwendung
+part.label.1 = Beispiel
+part.label.2 = Shared Beispiel
+directtoolitem.label.1 = Umschalten
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/bin/.gitignore b/demos/org.eclipse.fx.testcases.l10n.app/bin/.gitignore
new file mode 100644
index 000000000..cf1db2eed
--- /dev/null
+++ b/demos/org.eclipse.fx.testcases.l10n.app/bin/.gitignore
@@ -0,0 +1 @@
+/org/
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/build.properties b/demos/org.eclipse.fx.testcases.l10n.app/build.properties
new file mode 100644
index 000000000..db411bb01
--- /dev/null
+++ b/demos/org.eclipse.fx.testcases.l10n.app/build.properties
@@ -0,0 +1,7 @@
+bin.includes = .,\
+ META-INF/,\
+ plugin.xml,\
+css/,\
+ Application.e4xmi
+
+source.. = src/
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/css/default.css b/demos/org.eclipse.fx.testcases.l10n.app/css/default.css
new file mode 100644
index 000000000..a38730ef4
--- /dev/null
+++ b/demos/org.eclipse.fx.testcases.l10n.app/css/default.css
@@ -0,0 +1 @@
+/* Main CSS-File */ \ No newline at end of file
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/plugin.xml b/demos/org.eclipse.fx.testcases.l10n.app/plugin.xml
new file mode 100644
index 000000000..28974b70b
--- /dev/null
+++ b/demos/org.eclipse.fx.testcases.l10n.app/plugin.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+<extension id="product" point="org.eclipse.core.runtime.products">
+ <product name="L10n" application="org.eclipse.fx.ui.workbench.fx.application" >
+ <property name="appName" value="L10n" />
+
+ <property name="applicationXMI" value="org.eclipse.fx.testcases.l10n.app/Application.e4xmi" />
+
+ <property name="cssTheme" value="theme.default" />
+
+ </product>
+
+</extension>
+<extension point="org.eclipse.fx.ui.theme">
+ <theme id="theme.default" basestylesheet="css/default.css" />
+
+</extension>
+</plugin>
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/pom.xml b/demos/org.eclipse.fx.testcases.l10n.app/pom.xml
new file mode 100644
index 000000000..c2e51e43e
--- /dev/null
+++ b/demos/org.eclipse.fx.testcases.l10n.app/pom.xml
@@ -0,0 +1,33 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <name>L10n - application bundle</name>
+ <groupId>org.eclipse.fx.testcases.l10n</groupId>
+ <artifactId>org.eclipse.fx.testcases.l10n.app</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <parent>
+ <groupId>org.eclipse.fx.testcases.l10n</groupId>
+ <artifactId>org.eclipse.fx.testcases.l10n.app.releng</artifactId>
+ <relativePath>../org.eclipse.fx.testcases.l10n.app.releng/pom.xml</relativePath>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>.</directory>
+ <includes>
+ <include>META-INF/</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/src/org/eclipse/fx/testcases/l10n/app/SamplePart.java b/demos/org.eclipse.fx.testcases.l10n.app/src/org/eclipse/fx/testcases/l10n/app/SamplePart.java
new file mode 100644
index 000000000..ff21d3223
--- /dev/null
+++ b/demos/org.eclipse.fx.testcases.l10n.app/src/org/eclipse/fx/testcases/l10n/app/SamplePart.java
@@ -0,0 +1,13 @@
+package org.eclipse.fx.testcases.l10n.app;
+
+import javafx.scene.control.Label;
+import javafx.scene.layout.BorderPane;
+
+import javax.annotation.PostConstruct;
+
+public class SamplePart {
+ @PostConstruct
+ void init(BorderPane parent) {
+ parent.setCenter(new Label("Hello World"));
+ }
+}
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/src/org/eclipse/fx/testcases/l10n/app/SwitchLang.java b/demos/org.eclipse.fx.testcases.l10n.app/src/org/eclipse/fx/testcases/l10n/app/SwitchLang.java
new file mode 100644
index 000000000..458a00e0c
--- /dev/null
+++ b/demos/org.eclipse.fx.testcases.l10n.app/src/org/eclipse/fx/testcases/l10n/app/SwitchLang.java
@@ -0,0 +1,20 @@
+
+package org.eclipse.fx.testcases.l10n.app;
+
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.core.services.nls.ILocaleChangeService;
+import org.eclipse.e4.core.services.translation.TranslationService;
+
+public class SwitchLang {
+ @Execute
+ public void execute(ILocaleChangeService s, @Named(TranslationService.LOCALE) String locale) {
+ if( "en".equals(locale) ) {
+ s.changeApplicationLocale("de");
+ } else {
+ s.changeApplicationLocale("en");
+ }
+ }
+
+} \ No newline at end of file

Back to the top