Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2014-10-30 05:02:21 -0400
committerTom Schindl2014-10-30 05:02:21 -0400
commit7bb881e486f701aeab54bb7aeb2dab7c19ab631c (patch)
tree263d55a690a05a8f270d69829ad4212d7446be3b
parentaa96b78c5f381fdbce2c24b1118a0f0df5459af0 (diff)
downloadorg.eclipse.efxclipse-7bb881e486f701aeab54bb7aeb2dab7c19ab631c.tar.gz
org.eclipse.efxclipse-7bb881e486f701aeab54bb7aeb2dab7c19ab631c.tar.xz
org.eclipse.efxclipse-7bb881e486f701aeab54bb7aeb2dab7c19ab631c.zip
added sample for references
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages.java3
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages.properties3
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessagesRegistry.java23
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages_de.properties3
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages_en.properties3
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages.java3
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages.properties3
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessagesRegistry.java45
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages_de.properties3
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages_en.properties3
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/src/org/eclipse/fx/testcases/l10n/app/Message.l10n2
-rw-r--r--demos/org.eclipse.fx.testcases.l10n.app/src/org/eclipse/fx/testcases/l10n/app/SamplePart.java7
12 files changed, 59 insertions, 42 deletions
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages.java b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages.java
index 5da5ca6c1..cee4de4eb 100644
--- a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages.java
+++ b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages.java
@@ -1,5 +1,8 @@
package org.eclipse.fx.testcases.l10n.app;
+/*
+ * Do not modify - Auto generated from Message.l10n
+ */
public class BasicMessages {
public String BasicYes;
public String BasicDyn;
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages.properties b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages.properties
index dc9bc55fa..cc67a56a6 100644
--- a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages.properties
+++ b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages.properties
@@ -1,2 +1,5 @@
+#
+# Do not modify - Auto generated from Message.l10n
+#
BasicYes = Yes
BasicDyn = EN: ${val}
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessagesRegistry.java b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessagesRegistry.java
index e5e9bf90d..f308f215b 100644
--- a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessagesRegistry.java
+++ b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessagesRegistry.java
@@ -1,24 +1,17 @@
package org.eclipse.fx.testcases.l10n.app;
-import org.eclipse.fx.core.di.text.AbstractMessageRegistry;
-import org.eclipse.fx.core.text.Formatter;
+/*
+ * Do not modify - Auto generated from Message.l10n
+ */
+@org.eclipse.e4.core.di.annotations.Creatable
+public class BasicMessagesRegistry extends org.eclipse.fx.core.di.text.AbstractMessageRegistry<BasicMessages> {
-import org.eclipse.e4.core.di.annotations.Creatable;
-import java.util.function.Supplier;
-import javax.inject.Inject;
-import org.eclipse.e4.core.services.nls.Translation;
-@Creatable
-public class BasicMessagesRegistry extends AbstractMessageRegistry<BasicMessages> {
-
-
-
-
- @Inject
- public void updateMessages(@Translation BasicMessages messages) {
+ @javax.inject.Inject
+ public void updateMessages(@org.eclipse.e4.core.services.nls.Translation BasicMessages messages) {
super.updateMessages(messages);
}
@@ -37,7 +30,7 @@ public class BasicMessagesRegistry extends AbstractMessageRegistry<BasicMessages
return org.apache.commons.lang.text.StrSubstitutor.replace( BasicDyn(), dataMap);
}
- public Supplier<String> BasicDyn_supplier(Object val) {
+ public java.util.function.Supplier<String> BasicDyn_supplier(Object val) {
return () -> BasicDyn(val);
}
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages_de.properties b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages_de.properties
index 4d37412a3..d680d4869 100644
--- a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages_de.properties
+++ b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages_de.properties
@@ -1,2 +1,5 @@
+#
+# Do not modify - Auto generated from Message.l10n
+#
BasicYes = Ja
BasicDyn = DE: ${val}
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages_en.properties b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages_en.properties
index dc9bc55fa..cc67a56a6 100644
--- a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages_en.properties
+++ b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/BasicMessages_en.properties
@@ -1,2 +1,5 @@
+#
+# Do not modify - Auto generated from Message.l10n
+#
BasicYes = Yes
BasicDyn = EN: ${val}
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages.java b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages.java
index 25ea10669..456da3e22 100644
--- a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages.java
+++ b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages.java
@@ -1,5 +1,8 @@
package org.eclipse.fx.testcases.l10n.app;
+/*
+ * Do not modify - Auto generated from Message.l10n
+ */
public class SamplePartMessages {
public String SimpleText;
public String SimpleDateText;
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages.properties b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages.properties
index fada4e619..bb4a273a1 100644
--- a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages.properties
+++ b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages.properties
@@ -1,3 +1,6 @@
+#
+# Do not modify - Auto generated from Message.l10n
+#
SimpleText = Hello World
SimpleDateText = Hello World on ${now,-date,MMM/dd/yyyy}
SimpleNumberText = Hello World ${val,-number,#,##0} times
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessagesRegistry.java b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessagesRegistry.java
index 02cf6ff55..0eaa2cb0a 100644
--- a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessagesRegistry.java
+++ b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessagesRegistry.java
@@ -1,32 +1,25 @@
package org.eclipse.fx.testcases.l10n.app;
-import org.eclipse.fx.core.di.text.AbstractMessageRegistry;
-import org.eclipse.fx.core.text.Formatter;
-
-import org.eclipse.e4.core.di.annotations.Creatable;
-
-import java.util.function.Supplier;
-
-import javax.inject.Inject;
-
-import org.eclipse.e4.core.services.nls.Translation;
-
-@Creatable
-public class SamplePartMessagesRegistry extends AbstractMessageRegistry<SamplePartMessages> {
- @Inject
+/*
+ * Do not modify - Auto generated from Message.l10n
+ */
+@org.eclipse.e4.core.di.annotations.Creatable
+public class SamplePartMessagesRegistry extends org.eclipse.fx.core.di.text.AbstractMessageRegistry<SamplePartMessages> {
+ @javax.inject.Inject
private org.eclipse.fx.core.di.text.NumberFormatter _number;
- @Inject
+ @javax.inject.Inject
private org.eclipse.fx.core.di.text.DateFormatter _date;
- @Inject
+
+ @javax.inject.Inject
private org.eclipse.fx.testcases.l10n.app.MyFormatter cust_myformatter;
- @Inject
+ @javax.inject.Inject
private org.eclipse.fx.testcases.l10n.app.BasicMessagesRegistry bundle_BasicMessages;
- @Inject
- public void updateMessages(@Translation SamplePartMessages messages) {
+ @javax.inject.Inject
+ public void updateMessages(@org.eclipse.e4.core.services.nls.Translation SamplePartMessages messages) {
super.updateMessages(messages);
}
@@ -42,12 +35,12 @@ public class SamplePartMessagesRegistry extends AbstractMessageRegistry<SamplePa
public String SimpleDateText(java.util.Date now) {
java.util.Map<String,Object> dataMap = new java.util.HashMap<>();
dataMap.put("now",now);
- java.util.Map<String,Formatter<?>> formatterMap = new java.util.HashMap<>();
+ java.util.Map<String,org.eclipse.fx.core.text.Formatter<?>> formatterMap = new java.util.HashMap<>();
formatterMap.put("-date",_date);
return org.eclipse.fx.core.text.MessageFormatter.create(dataMap::get,formatterMap::get).apply( SimpleDateText() );
}
- public Supplier<String> SimpleDateText_supplier(java.util.Date now) {
+ public java.util.function.Supplier<String> SimpleDateText_supplier(java.util.Date now) {
return () -> SimpleDateText(now);
}
@@ -58,12 +51,12 @@ public class SamplePartMessagesRegistry extends AbstractMessageRegistry<SamplePa
public String SimpleNumberText(Number val) {
java.util.Map<String,Object> dataMap = new java.util.HashMap<>();
dataMap.put("val",val);
- java.util.Map<String,Formatter<?>> formatterMap = new java.util.HashMap<>();
+ java.util.Map<String,org.eclipse.fx.core.text.Formatter<?>> formatterMap = new java.util.HashMap<>();
formatterMap.put("-number",_number);
return org.eclipse.fx.core.text.MessageFormatter.create(dataMap::get,formatterMap::get).apply( SimpleNumberText() );
}
- public Supplier<String> SimpleNumberText_supplier(Number val) {
+ public java.util.function.Supplier<String> SimpleNumberText_supplier(Number val) {
return () -> SimpleNumberText(val);
}
@@ -74,12 +67,12 @@ public class SamplePartMessagesRegistry extends AbstractMessageRegistry<SamplePa
public String CustFormatText(Number val) {
java.util.Map<String,Object> dataMap = new java.util.HashMap<>();
dataMap.put("val",val);
- java.util.Map<String,Formatter<?>> formatterMap = new java.util.HashMap<>();
+ java.util.Map<String,org.eclipse.fx.core.text.Formatter<?>> formatterMap = new java.util.HashMap<>();
formatterMap.put("myformatter",cust_myformatter);
return org.eclipse.fx.core.text.MessageFormatter.create(dataMap::get,formatterMap::get).apply( CustFormatText() );
}
- public Supplier<String> CustFormatText_supplier(Number val) {
+ public java.util.function.Supplier<String> CustFormatText_supplier(Number val) {
return () -> CustFormatText(val);
}
@@ -96,7 +89,7 @@ public class SamplePartMessagesRegistry extends AbstractMessageRegistry<SamplePa
return bundle_BasicMessages.BasicDyn(val);
}
- public Supplier<String> ReferenceDyn_supplier(Object val) {
+ public java.util.function.Supplier<String> ReferenceDyn_supplier(Object val) {
return () -> ReferenceDyn(val);
}
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages_de.properties b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages_de.properties
index c14bb1dcb..9b9448069 100644
--- a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages_de.properties
+++ b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages_de.properties
@@ -1,3 +1,6 @@
+#
+# Do not modify - Auto generated from Message.l10n
+#
SimpleText = Hallo Welt
SimpleDateText = Hallo Welt am ${now,-date,dd.MM.yyyy}
SimpleNumberText = Hallo Welt ${val,-number,#,##0} mal
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages_en.properties b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages_en.properties
index fada4e619..bb4a273a1 100644
--- a/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages_en.properties
+++ b/demos/org.eclipse.fx.testcases.l10n.app/src-gen/org/eclipse/fx/testcases/l10n/app/SamplePartMessages_en.properties
@@ -1,3 +1,6 @@
+#
+# Do not modify - Auto generated from Message.l10n
+#
SimpleText = Hello World
SimpleDateText = Hello World on ${now,-date,MMM/dd/yyyy}
SimpleNumberText = Hello World ${val,-number,#,##0} times
diff --git a/demos/org.eclipse.fx.testcases.l10n.app/src/org/eclipse/fx/testcases/l10n/app/Message.l10n b/demos/org.eclipse.fx.testcases.l10n.app/src/org/eclipse/fx/testcases/l10n/app/Message.l10n
index 8939009f6..c35d6f499 100644
--- a/demos/org.eclipse.fx.testcases.l10n.app/src/org/eclipse/fx/testcases/l10n/app/Message.l10n
+++ b/demos/org.eclipse.fx.testcases.l10n.app/src/org/eclipse/fx/testcases/l10n/app/Message.l10n
@@ -8,7 +8,7 @@ package org.eclipse.fx.testcases.l10n.app {
en : '''EN: «val»''',
de : '''DE: «val»'''
}
- }
+ }
bundle SamplePartMessages default en {
formatter myformatter org.eclipse.fx.testcases.l10n.app.MyFormatter
SimpleText : {
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
index b02039316..ee198d369 100644
--- 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
@@ -45,6 +45,13 @@ public class SamplePart {
b.getChildren().add(label);
}
+ {
+ Label label = new Label();
+ r.register(label::setText, r::ReferenceText);
+
+ b.getChildren().add(label);
+ }
+
parent.setTop(b);
}
}

Back to the top