Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Hein2014-11-04 08:58:54 +0000
committerMarcel Hein2014-11-04 08:58:54 +0000
commit7f6545e337143f4e45064fab17baa8a724a805cd (patch)
treef680265d378753157a5eec685eecc5ba93e62071 /org.eclipse.jubula.examples.extension.javafx.rc.container
parent7a86baa1a0d277ce49acca936352379a26db0fd6 (diff)
downloadorg.eclipse.jubula.core-7f6545e337143f4e45064fab17baa8a724a805cd.tar.gz
org.eclipse.jubula.core-7f6545e337143f4e45064fab17baa8a724a805cd.tar.xz
org.eclipse.jubula.core-7f6545e337143f4e45064fab17baa8a724a805cd.zip
Sprint Task: Document extension mechanism for containers for JavaFX toolkit
Diffstat (limited to 'org.eclipse.jubula.examples.extension.javafx.rc.container')
-rw-r--r--org.eclipse.jubula.examples.extension.javafx.rc.container/.classpath7
-rw-r--r--org.eclipse.jubula.examples.extension.javafx.rc.container/.gitignore3
-rw-r--r--org.eclipse.jubula.examples.extension.javafx.rc.container/.project28
-rw-r--r--org.eclipse.jubula.examples.extension.javafx.rc.container/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--org.eclipse.jubula.examples.extension.javafx.rc.container/.settings/org.eclipse.pde.core.prefs3
-rw-r--r--org.eclipse.jubula.examples.extension.javafx.rc.container/META-INF/MANIFEST.MF8
-rw-r--r--org.eclipse.jubula.examples.extension.javafx.rc.container/build.properties6
-rw-r--r--org.eclipse.jubula.examples.extension.javafx.rc.container/pom.xml38
-rw-r--r--org.eclipse.jubula.examples.extension.javafx.rc.container/src/org/eclipse/jubula/rc/common/adapter/JavaFXContainerAdapterFactory.java41
-rw-r--r--org.eclipse.jubula.examples.extension.javafx.rc.container/src/org/eclipse/jubula/rc/javafx/tester/adapter/CustomContainerAdapter.java45
10 files changed, 186 insertions, 0 deletions
diff --git a/org.eclipse.jubula.examples.extension.javafx.rc.container/.classpath b/org.eclipse.jubula.examples.extension.javafx.rc.container/.classpath
new file mode 100644
index 000000000..eca7bdba8
--- /dev/null
+++ b/org.eclipse.jubula.examples.extension.javafx.rc.container/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.jubula.examples.extension.javafx.rc.container/.gitignore b/org.eclipse.jubula.examples.extension.javafx.rc.container/.gitignore
new file mode 100644
index 000000000..64af1f50f
--- /dev/null
+++ b/org.eclipse.jubula.examples.extension.javafx.rc.container/.gitignore
@@ -0,0 +1,3 @@
+/build
+/bin
+/target
diff --git a/org.eclipse.jubula.examples.extension.javafx.rc.container/.project b/org.eclipse.jubula.examples.extension.javafx.rc.container/.project
new file mode 100644
index 000000000..7e951f9c2
--- /dev/null
+++ b/org.eclipse.jubula.examples.extension.javafx.rc.container/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.jubula.examples.extension.javafx.rc.container</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.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.jubula.examples.extension.javafx.rc.container/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jubula.examples.extension.javafx.rc.container/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..0c68a61dc
--- /dev/null
+++ b/org.eclipse.jubula.examples.extension.javafx.rc.container/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+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.compliance=1.8
+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/org.eclipse.jubula.examples.extension.javafx.rc.container/.settings/org.eclipse.pde.core.prefs b/org.eclipse.jubula.examples.extension.javafx.rc.container/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 000000000..f29e940a0
--- /dev/null
+++ b/org.eclipse.jubula.examples.extension.javafx.rc.container/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/org.eclipse.jubula.examples.extension.javafx.rc.container/META-INF/MANIFEST.MF b/org.eclipse.jubula.examples.extension.javafx.rc.container/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..88a6ec588
--- /dev/null
+++ b/org.eclipse.jubula.examples.extension.javafx.rc.container/META-INF/MANIFEST.MF
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Jubula Extension Example - JavaFX - RC - Container
+Bundle-SymbolicName: org.eclipse.jubula.examples.extension.javafx.rc.container
+Bundle-Version: 2.4.0.qualifier
+Fragment-Host: org.eclipse.jubula.rc.javafx;bundle-version="2.3.0"
+Bundle-Vendor: Eclipse Jubula
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
diff --git a/org.eclipse.jubula.examples.extension.javafx.rc.container/build.properties b/org.eclipse.jubula.examples.extension.javafx.rc.container/build.properties
new file mode 100644
index 000000000..3d8184e22
--- /dev/null
+++ b/org.eclipse.jubula.examples.extension.javafx.rc.container/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+javaSource = 1.8
+javaTarget = 1.8
+bin.includes = META-INF/,\
+ .
diff --git a/org.eclipse.jubula.examples.extension.javafx.rc.container/pom.xml b/org.eclipse.jubula.examples.extension.javafx.rc.container/pom.xml
new file mode 100644
index 000000000..46718f3fa
--- /dev/null
+++ b/org.eclipse.jubula.examples.extension.javafx.rc.container/pom.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <relativePath>../org.eclipse.jubula.examples.extension.releng</relativePath>
+ <groupId>org.eclipse.jubula</groupId>
+ <artifactId>org.eclipse.jubula.examples.extension.releng</artifactId>
+ <version>2.4.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.jubula.examples.extension.javafx.rc.container</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-compiler-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <configuration>
+ <!-- add JavaFX to classpath -->
+ <extraClasspathElements>
+ <extraClasspathElement>
+ <groupId>com.oracle</groupId>
+ <artifactId>javafx</artifactId>
+ <version>8.1.0-SNAPSHOT</version>
+ <systemPath>path/to/java8/jre/lib/ext/jfxrt.jar</systemPath>
+ <scope>system</scope>
+ </extraClasspathElement>
+ </extraClasspathElements>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project> \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.extension.javafx.rc.container/src/org/eclipse/jubula/rc/common/adapter/JavaFXContainerAdapterFactory.java b/org.eclipse.jubula.examples.extension.javafx.rc.container/src/org/eclipse/jubula/rc/common/adapter/JavaFXContainerAdapterFactory.java
new file mode 100644
index 000000000..77d8bce15
--- /dev/null
+++ b/org.eclipse.jubula.examples.extension.javafx.rc.container/src/org/eclipse/jubula/rc/common/adapter/JavaFXContainerAdapterFactory.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2014 BREDEX GmbH.
+ * 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:
+ * BREDEX GmbH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jubula.rc.common.adapter;
+
+import javafx.scene.control.ListCell;
+
+import org.eclipse.jubula.rc.common.adaptable.IAdapterFactory;
+import org.eclipse.jubula.rc.javafx.tester.adapter.CustomContainerAdapter;
+import org.eclipse.jubula.rc.javafx.tester.adapter.IContainerAdapter;
+
+
+/**
+ * Adapter Factory for new adapters. This class makes your new adapters usable
+ * for testing. One factory could be used for all adapters implemented.
+ *
+ * @author BREDEX GmbH
+ */
+public class JavaFXContainerAdapterFactory implements IAdapterFactory {
+ /** {@inheritDoc} */
+ public Class[] getSupportedClasses() {
+ return new Class[] { ListCell.class };
+ }
+
+ /** {@inheritDoc} */
+ public Object getAdapter(Class targetedClass, Object objectToAdapt) {
+ if (targetedClass.isAssignableFrom(IContainerAdapter.class)) {
+ if (objectToAdapt instanceof ListCell) {
+ return new CustomContainerAdapter((ListCell<?>) objectToAdapt);
+ }
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.jubula.examples.extension.javafx.rc.container/src/org/eclipse/jubula/rc/javafx/tester/adapter/CustomContainerAdapter.java b/org.eclipse.jubula.examples.extension.javafx.rc.container/src/org/eclipse/jubula/rc/javafx/tester/adapter/CustomContainerAdapter.java
new file mode 100644
index 000000000..269fba339
--- /dev/null
+++ b/org.eclipse.jubula.examples.extension.javafx.rc.container/src/org/eclipse/jubula/rc/javafx/tester/adapter/CustomContainerAdapter.java
@@ -0,0 +1,45 @@
+package org.eclipse.jubula.rc.javafx.tester.adapter;
+
+import java.util.List;
+import java.util.concurrent.Callable;
+
+import javafx.beans.property.ReadOnlyObjectProperty;
+import javafx.scene.Node;
+import javafx.scene.control.ListCell;
+import javafx.stage.Window;
+
+import org.eclipse.jubula.rc.javafx.driver.EventThreadQueuerJavaFXImpl;
+
+public class CustomContainerAdapter<T extends ListCell<?>> extends
+ AbstractComponentAdapter<T> implements IContainerAdapter {
+
+ public CustomContainerAdapter(T objectToAdapt) {
+ super(objectToAdapt);
+ }
+
+ @Override
+ public List<Node> getContent() {
+ return EventThreadQueuerJavaFXImpl.invokeAndWait("getContent",
+ new Callable<List<Node>>() {
+
+ @Override
+ public List<Node> call() throws Exception {
+ return getRealComponent().getChildrenUnmodifiable();
+ }
+ });
+ }
+
+ @Override
+ public ReadOnlyObjectProperty<? extends Window> getWindow() {
+ return EventThreadQueuerJavaFXImpl.invokeAndWait("getContent",
+ new Callable<ReadOnlyObjectProperty<? extends Window>>() {
+
+ @Override
+ public ReadOnlyObjectProperty<? extends Window> call()
+ throws Exception {
+ return getRealComponent().getScene().windowProperty();
+ }
+ });
+ }
+
+}

Back to the top