Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2014-02-04 18:30:51 -0500
committerTom Schindl2014-02-04 18:30:51 -0500
commit4aa4367f214a5597cb0a0794a1b2e010e885f5ac (patch)
tree627835a69defdb11284a2e42f38acc33134d0946 /testcases
parenteeb4bc5837a566a010428d2cd1ceed5496ccc444 (diff)
downloadorg.eclipse.efxclipse-4aa4367f214a5597cb0a0794a1b2e010e885f5ac.tar.gz
org.eclipse.efxclipse-4aa4367f214a5597cb0a0794a1b2e010e885f5ac.tar.xz
org.eclipse.efxclipse-4aa4367f214a5597cb0a0794a1b2e010e885f5ac.zip
Bug 427359 - Add support to the ExtendedXMLLoader from the
FXMLLoaderFactory
Diffstat (limited to 'testcases')
-rwxr-xr-xtestcases/org.eclipse.fx.testcases.e4/Application.e4xmi1
-rwxr-xr-xtestcases/org.eclipse.fx.testcases.e4/META-INF/MANIFEST.MF3
-rw-r--r--testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/TestExtendedFXMLBuilder.java25
-rw-r--r--testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/TestFXML.java27
4 files changed, 55 insertions, 1 deletions
diff --git a/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi b/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi
index 657d9d2a0..f15c2fa38 100755
--- a/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi
+++ b/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi
@@ -45,6 +45,7 @@
<tags>Container:VBox</tags>
</children>
<children xsi:type="basic:Part" xmi:id="_UXm2oI3yEeOEhJYRfEsdog" elementId="org.eclipse.fx.testcases.e4.part.17" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.parts.TestFXMLBuilder" label="FXMLLoader"/>
+ <children xsi:type="basic:Part" xmi:id="_NbT9cI3zEeOEhJYRfEsdog" elementId="org.eclipse.fx.testcases.e4.part.18" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.parts.TestExtendedFXMLBuilder" label="ExtendedFXMLLoader"/>
</children>
<children xsi:type="basic:Part" xmi:id="_txxY4OMsEeGP-5z69KadAQ" elementId="org.eclipse.fx.testcases.e4.part.4" toBeRendered="false" containerData="10" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.parts.ContentPanel" label="C4"/>
</children>
diff --git a/testcases/org.eclipse.fx.testcases.e4/META-INF/MANIFEST.MF b/testcases/org.eclipse.fx.testcases.e4/META-INF/MANIFEST.MF
index 2bc585cfd..e8ab01fb7 100755
--- a/testcases/org.eclipse.fx.testcases.e4/META-INF/MANIFEST.MF
+++ b/testcases/org.eclipse.fx.testcases.e4/META-INF/MANIFEST.MF
@@ -30,7 +30,8 @@ Require-Bundle: org.eclipse.e4.ui.model.workbench;bundle-version="0.10.1",
org.eclipse.e4.core.commands,
org.eclipse.core.commands,
org.eclipse.fx.ui.modelviewer;bundle-version="1.0.0",
- org.eclipse.osgi.services;bundle-version="3.3.100"
+ org.eclipse.osgi.services;bundle-version="3.3.100",
+ org.eclipse.fx.core;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Import-Package: javafx.animation;version="2.0.0",
javafx.application;version="2.0.0",
diff --git a/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/TestExtendedFXMLBuilder.java b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/TestExtendedFXMLBuilder.java
new file mode 100644
index 000000000..7ee6b7482
--- /dev/null
+++ b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/TestExtendedFXMLBuilder.java
@@ -0,0 +1,25 @@
+package org.eclipse.fx.testcases.e4.parts;
+
+import java.io.IOException;
+
+import javafx.scene.Node;
+import javafx.scene.layout.BorderPane;
+
+import javax.annotation.PostConstruct;
+
+import org.eclipse.fx.ui.di.FXMLBuilder;
+import org.eclipse.fx.ui.di.FXMLLoader;
+import org.eclipse.fx.ui.di.FXMLLoaderFactory;
+
+public class TestExtendedFXMLBuilder {
+ @PostConstruct
+ public void init(BorderPane p, @FXMLLoader(useExtendedLoader = true) FXMLLoaderFactory factory) {
+ FXMLBuilder<Node> b = factory.loadRequestorRelative("TestFXML.fxml");
+ try {
+ p.setCenter(b.load());
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/TestFXML.java b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/TestFXML.java
new file mode 100644
index 000000000..733988f03
--- /dev/null
+++ b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/TestFXML.java
@@ -0,0 +1,27 @@
+package org.eclipse.fx.testcases.e4.parts;
+
+import java.net.URL;
+import java.util.ResourceBundle;
+
+import javafx.scene.control.Button;
+import javafx.scene.layout.HBox;
+import javafx.util.Callback;
+
+import org.eclipse.fx.core.fxml.FXMLDocument;
+
+public class TestFXML extends FXMLDocument<HBox> {
+
+ @Override
+ public HBox load(URL location, ResourceBundle bundle,
+ Callback<Class<?>, Object> controllerFactory) {
+ HBox b = new HBox();
+ b.getChildren().add(new Button("This is the Java class"));
+ return b;
+ }
+
+ @Override
+ public Object getController() {
+ return null;
+ }
+
+}

Back to the top