Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2014-02-04 18:18:50 -0500
committerTom Schindl2014-02-04 18:18:50 -0500
commiteeb4bc5837a566a010428d2cd1ceed5496ccc444 (patch)
tree294a8bb2e35cd0cd923b7b3355859be2b0b724d0 /testcases
parent296bfeac885dee5a030eba65629d6bb519196e41 (diff)
downloadorg.eclipse.efxclipse-eeb4bc5837a566a010428d2cd1ceed5496ccc444.tar.gz
org.eclipse.efxclipse-eeb4bc5837a566a010428d2cd1ceed5496ccc444.tar.xz
org.eclipse.efxclipse-eeb4bc5837a566a010428d2cd1ceed5496ccc444.zip
adding sample for @fxmlloader
Diffstat (limited to 'testcases')
-rwxr-xr-xtestcases/org.eclipse.fx.testcases.e4/Application.e4xmi1
-rwxr-xr-xtestcases/org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.product7
-rw-r--r--testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/ModelViewAddon.java30
-rw-r--r--testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/handlers/CloseWorkbench.java25
-rw-r--r--testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/TestFXML.fxml9
-rw-r--r--testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/TestFXMLBuilder.java25
6 files changed, 97 insertions, 0 deletions
diff --git a/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi b/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi
index d0422e5fa..657d9d2a0 100755
--- a/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi
+++ b/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi
@@ -44,6 +44,7 @@
<children xsi:type="basic:Part" xmi:id="_7H_jwBmWEeOe294q4QTZJg" elementId="org.eclipse.fx.testcases.e4.part.15" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.parts.TestPane" label="VBox Pane">
<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>
<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/org.eclipse.fx.testcases.e4.product b/testcases/org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.product
index dd43ef0d7..2b3b19e23 100755
--- a/testcases/org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.product
+++ b/testcases/org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.product
@@ -28,6 +28,7 @@
<plugin id="javax.annotation"/>
<plugin id="javax.inject"/>
<plugin id="javax.xml"/>
+ <plugin id="org.apache.commons.lang"/>
<plugin id="org.apache.commons.logging"/>
<plugin id="org.eclipse.core.commands"/>
<plugin id="org.eclipse.core.contenttype"/>
@@ -51,9 +52,11 @@
<plugin id="org.eclipse.e4.ui.workbench"/>
<plugin id="org.eclipse.emf.common"/>
<plugin id="org.eclipse.emf.databinding"/>
+ <plugin id="org.eclipse.emf.databinding.edit"/>
<plugin id="org.eclipse.emf.ecore"/>
<plugin id="org.eclipse.emf.ecore.change"/>
<plugin id="org.eclipse.emf.ecore.xmi"/>
+ <plugin id="org.eclipse.emf.edit"/>
<plugin id="org.eclipse.equinox.app"/>
<plugin id="org.eclipse.equinox.common"/>
<plugin id="org.eclipse.equinox.concurrent"/>
@@ -64,6 +67,9 @@
<plugin id="org.eclipse.equinox.util"/>
<plugin id="org.eclipse.fx.core"/>
<plugin id="org.eclipse.fx.core.databinding"/>
+ <plugin id="org.eclipse.fx.core.di"/>
+ <plugin id="org.eclipse.fx.core.di.context"/>
+ <plugin id="org.eclipse.fx.emf.databinding"/>
<plugin id="org.eclipse.fx.javafx"/>
<plugin id="org.eclipse.fx.osgi" fragment="true"/>
<plugin id="org.eclipse.fx.osgi.util"/>
@@ -76,6 +82,7 @@
<plugin id="org.eclipse.fx.ui.keybindings.e4"/>
<plugin id="org.eclipse.fx.ui.keybindings.generic"/>
<plugin id="org.eclipse.fx.ui.lifecycle"/>
+ <plugin id="org.eclipse.fx.ui.modelviewer"/>
<plugin id="org.eclipse.fx.ui.panes"/>
<plugin id="org.eclipse.fx.ui.services"/>
<plugin id="org.eclipse.fx.ui.theme"/>
diff --git a/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/ModelViewAddon.java b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/ModelViewAddon.java
new file mode 100644
index 000000000..88912ef2c
--- /dev/null
+++ b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/ModelViewAddon.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2013 BestSolution.at and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.testcases.e4;
+
+import javax.annotation.PostConstruct;
+
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.ui.model.application.MApplication;
+import org.eclipse.fx.ui.modelviewer.ModelProvider;
+
+public class ModelViewAddon {
+ @PostConstruct
+ void init(final IEclipseContext ctx) {
+ ctx.set(ModelProvider.class, new ModelProvider() {
+
+ @Override
+ public MApplication getApplication() {
+ return ctx.get(MApplication.class);
+ }
+ });
+ }
+}
diff --git a/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/handlers/CloseWorkbench.java b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/handlers/CloseWorkbench.java
new file mode 100644
index 000000000..976222a3b
--- /dev/null
+++ b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/handlers/CloseWorkbench.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2014 __COMPANY/CONTRIBUTOR__ and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * tomschindl<__EMAIL__> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.testcases.e4.handlers;
+
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.workbench.IWorkbench;
+
+/**
+ * @author tomschindl
+ *
+ */
+public class CloseWorkbench {
+ @Execute
+ void close(IWorkbench w) {
+ w.close();
+ }
+}
diff --git a/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/TestFXML.fxml b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/TestFXML.fxml
new file mode 100644
index 000000000..d87459b52
--- /dev/null
+++ b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/TestFXML.fxml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.scene.layout.HBox?>
+<?import javafx.scene.control.Button?>
+
+<HBox xmlns:fx="http://javafx.com/fxml">
+ <Button text="Hello World"></Button>
+</HBox>
+
diff --git a/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/TestFXMLBuilder.java b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/TestFXMLBuilder.java
new file mode 100644
index 000000000..b4f62eb87
--- /dev/null
+++ b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/TestFXMLBuilder.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 TestFXMLBuilder {
+ @PostConstruct
+ public void init(BorderPane p, @FXMLLoader FXMLLoaderFactory factory) {
+ FXMLBuilder<Node> b = factory.loadRequestorRelative("TestFXML.fxml");
+ try {
+ p.setCenter(b.load());
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+}

Back to the top