Skip to main content
summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorTom Schindl2014-10-02 16:53:46 -0400
committerTom Schindl2014-10-02 16:53:46 -0400
commit55380e3b65521565f4dc836a69b1b908a7f2886c (patch)
treeb9b1542a39c8945feb03ae84827503b7f768104d /demos
parent3bd9848e91d9f9037c72ffe9ca9a6a593f8dd5b2 (diff)
downloadorg.eclipse.efxclipse-55380e3b65521565f4dc836a69b1b908a7f2886c.tar.gz
org.eclipse.efxclipse-55380e3b65521565f4dc836a69b1b908a7f2886c.tar.xz
org.eclipse.efxclipse-55380e3b65521565f4dc836a69b1b908a7f2886c.zip
added sample which shows usage of the fxml-compiler
Diffstat (limited to 'demos')
-rw-r--r--demos/org.eclipse.fx.samples.fxml.compiler/.classpath9
-rw-r--r--demos/org.eclipse.fx.samples.fxml.compiler/.gitignore1
-rw-r--r--demos/org.eclipse.fx.samples.fxml.compiler/.project23
-rw-r--r--demos/org.eclipse.fx.samples.fxml.compiler/.settings/org.eclipse.jdt.core.prefs11
-rw-r--r--demos/org.eclipse.fx.samples.fxml.compiler/blibs/org.eclipse.fx.fxml.compiler_1.0.0-SNAPSHOT.jarbin0 -> 19750024 bytes
-rw-r--r--demos/org.eclipse.fx.samples.fxml.compiler/build.fxbuild8
-rw-r--r--demos/org.eclipse.fx.samples.fxml.compiler/build/build.xml135
-rw-r--r--demos/org.eclipse.fx.samples.fxml.compiler/fxml-build.xml21
-rw-r--r--demos/org.eclipse.fx.samples.fxml.compiler/rlibs/org.eclipse.fx.core.fxml_1.0.0.201409260602.jarbin0 -> 17055 bytes
-rw-r--r--demos/org.eclipse.fx.samples.fxml.compiler/src-gen/.gitignore1
-rw-r--r--demos/org.eclipse.fx.samples.fxml.compiler/src-gen/dummy.txt0
-rw-r--r--demos/org.eclipse.fx.samples.fxml.compiler/src/application/Main.java29
-rw-r--r--demos/org.eclipse.fx.samples.fxml.compiler/src/application/Sample.fxml10
-rw-r--r--demos/org.eclipse.fx.samples.fxml.compiler/src/application/SampleController.java15
-rw-r--r--demos/org.eclipse.fx.samples.fxml.compiler/src/application/application.css0
15 files changed, 263 insertions, 0 deletions
diff --git a/demos/org.eclipse.fx.samples.fxml.compiler/.classpath b/demos/org.eclipse.fx.samples.fxml.compiler/.classpath
new file mode 100644
index 000000000..43aba254d
--- /dev/null
+++ b/demos/org.eclipse.fx.samples.fxml.compiler/.classpath
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src-gen"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/Java SE 8 [1.8.0]"/>
+ <classpathentry kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER"/>
+ <classpathentry kind="lib" path="rlibs/org.eclipse.fx.core.fxml_1.0.0.201409260602.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/demos/org.eclipse.fx.samples.fxml.compiler/.gitignore b/demos/org.eclipse.fx.samples.fxml.compiler/.gitignore
new file mode 100644
index 000000000..ae3c17260
--- /dev/null
+++ b/demos/org.eclipse.fx.samples.fxml.compiler/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/demos/org.eclipse.fx.samples.fxml.compiler/.project b/demos/org.eclipse.fx.samples.fxml.compiler/.project
new file mode 100644
index 000000000..e47522002
--- /dev/null
+++ b/demos/org.eclipse.fx.samples.fxml.compiler/.project
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.fx.samples.fxml.compiler</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/demos/org.eclipse.fx.samples.fxml.compiler/.settings/org.eclipse.jdt.core.prefs b/demos/org.eclipse.fx.samples.fxml.compiler/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..3a2153707
--- /dev/null
+++ b/demos/org.eclipse.fx.samples.fxml.compiler/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/demos/org.eclipse.fx.samples.fxml.compiler/blibs/org.eclipse.fx.fxml.compiler_1.0.0-SNAPSHOT.jar b/demos/org.eclipse.fx.samples.fxml.compiler/blibs/org.eclipse.fx.fxml.compiler_1.0.0-SNAPSHOT.jar
new file mode 100644
index 000000000..596477242
--- /dev/null
+++ b/demos/org.eclipse.fx.samples.fxml.compiler/blibs/org.eclipse.fx.fxml.compiler_1.0.0-SNAPSHOT.jar
Binary files differ
diff --git a/demos/org.eclipse.fx.samples.fxml.compiler/build.fxbuild b/demos/org.eclipse.fx.samples.fxml.compiler/build.fxbuild
new file mode 100644
index 000000000..ce923818f
--- /dev/null
+++ b/demos/org.eclipse.fx.samples.fxml.compiler/build.fxbuild
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ASCII"?>
+<anttasks:AntTask xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:anttasks="http://org.eclipse.fx.ide.jdt/1.0" buildDirectory="${project}/build">
+ <deploy>
+ <application name="org.eclipse.fx.samples.fxml.compiler"/>
+ <info/>
+ </deploy>
+ <signjar/>
+</anttasks:AntTask>
diff --git a/demos/org.eclipse.fx.samples.fxml.compiler/build/build.xml b/demos/org.eclipse.fx.samples.fxml.compiler/build/build.xml
new file mode 100644
index 000000000..9e5377fc6
--- /dev/null
+++ b/demos/org.eclipse.fx.samples.fxml.compiler/build/build.xml
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <project name="org.eclipse.fx.samples.fxml.compiler" default="do-deploy" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
+ <target name="init-fx-tasks">
+ <path id="fxant">
+ <filelist>
+ <file name="${java.home}\..\lib\ant-javafx.jar"/>
+ <file name="${java.home}\lib\jfxrt.jar"/>
+ </filelist>
+ </path>
+
+ <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
+ uri="javafx:com.sun.javafx.tools.ant"
+ classpathref="fxant"/>
+ </target>
+ <target name="setup-staging-area">
+ <delete dir="externalLibs" />
+ <delete dir="project" />
+ <delete dir="projectRefs" />
+
+ <mkdir dir="externalLibs" />
+
+ <copy todir="externalLibs">
+ <fileset dir="/Users/tomschindl/Documents/e-workspaces/efxclipse_luna/org.eclipse.fx.samples.fxml.compiler/rlibs">
+ <filename name="org.eclipse.fx.core.fxml_1.0.0.201409260602.jar"/>
+ </fileset>
+ </copy>
+
+ <mkdir dir="project" />
+ <copy todir="project">
+ <fileset dir="/Users/tomschindl/Documents/e-workspaces/efxclipse_luna/org.eclipse.fx.samples.fxml.compiler">
+ <include name="src-gen/**" />
+ </fileset>
+ </copy>
+ <copy todir="project">
+ <fileset dir="/Users/tomschindl/Documents/e-workspaces/efxclipse_luna/org.eclipse.fx.samples.fxml.compiler">
+ <include name="src/**" />
+ </fileset>
+ </copy>
+
+ <mkdir dir="projectRefs" />
+ </target>
+ <target name='do-compile'>
+ <delete dir="build" />
+ <mkdir dir="build/src" />
+ <mkdir dir="build/libs" />
+ <mkdir dir="build/classes" />
+
+ <!-- Copy project-libs references -->
+ <copy todir="build/libs">
+ <fileset dir="externalLibs">
+ <include name="org.eclipse.fx.core.fxml_1.0.0.201409260602.jar"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy project references -->
+
+ <!-- Copy project sources itself -->
+ <copy todir="build/src">
+ <fileset dir="project/src">
+ <include name="**/*"/>
+ </fileset>
+ </copy>
+ <copy todir="build/src">
+ <fileset dir="project/src-gen">
+ <include name="**/*"/>
+ </fileset>
+ </copy>
+
+ <javac includeantruntime="false" source="1.8" target="1.8" srcdir="build/src" destdir="build/classes" encoding="UTF-8">
+ <classpath>
+ <fileset dir="build/libs">
+ <include name="*"/>
+ </fileset>
+ </classpath>
+ </javac>
+
+ <!-- Copy over none Java-Files -->
+ <copy todir="build/classes">
+ <fileset dir="project/src">
+ <exclude name="**/*.java"/>
+ </fileset>
+ <fileset dir="project/src-gen">
+ <exclude name="**/*.java"/>
+ </fileset>
+ </copy>
+
+
+ </target>
+ <target name="do-deploy" depends="setup-staging-area, do-compile, init-fx-tasks">
+ <delete file="dist"/>
+ <delete file="deploy" />
+
+ <mkdir dir="dist" />
+ <mkdir dir="dist/libs" />
+
+ <copy todir="dist/libs">
+ <fileset dir="externalLibs">
+ <include name="*" />
+ </fileset>
+ </copy>
+
+
+ <fx:resources id="appRes">
+ <fx:fileset dir="dist" includes="org.eclipse.fx.samples.fxml.compiler.jar"/>
+ <fx:fileset dir="dist" includes="libs/*"/>
+ </fx:resources>
+
+ <fx:application id="fxApplication"
+ name=""
+ mainClass=""
+ />
+
+ <mkdir dir="build/classes/META-INF" />
+
+
+
+ <fx:jar destfile="dist/org.eclipse.fx.samples.fxml.compiler.jar">
+ <fx:application refid="fxApplication"/>
+ <fileset dir="build/classes">
+ </fileset>
+ <fx:resources refid="appRes"/>
+
+ <manifest>
+ <attribute name="Implementation-Vendor" value=""/>
+ <attribute name="Implementation-Title" value=""/>
+ <attribute name="Implementation-Version" value=""/>
+ <attribute name="JavaFX-Feature-Proxy" value="None"/>
+ </manifest>
+ </fx:jar>
+
+
+
+
+ </target>
+</project>
diff --git a/demos/org.eclipse.fx.samples.fxml.compiler/fxml-build.xml b/demos/org.eclipse.fx.samples.fxml.compiler/fxml-build.xml
new file mode 100644
index 000000000..12ee3262f
--- /dev/null
+++ b/demos/org.eclipse.fx.samples.fxml.compiler/fxml-build.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="project" default="default">
+
+ <description>
+ description
+ </description>
+
+ <path id="fxcompile">
+ <filelist>
+ <file name="bin" />
+ <file name="blibs/org.eclipse.fx.fxml.compiler_1.0.0-SNAPSHOT.jar" />
+ </filelist>
+ </path>
+
+ <taskdef name="fxml-compiler" classpathref="fxcompile" classname="org.eclipse.fx.ide.fxml.compiler.ant.FXMLCompilerTask" />
+
+ <target name="default" description="Generate Java Code from FXML">
+ <fxml-compiler sourcedir="src" destdir="src-gen"/>
+ </target>
+
+</project>
diff --git a/demos/org.eclipse.fx.samples.fxml.compiler/rlibs/org.eclipse.fx.core.fxml_1.0.0.201409260602.jar b/demos/org.eclipse.fx.samples.fxml.compiler/rlibs/org.eclipse.fx.core.fxml_1.0.0.201409260602.jar
new file mode 100644
index 000000000..2c83dcd79
--- /dev/null
+++ b/demos/org.eclipse.fx.samples.fxml.compiler/rlibs/org.eclipse.fx.core.fxml_1.0.0.201409260602.jar
Binary files differ
diff --git a/demos/org.eclipse.fx.samples.fxml.compiler/src-gen/.gitignore b/demos/org.eclipse.fx.samples.fxml.compiler/src-gen/.gitignore
new file mode 100644
index 000000000..b42b859b3
--- /dev/null
+++ b/demos/org.eclipse.fx.samples.fxml.compiler/src-gen/.gitignore
@@ -0,0 +1 @@
+/application/
diff --git a/demos/org.eclipse.fx.samples.fxml.compiler/src-gen/dummy.txt b/demos/org.eclipse.fx.samples.fxml.compiler/src-gen/dummy.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/demos/org.eclipse.fx.samples.fxml.compiler/src-gen/dummy.txt
diff --git a/demos/org.eclipse.fx.samples.fxml.compiler/src/application/Main.java b/demos/org.eclipse.fx.samples.fxml.compiler/src/application/Main.java
new file mode 100644
index 000000000..b2293b9f8
--- /dev/null
+++ b/demos/org.eclipse.fx.samples.fxml.compiler/src/application/Main.java
@@ -0,0 +1,29 @@
+package application;
+
+import javafx.application.Application;
+import javafx.scene.Scene;
+import javafx.scene.layout.BorderPane;
+import javafx.stage.Stage;
+
+import org.eclipse.fx.core.fxml.ExtendedFXMLLoader;
+
+
+public class Main extends Application {
+ @Override
+ public void start(Stage primaryStage) {
+ try {
+// BorderPane root = (BorderPane)FXMLLoader.load(getClass().getResource("Sample.fxml"));
+ BorderPane root = ExtendedFXMLLoader.load(getClass().getClassLoader(), "application/Sample.fxml");
+ Scene scene = new Scene(root,400,400);
+ scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
+ primaryStage.setScene(scene);
+ primaryStage.show();
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void main(String[] args) {
+ launch(args);
+ }
+}
diff --git a/demos/org.eclipse.fx.samples.fxml.compiler/src/application/Sample.fxml b/demos/org.eclipse.fx.samples.fxml.compiler/src/application/Sample.fxml
new file mode 100644
index 000000000..95fda099b
--- /dev/null
+++ b/demos/org.eclipse.fx.samples.fxml.compiler/src/application/Sample.fxml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.scene.layout.BorderPane?>
+<?import javafx.scene.control.Button?>
+
+<BorderPane xmlns:fx="http://javafx.com/fxml" fx:controller="application.SampleController">
+ <center>
+ <Button fx:id="myButton" text="Hello World" onAction="#helloWorld"></Button>
+ </center>
+</BorderPane>
diff --git a/demos/org.eclipse.fx.samples.fxml.compiler/src/application/SampleController.java b/demos/org.eclipse.fx.samples.fxml.compiler/src/application/SampleController.java
new file mode 100644
index 000000000..a6708d5fa
--- /dev/null
+++ b/demos/org.eclipse.fx.samples.fxml.compiler/src/application/SampleController.java
@@ -0,0 +1,15 @@
+package application;
+
+import javafx.fxml.FXML;
+import javafx.event.ActionEvent;
+import javafx.scene.control.Button;
+
+public class SampleController {
+
+ @FXML Button myButton;
+
+ @FXML public void helloWorld(ActionEvent event) {
+ myButton.setText("Wow you pressed the button");
+ }
+
+}
diff --git a/demos/org.eclipse.fx.samples.fxml.compiler/src/application/application.css b/demos/org.eclipse.fx.samples.fxml.compiler/src/application/application.css
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/demos/org.eclipse.fx.samples.fxml.compiler/src/application/application.css

Back to the top