changeset 0:10b22c885f3a

Initial JemmyFX commit
author shurailine
date Fri, 03 Feb 2012 18:46:04 +0400
parents
children 16deb0a5eb54
files tools/Jemmy/JemmyFX/build.properties tools/Jemmy/JemmyFX/build.xml tools/Jemmy/JemmyFX/fxclasspath.properties tools/Jemmy/JemmyFX/manifest.mf tools/Jemmy/JemmyFX/nbproject/build-impl.xml tools/Jemmy/JemmyFX/nbproject/genfiles.properties tools/Jemmy/JemmyFX/nbproject/project.properties tools/Jemmy/JemmyFX/nbproject/project.xml tools/Jemmy/JemmyFX/src/org/jemmy/fx/AppExecutor.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/ByID.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/ByObject.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/ByStyleClass.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/ByText.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/ByTitleSceneLookup.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/ByWindowType.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/CriteriaList.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/FXClickFocus.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/FXRelativeCoordinateLookup.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/Lookups.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/NodeHierarchy.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/NodeParent.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/NodeParentImpl.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/NodeWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/NodeWrapper.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/QueueExecutor.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/RelativeMouse.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/Root.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/SceneList.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/SceneWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/SceneWrapper.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/TextWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/WindowElement.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/AbstractItemsParent.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/AbstractMenuItemsParent.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ByIdMenuItem.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ByTextMenuItem.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/CheckBoxWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ChoiceBoxWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ComboBoxWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ControlWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/FXStringMenuOwner.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ItemParent.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ItemWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ListItemParent.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ListItemWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ListViewWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/MenuBarWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/MenuButtonWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/MenuItemWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/MenuTreeSelectorImpl.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/MenuWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ScrollBarWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/SelectableItemsParent.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/SeparatorWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/SliderWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/SplitPaneWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/StringMenuOwnerImpl.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TabPaneWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TabParent.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TabWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TableCellItemParent.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TableCellItemWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TableCellWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TableViewWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TextControlWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TextFieldCellEditor.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TextInputControlWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ThemeDriverFactory.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ToggleButtonWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ToolBarWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TreeImpl.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TreeItemParent.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TreeItemWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TreeNodeParent.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TreeNodeWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TreeViewWrap.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/caspian/CaspianDriverFactory.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/caspian/KnobTrackScrollerImpl.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/caspian/ScrollBarScroller.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/caspian/SliderScroller.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/caspian/TreeItem.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/jemmy.properties tools/Jemmy/JemmyFX/src/org/jemmy/input/ScrollTrack.java tools/Jemmy/JemmyFX/src/org/jemmy/interfaces/CellOwner.java tools/Jemmy/JemmyFX/src/org/jemmy/interfaces/Close.java tools/Jemmy/JemmyFX/src/org/jemmy/interfaces/Closer.java tools/Jemmy/JemmyFX/src/org/jemmy/interfaces/EditableCellOwner.java tools/Jemmy/JemmyFX/src/org/jemmy/interfaces/List.java tools/Jemmy/JemmyFX/src/org/jemmy/interfaces/Shiftable.java tools/Jemmy/JemmyFX/src/org/jemmy/interfaces/Shifter.java tools/Jemmy/JemmyFX/src/org/jemmy/interfaces/Table.java tools/Jemmy/JemmyFX/src/org/jemmy/interfaces/Tree.java tools/Jemmy/JemmyFX/src/org/jemmy/interfaces/TreeSelector.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/Controls.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/LookupTest.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/TestApp.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/control/ComboBoxApp.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/control/ComboBoxTest.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/control/ListApp.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/control/ListTest.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/control/MenuTest.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/control/ScrollBarApp.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/control/ScrollBarTest.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/control/TabApp.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/control/TabTest.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/control/TableViewApp.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/control/TableViewCellsParentTest.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/control/TableViewLookupTest.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/control/TreeApp.java tools/Jemmy/JemmyFX/test/org/jemmy/fx/control/TreeTest.java
diffstat 110 files changed, 12590 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/build.properties	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,2 @@
+#Mon, 30 Jan 2012 05:54:03 -0800
+javafx.home=/opt/FX/2.1.b60
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/build.xml	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="JemmyJC" default="default" basedir=".">
+    <description>Builds, tests, and runs the project JemmyJC.</description>
+    <import file="nbproject/build-impl.xml"/>
+
+    <target name="jar-full" depends="jar">
+        <property name="jar.name" location="${basedir}/dist/JemmyJCFull.jar"/>
+        <jar destfile="${jar.name}" filesetmanifest="merge">
+            <zipgroupfileset file="${reference.JemmyCore.jar}"/>
+            <zipgroupfileset file="${reference.JemmyAWTInput.jar}"/>
+            <zipgroupfileset file="${dist.jar}"/>
+        </jar>
+    </target>
+    <target name="jemmy-javadoc" depends="init">
+        <path id="javadoc.source.path.ref">
+            <pathelement path="${src.dir}"/>
+            <pathelement path="${project.JemmyCore}/src"/>
+            <pathelement path="${project.JemmyAWTInput}/src"/>
+        </path>
+        <property name="javadoc.src.path" refid="javadoc.source.path.ref"/>
+        <property name="javadoc.destdir" location="../www/javadoc"/>
+        <mkdir dir="${javadoc.destdir}"/>
+        <ant antfile="../../core/JemmyDoc/javadoc.xml" target="jemmy-javadoc"
+            inheritall="true"/>
+    </target>
+    <target name="-post-clean">
+        <delete dir="${basedir}/docks" failonerror="false"/>
+    </target>
+    <target name="-pre-compile" depends="copy-libs">
+        <delete file="${basedir}/build/classes/org/jemmy/fx/jemmy.properties" failonerror="false"/>
+        <!--delete dir="${basedir}/docks" failonerror="false"/-->
+        <mkdir dir="${basedir}/docks"/>
+    </target>
+    <target name="-post-compile">
+        <javac srcdir="${basedir}/docks" destdir="${build.classes.dir}" classpath="${javac.classpath}"/>
+        <echo message="Copying prop file"/>
+        <copy file="src/org/jemmy/fx/jemmy.properties" tofile="${basedir}/build/classes/org/jemmy/fx/jemmy.properties"/>
+        <tstamp/>
+        <echo message="build=${DSTAMP}${TSTAMP}" file="${basedir}/build/classes/org/jemmy/fx/jemmy.properties" append="true"/>
+    </target>
+    <target name="set-javafx-home" if="javafx.home">
+        <echo file="build.properties" message="javafx.home=${javafx.home}"/>
+    </target>
+    <target name="read-javafx-home" unless="javafx.home">
+        <property file="build.properties"/>
+    </target>
+    <target name="copy-libs" depends="set-javafx-home,read-javafx-home">
+        <fail unless="javafx.home" message="No javafx.home set and no build.properties file"/>
+        <echo message="javafx.home=${javafx.home}"/>
+        <copy todir="lib/lib">
+            <fileset dir="${javafx.home}/rt/lib"/>
+        </copy>
+        <copy todir="lib/bin">
+            <fileset dir="${javafx.home}/rt/bin"/>
+        </copy>
+        <property file="fxclasspath.properties"/>
+    </target>
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/fxclasspath.properties	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,2 @@
+file.reference.rt.jar=${javafx.home}/rt/lib/jfxrt.jar
+javafx.classpath=${file.reference.rt.jar}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/manifest.mf	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/nbproject/build-impl.xml	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,1137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT  ***
+***         EDIT ../build.xml INSTEAD         ***
+
+For the purpose of easier reading the script
+is divided into following sections:
+
+  - initialization
+  - compilation
+  - jar
+  - execution
+  - debugging
+  - javadoc
+  - junit compilation
+  - junit execution
+  - junit debugging
+  - applet
+  - cleanup
+
+        -->
+<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="JemmyFX-impl">
+    <fail message="Please build using Ant 1.8.0 or higher.">
+        <condition>
+            <not>
+                <antversion atleast="1.8.0"/>
+            </not>
+        </condition>
+    </fail>
+    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
+    <!-- 
+                ======================
+                INITIALIZATION SECTION 
+                ======================
+            -->
+    <target name="-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init" name="-init-private">
+        <property file="nbproject/private/config.properties"/>
+        <property file="nbproject/private/configs/${config}.properties"/>
+        <property file="nbproject/private/private.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private" name="-init-user">
+        <property file="${user.properties.file}"/>
+        <!-- The two properties below are usually overridden -->
+        <!-- by the active platform. Just a fallback. -->
+        <property name="default.javac.source" value="1.4"/>
+        <property name="default.javac.target" value="1.4"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user" name="-init-project">
+        <property file="nbproject/configs/${config}.properties"/>
+        <property file="nbproject/project.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
+        <j2seproject1:property name="platform.home" value="platforms.${platform.active}.home"/>
+        <j2seproject1:property name="platform.bootcp" value="platforms.${platform.active}.bootclasspath"/>
+        <j2seproject1:property name="platform.compiler" value="platforms.${platform.active}.compile"/>
+        <j2seproject1:property name="platform.javac.tmp" value="platforms.${platform.active}.javac"/>
+        <condition property="platform.javac" value="${platform.home}/bin/javac">
+            <equals arg1="${platform.javac.tmp}" arg2="$${platforms.${platform.active}.javac}"/>
+        </condition>
+        <property name="platform.javac" value="${platform.javac.tmp}"/>
+        <j2seproject1:property name="platform.java.tmp" value="platforms.${platform.active}.java"/>
+        <condition property="platform.java" value="${platform.home}/bin/java">
+            <equals arg1="${platform.java.tmp}" arg2="$${platforms.${platform.active}.java}"/>
+        </condition>
+        <property name="platform.java" value="${platform.java.tmp}"/>
+        <j2seproject1:property name="platform.javadoc.tmp" value="platforms.${platform.active}.javadoc"/>
+        <condition property="platform.javadoc" value="${platform.home}/bin/javadoc">
+            <equals arg1="${platform.javadoc.tmp}" arg2="$${platforms.${platform.active}.javadoc}"/>
+        </condition>
+        <property name="platform.javadoc" value="${platform.javadoc.tmp}"/>
+        <condition property="platform.invalid" value="true">
+            <or>
+                <contains string="${platform.javac}" substring="$${platforms."/>
+                <contains string="${platform.java}" substring="$${platforms."/>
+                <contains string="${platform.javadoc}" substring="$${platforms."/>
+            </or>
+        </condition>
+        <fail unless="platform.home">Must set platform.home</fail>
+        <fail unless="platform.bootcp">Must set platform.bootcp</fail>
+        <fail unless="platform.java">Must set platform.java</fail>
+        <fail unless="platform.javac">Must set platform.javac</fail>
+        <fail if="platform.invalid">
+ The J2SE Platform is not correctly set up.
+ Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files. 
+ Either open the project in the IDE and setup the Platform with the same name or add it manually.
+ For example like this:
+     ant -Duser.properties.file=&lt;path_to_property_file&gt; jar (where you put the property "platforms.${platform.active}.home" in a .properties file)
+  or ant -Dplatforms.${platform.active}.home=&lt;path_to_JDK_home&gt; jar (where no properties file is used) 
+  </fail>
+        <available file="${manifest.file}" property="manifest.available"/>
+        <condition property="splashscreen.available">
+            <and>
+                <not>
+                    <equals arg1="${application.splash}" arg2="" trim="true"/>
+                </not>
+                <available file="${application.splash}"/>
+            </and>
+        </condition>
+        <condition property="main.class.available">
+            <and>
+                <isset property="main.class"/>
+                <not>
+                    <equals arg1="${main.class}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="manifest.available+main.class">
+            <and>
+                <isset property="manifest.available"/>
+                <isset property="main.class.available"/>
+            </and>
+        </condition>
+        <condition property="do.archive">
+            <not>
+                <istrue value="${jar.archive.disabled}"/>
+            </not>
+        </condition>
+        <condition property="do.mkdist">
+            <and>
+                <isset property="do.archive"/>
+                <isset property="libs.CopyLibs.classpath"/>
+                <not>
+                    <istrue value="${mkdist.disabled}"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="manifest.available+main.class+mkdist.available">
+            <and>
+                <istrue value="${manifest.available+main.class}"/>
+                <isset property="do.mkdist"/>
+            </and>
+        </condition>
+        <condition property="do.archive+manifest.available">
+            <and>
+                <isset property="manifest.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+main.class.available">
+            <and>
+                <isset property="main.class.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+splashscreen.available">
+            <and>
+                <isset property="splashscreen.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+manifest.available+main.class">
+            <and>
+                <istrue value="${manifest.available+main.class}"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="manifest.available-mkdist.available">
+            <or>
+                <istrue value="${manifest.available}"/>
+                <isset property="do.mkdist"/>
+            </or>
+        </condition>
+        <condition property="manifest.available+main.class-mkdist.available">
+            <or>
+                <istrue value="${manifest.available+main.class}"/>
+                <isset property="do.mkdist"/>
+            </or>
+        </condition>
+        <condition property="have.tests">
+            <or>
+                <available file="${test.src.dir}"/>
+            </or>
+        </condition>
+        <condition property="have.sources">
+            <or>
+                <available file="${src.docks.dir}"/>
+                <available file="${src.dir}"/>
+            </or>
+        </condition>
+        <condition property="netbeans.home+have.tests">
+            <and>
+                <isset property="netbeans.home"/>
+                <isset property="have.tests"/>
+            </and>
+        </condition>
+        <condition property="no.javadoc.preview">
+            <and>
+                <isset property="javadoc.preview"/>
+                <isfalse value="${javadoc.preview}"/>
+            </and>
+        </condition>
+        <property name="run.jvmargs" value=""/>
+        <property name="javac.compilerargs" value=""/>
+        <property name="work.dir" value="${basedir}"/>
+        <condition property="no.deps">
+            <and>
+                <istrue value="${no.dependencies}"/>
+            </and>
+        </condition>
+        <property name="javac.debug" value="true"/>
+        <property name="javadoc.preview" value="true"/>
+        <property name="application.args" value=""/>
+        <property name="source.encoding" value="${file.encoding}"/>
+        <property name="runtime.encoding" value="${source.encoding}"/>
+        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
+            <and>
+                <isset property="javadoc.encoding"/>
+                <not>
+                    <equals arg1="${javadoc.encoding}" arg2=""/>
+                </not>
+            </and>
+        </condition>
+        <property name="javadoc.encoding.used" value="${source.encoding}"/>
+        <property name="includes" value="**"/>
+        <property name="excludes" value=""/>
+        <property name="do.depend" value="false"/>
+        <condition property="do.depend.true">
+            <istrue value="${do.depend}"/>
+        </condition>
+        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
+        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
+            <length length="0" string="${endorsed.classpath}" when="greater"/>
+        </condition>
+        <property name="jar.index" value="false"/>
+        <property name="jar.index.metainf" value="${jar.index}"/>
+        <property name="copylibs.rebase" value="true"/>
+        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
+    </target>
+    <target name="-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
+        <fail unless="src.docks.dir">Must set src.docks.dir</fail>
+        <fail unless="src.dir">Must set src.dir</fail>
+        <fail unless="test.src.dir">Must set test.src.dir</fail>
+        <fail unless="build.dir">Must set build.dir</fail>
+        <fail unless="dist.dir">Must set dist.dir</fail>
+        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
+        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
+        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
+        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
+        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
+        <fail unless="dist.jar">Must set dist.jar</fail>
+    </target>
+    <target name="-init-macrodef-property">
+        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${@{value}}"/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.docks.dir}:${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="sourcepath"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <mkdir dir="@{apgeneratedsrcdir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="yes" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <compilerarg value="-processorpath"/>
+                    <compilerarg path="@{processorpath}:${empty.dir}"/>
+                    <compilerarg line="${ap.processors.internal}"/>
+                    <compilerarg line="${annotation.processing.processor.options}"/>
+                    <compilerarg value="-s"/>
+                    <compilerarg path="@{apgeneratedsrcdir}"/>
+                    <compilerarg line="${ap.proc.none.internal}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.docks.dir}:${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="sourcepath"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="yes" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
+        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.docks.dir}:${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <sequential>
+                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </depend>
+            </sequential>
+        </macrodef>
+        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <sequential>
+                <fail unless="javac.includes">Must set javac.includes</fail>
+                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
+                    <path>
+                        <filelist dir="@{destdir}" files="${javac.includes}"/>
+                    </path>
+                    <globmapper from="*.java" to="*.class"/>
+                </pathconvert>
+                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
+                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
+                <delete>
+                    <files includesfile="${javac.includesfile.binary}"/>
+                </delete>
+                <delete>
+                    <fileset file="${javac.includesfile.binary}"/>
+                </delete>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-junit">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <sequential>
+                <property name="junit.forkmode" value="perTest"/>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}">
+                    <batchtest todir="${build.test.results.dir}">
+                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+                            <filename name="@{testincludes}"/>
+                        </fileset>
+                    </batchtest>
+                    <classpath>
+                        <path path="${run.test.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="-ea"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
+    <target name="-profile-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-profile-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-profile-init-macrodef-profile">
+        <macrodef name="resolve">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${env.@{value}}"/>
+            </sequential>
+        </macrodef>
+        <macrodef name="profile">
+            <attribute default="${main.class}" name="classname"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property environment="env"/>
+                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
+                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
+                    <jvmarg line="${profiler.info.jvmargs}"/>
+                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+                    <arg line="${application.args}"/>
+                    <classpath>
+                        <path path="${run.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
+        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
+        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
+    </target>
+    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
+        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${main.class}" name="name"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <attribute default="" name="stopclassname"/>
+            <sequential>
+                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <bootclasspath>
+                        <path path="${platform.bootcp}"/>
+                    </bootclasspath>
+                </nbjpdastart>
+            </sequential>
+        </macrodef>
+        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${build.classes.dir}" name="dir"/>
+            <sequential>
+                <nbjpdareload>
+                    <fileset dir="@{dir}" includes="${fix.classes}">
+                        <include name="${fix.includes}*.class"/>
+                    </fileset>
+                </nbjpdareload>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-debug-args">
+        <exec executable="${platform.java}" outputproperty="version-output">
+            <arg value="-version"/>
+        </exec>
+        <condition property="have-jdk-older-than-1.4">
+            <or>
+                <contains string="${version-output}" substring="java version &quot;1.0"/>
+                <contains string="${version-output}" substring="java version &quot;1.1"/>
+                <contains string="${version-output}" substring="java version &quot;1.2"/>
+                <contains string="${version-output}" substring="java version &quot;1.3"/>
+            </or>
+        </condition>
+        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
+            <istrue value="${have-jdk-older-than-1.4}"/>
+        </condition>
+        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
+            <os family="windows"/>
+        </condition>
+        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
+            <isset property="debug.transport"/>
+        </condition>
+    </target>
+    <target depends="-init-debug-args" name="-init-macrodef-debug">
+        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" fork="true" jvm="${platform.java}">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-java">
+        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${run.classpath}" name="classpath"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" fork="true" jvm="${platform.java}">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-copylibs">
+        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${manifest.file}" name="manifest"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+                <pathconvert property="run.classpath.without.build.classes.dir">
+                    <path path="${run.classpath}"/>
+                    <map from="${build.classes.dir.resolved}" to=""/>
+                </pathconvert>
+                <pathconvert pathsep=" " property="jar.classpath">
+                    <path path="${run.classpath.without.build.classes.dir}"/>
+                    <chainedmapper>
+                        <flattenmapper/>
+                        <globmapper from="*" to="lib/*"/>
+                    </chainedmapper>
+                </pathconvert>
+                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
+                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+                    <fileset dir="${build.classes.dir}"/>
+                    <manifest>
+                        <attribute name="Class-Path" value="${jar.classpath}"/>
+                        <customize/>
+                    </manifest>
+                </copylibs>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-presetdef-jar">
+        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
+                <j2seproject1:fileset dir="${build.classes.dir}"/>
+            </jar>
+        </presetdef>
+    </target>
+    <target name="-init-ap-cmdline-properties">
+        <property name="annotation.processing.enabled" value="true"/>
+        <property name="annotation.processing.processors.list" value=""/>
+        <property name="annotation.processing.processor.options" value=""/>
+        <property name="annotation.processing.run.all.processors" value="true"/>
+        <property name="javac.processorpath" value="${javac.classpath}"/>
+        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
+        <condition property="ap.supported.internal" value="true">
+            <not>
+                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
+            </not>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
+        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
+            <isfalse value="${annotation.processing.run.all.processors}"/>
+        </condition>
+        <condition else="" property="ap.proc.none.internal" value="-proc:none">
+            <isfalse value="${annotation.processing.enabled}"/>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
+        <property name="ap.cmd.line.internal" value=""/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
+    <!--
+                ===================
+                COMPILATION SECTION
+                ===================
+            -->
+    <target name="-deps-jar-init" unless="built-jar.properties">
+        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
+        <delete file="${built-jar.properties}" quiet="true"/>
+    </target>
+    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
+        <echo level="warn" message="Cycle detected: JemmyFX was already built"/>
+    </target>
+    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
+        <mkdir dir="${build.dir}"/>
+        <touch file="${built-jar.properties}" verbose="false"/>
+        <property file="${built-jar.properties}" prefix="already.built.jar."/>
+        <antcall target="-warn-already-built-jar"/>
+        <propertyfile file="${built-jar.properties}">
+            <entry key="${basedir}" value=""/>
+        </propertyfile>
+        <antcall target="-maybe-call-dep">
+            <param name="call.built.properties" value="${built-jar.properties}"/>
+            <param location="${project.JemmyAWT}" name="call.subproject"/>
+            <param location="${project.JemmyAWT}/build.xml" name="call.script"/>
+            <param name="call.target" value="jar"/>
+            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
+        </antcall>
+        <antcall target="-maybe-call-dep">
+            <param name="call.built.properties" value="${built-jar.properties}"/>
+            <param location="${project.JemmyAWTInput}" name="call.subproject"/>
+            <param location="${project.JemmyAWTInput}/build.xml" name="call.script"/>
+            <param name="call.target" value="jar"/>
+            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
+        </antcall>
+        <antcall target="-maybe-call-dep">
+            <param name="call.built.properties" value="${built-jar.properties}"/>
+            <param location="${project.JemmyCore}" name="call.subproject"/>
+            <param location="${project.JemmyCore}/build.xml" name="call.script"/>
+            <param name="call.target" value="jar"/>
+            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
+        </antcall>
+    </target>
+    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
+    <target depends="init" name="-check-automatic-build">
+        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
+    </target>
+    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
+        <antcall target="clean"/>
+    </target>
+    <target depends="init,deps-jar" name="-pre-pre-compile">
+        <mkdir dir="${build.classes.dir}"/>
+    </target>
+    <target name="-pre-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="do.depend.true" name="-compile-depend">
+        <pathconvert property="build.generated.subdirs">
+            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="*"/>
+            </dirset>
+        </pathconvert>
+        <j2seproject3:depend srcdir="${src.docks.dir}:${src.dir}:${build.generated.subdirs}"/>
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
+        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.classes.dir}">
+            <fileset dir="${src.docks.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target if="has.persistence.xml" name="-copy-persistence-xml">
+        <mkdir dir="${build.classes.dir}/META-INF"/>
+        <copy todir="${build.classes.dir}/META-INF">
+            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
+        </copy>
+    </target>
+    <target name="-post-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
+    <target name="-pre-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <j2seproject3:force-recompile/>
+        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.docks.dir}:${src.dir}"/>
+    </target>
+    <target name="-post-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
+    <!--
+                ====================
+                JAR BUILDING SECTION
+                ====================
+            -->
+    <target depends="init" name="-pre-pre-jar">
+        <dirname file="${dist.jar}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+    </target>
+    <target name="-pre-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
+        <j2seproject1:jar/>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
+        <j2seproject1:jar manifest="${manifest.file}"/>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
+        <j2seproject1:jar manifest="${manifest.file}">
+            <j2seproject1:manifest>
+                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
+            </j2seproject1:manifest>
+        </j2seproject1:jar>
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
+        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <pathconvert property="run.classpath.with.dist.jar">
+            <path path="${run.classpath}"/>
+            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
+        </pathconvert>
+        <echo level="info">${platform.java} -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
+    </target>
+    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+        <touch file="${tmp.manifest.file}" verbose="false"/>
+    </target>
+    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
+    </target>
+    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
+        <manifest file="${tmp.manifest.file}" mode="update">
+            <attribute name="Main-Class" value="${main.class}"/>
+        </manifest>
+    </target>
+    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
+        <basename file="${application.splash}" property="splashscreen.basename"/>
+        <mkdir dir="${build.classes.dir}/META-INF"/>
+        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
+        <manifest file="${tmp.manifest.file}" mode="update">
+            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
+        </manifest>
+    </target>
+    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
+        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <echo level="info">${platform.java} -jar "${dist.jar.resolved}"</echo>
+    </target>
+    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
+        <delete>
+            <fileset file="${tmp.manifest.file}"/>
+        </delete>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
+    <target name="-post-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
+    <!--
+                =================
+                EXECUTION SECTION
+                =================
+            -->
+    <target depends="init,compile" description="Run a main class." name="run">
+        <j2seproject1:java>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <target name="-do-not-recompile">
+        <property name="javac.includes.binary" value=""/>
+    </target>
+    <target depends="init,compile-single" name="run-single">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <j2seproject1:java classname="${run.class}"/>
+    </target>
+    <target depends="init,compile-test-single" name="run-test-with-main">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
+    </target>
+    <!--
+                =================
+                DEBUGGING SECTION
+                =================
+            -->
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
+        <j2seproject1:nbjpdastart name="${debug.class}"/>
+    </target>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
+    </target>
+    <target depends="init,compile" name="-debug-start-debuggee">
+        <j2seproject3:debug>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
+        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
+    </target>
+    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <j2seproject3:debug classname="${debug.class}"/>
+    </target>
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
+    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
+    </target>
+    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
+    <target depends="init" name="-pre-debug-fix">
+        <fail unless="fix.includes">Must set fix.includes</fail>
+        <property name="javac.includes" value="${fix.includes}.java"/>
+    </target>
+    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
+        <j2seproject1:nbjpdareload/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
+    <!--
+                =================
+                PROFILING SECTION
+                =================
+            -->
+    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile/>
+    </target>
+    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
+        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="${profile.class}"/>
+    </target>
+    <!--
+                =========================
+                APPLET PROFILING  SECTION
+                =========================
+            -->
+    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </profile>
+    </target>
+    <!--
+                =========================
+                TESTS PROFILING  SECTION
+                =========================
+            -->
+    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
+            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+            <jvmarg value="${profiler.info.jvmargs.agent}"/>
+            <jvmarg line="${profiler.info.jvmargs}"/>
+            <test name="${profile.class}"/>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+            <syspropertyset>
+                <propertyref prefix="test-sys-prop."/>
+                <mapper from="test-sys-prop.*" to="*" type="glob"/>
+            </syspropertyset>
+            <formatter type="brief" usefile="false"/>
+            <formatter type="xml"/>
+        </junit>
+    </target>
+    <!--
+                ===============
+                JAVADOC SECTION
+                ===============
+            -->
+    <target depends="init" if="have.sources" name="-javadoc-build">
+        <mkdir dir="${dist.javadoc.dir}"/>
+        <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
+            <and>
+                <isset property="endorsed.classpath.cmd.line.arg"/>
+                <not>
+                    <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
+                </not>
+            </and>
+        </condition>
+        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" executable="${platform.javadoc}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+            <classpath>
+                <path path="${javac.classpath}"/>
+            </classpath>
+            <fileset dir="${src.docks.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/*.java"/>
+                <exclude name="*.java"/>
+            </fileset>
+            <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
+        </javadoc>
+        <copy todir="${dist.javadoc.dir}">
+            <fileset dir="${src.docks.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/doc-files/**"/>
+            </fileset>
+        </copy>
+    </target>
+    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
+        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
+    </target>
+    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
+    <!--
+                =========================
+                JUNIT COMPILATION SECTION
+                =========================
+            -->
+    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
+        <mkdir dir="${build.test.classes.dir}"/>
+    </target>
+    <target name="-pre-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="do.depend.true" name="-compile-test-depend">
+        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
+    </target>
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
+        <copy todir="${build.test.classes.dir}">
+            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
+    <target name="-pre-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
+        <copy todir="${build.test.classes.dir}">
+            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
+    <!--
+                =======================
+                JUNIT EXECUTION SECTION
+                =======================
+            -->
+    <target depends="init" if="have.tests" name="-pre-test-run">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
+        <j2seproject3:junit testincludes="**/*Test.java"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init" if="have.tests" name="test-report"/>
+    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
+    <target depends="init" if="have.tests" name="-pre-test-run-single">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
+        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+        <j2seproject3:junit excludes="" includes="${test.includes}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
+    <!--
+                =======================
+                JUNIT DEBUGGING SECTION
+                =======================
+            -->
+    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
+        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
+        <delete file="${test.report.file}"/>
+        <mkdir dir="${build.test.results.dir}"/>
+        <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
+            <customize>
+                <syspropertyset>
+                    <propertyref prefix="test-sys-prop."/>
+                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                </syspropertyset>
+                <arg value="${test.class}"/>
+                <arg value="showoutput=true"/>
+                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
+                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
+    </target>
+    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
+    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
+        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
+    <!--
+                =========================
+                APPLET EXECUTION SECTION
+                =========================
+            -->
+    <target depends="init,compile-single" name="run-applet">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <j2seproject1:java classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <!--
+                =========================
+                APPLET DEBUGGING  SECTION
+                =========================
+            -->
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <j2seproject3:debug classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
+    <!--
+                ===============
+                CLEANUP SECTION
+                ===============
+            -->
+    <target name="-deps-clean-init" unless="built-clean.properties">
+        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
+        <delete file="${built-clean.properties}" quiet="true"/>
+    </target>
+    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
+        <echo level="warn" message="Cycle detected: JemmyFX was already built"/>
+    </target>
+    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
+        <mkdir dir="${build.dir}"/>
+        <touch file="${built-clean.properties}" verbose="false"/>
+        <property file="${built-clean.properties}" prefix="already.built.clean."/>
+        <antcall target="-warn-already-built-clean"/>
+        <propertyfile file="${built-clean.properties}">
+            <entry key="${basedir}" value=""/>
+        </propertyfile>
+        <antcall target="-maybe-call-dep">
+            <param name="call.built.properties" value="${built-clean.properties}"/>
+            <param location="${project.JemmyAWT}" name="call.subproject"/>
+            <param location="${project.JemmyAWT}/build.xml" name="call.script"/>
+            <param name="call.target" value="clean"/>
+            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
+        </antcall>
+        <antcall target="-maybe-call-dep">
+            <param name="call.built.properties" value="${built-clean.properties}"/>
+            <param location="${project.JemmyAWTInput}" name="call.subproject"/>
+            <param location="${project.JemmyAWTInput}/build.xml" name="call.script"/>
+            <param name="call.target" value="clean"/>
+            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
+        </antcall>
+        <antcall target="-maybe-call-dep">
+            <param name="call.built.properties" value="${built-clean.properties}"/>
+            <param location="${project.JemmyCore}" name="call.subproject"/>
+            <param location="${project.JemmyCore}/build.xml" name="call.script"/>
+            <param name="call.target" value="clean"/>
+            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
+        </antcall>
+    </target>
+    <target depends="init" name="-do-clean">
+        <delete dir="${build.dir}"/>
+        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
+    </target>
+    <target name="-post-clean">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
+    <target name="-check-call-dep">
+        <property file="${call.built.properties}" prefix="already.built."/>
+        <condition property="should.call.dep">
+            <not>
+                <isset property="already.built.${call.subproject}"/>
+            </not>
+        </condition>
+    </target>
+    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
+        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
+            <propertyset>
+                <propertyref prefix="transfer."/>
+                <mapper from="transfer.*" to="*" type="glob"/>
+            </propertyset>
+        </ant>
+    </target>
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/nbproject/genfiles.properties	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=4c8c9288
+build.xml.script.CRC32=74ab4eb1
+build.xml.stylesheet.CRC32=28e38971@1.38.2.45
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=d453f60a
+nbproject/build-impl.xml.script.CRC32=51f5c122
+nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/nbproject/project.properties	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,83 @@
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.processors.list=
+annotation.processing.run.all.processors=true
+application.title=JemmyFX
+application.vendor=shura
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+    ${run.classpath}
+debug.test.classpath=\
+    ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/JemmyFX.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=
+file.reference.jfxrt.jar=lib/lib/jfxrt.jar
+includes=**
+jar.compress=false
+javac.classpath=\
+    ${reference.JemmyAWTInput.jar}:\
+    ${file.reference.jfxrt.jar}:\
+    ${reference.JemmyAWT.jar}:\
+    ${reference.JemmyCore.jar}
+# Space-separated list of extra javac options
+javac.compilerargs=-processor org.jemmy.dock.DockGenerator -s ${basedir}/docks
+javac.deprecation=false
+javac.processorpath=\
+    ${javac.classpath}
+javac.source=1.5
+javac.target=1.5
+javac.test.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}:\
+    ${libs.junit_4.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+main.class=
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+platform.active=JDK_1.7_x86
+project.JemmyAWT=../../AWT/JemmyAWT
+project.JemmyAWTInput=../../core/JemmyAWTInput
+project.JemmyCore=../../core/JemmyCore
+reference.JemmyAWT.jar=${project.JemmyAWT}/dist/JemmyAWT.jar
+reference.JemmyAWTInput.jar=${project.JemmyAWTInput}/dist/JemmyAWTInput.jar
+reference.JemmyCore.jar=${project.JemmyCore}/dist/JemmyCore.jar
+run.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=
+run.test.classpath=\
+    ${javac.test.classpath}:\
+    ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+src.docks.dir=docks
+test.src.dir=test
+mkdist.disabled=false
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/nbproject/project.xml	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.java.j2seproject</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
+            <name>JemmyFX</name>
+            <explicit-platform explicit-source-supported="true"/>
+            <source-roots>
+                <root id="src.docks.dir" name="Generated"/>
+                <root id="src.dir"/>
+            </source-roots>
+            <test-roots>
+                <root id="test.src.dir"/>
+            </test-roots>
+        </data>
+        <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
+            <reference>
+                <foreign-project>JemmyAWT</foreign-project>
+                <artifact-type>jar</artifact-type>
+                <script>build.xml</script>
+                <target>jar</target>
+                <clean-target>clean</clean-target>
+                <id>jar</id>
+            </reference>
+            <reference>
+                <foreign-project>JemmyAWTInput</foreign-project>
+                <artifact-type>jar</artifact-type>
+                <script>build.xml</script>
+                <target>jar</target>
+                <clean-target>clean</clean-target>
+                <id>jar</id>
+            </reference>
+            <reference>
+                <foreign-project>JemmyCore</foreign-project>
+                <artifact-type>jar</artifact-type>
+                <script>build.xml</script>
+                <target>jar</target>
+                <clean-target>clean</clean-target>
+                <id>jar</id>
+            </reference>
+        </references>
+    </configuration>
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/AppExecutor.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,145 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+
+package org.jemmy.fx;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import javafx.application.Application;
+import org.jemmy.JemmyException;
+import org.jemmy.env.Environment;
+
+/**
+ * Runs an FX application
+ * @author shura
+ */
+public class AppExecutor {
+    private Class mainClass;
+
+    /**
+     * @deprecated Use static void execute(Class<? extends Application> program, String... parameters)
+     * @param mainClassName Name of the application main class
+     */
+    public AppExecutor(String mainClassName) throws ClassNotFoundException {
+        this(Class.forName(mainClassName));
+    }
+
+    /**
+     * @deprecated Use static void execute(Class<? extends Application> program, String... parameters)
+     * @param mainClass the application main class
+     */
+    public AppExecutor(Class mainClass) {
+        this.mainClass = mainClass;
+    }
+
+    /**
+     * Runs the app with parameters
+     * @deprecated Use static void execute(Class<? extends Application> program, String... parameters)
+     * @param parameters
+     */
+    public void execute(final String... parameters) {
+        execute(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    Class[] argTypes = new Class[] { String[].class };
+                    Method main = mainClass.getMethod("main", argTypes);
+                    //String[] mainArgs = Arrays.copyOfRange(parameters, 1, parameters.length);
+                    main.invoke(null, (Object)parameters);
+                } catch (IllegalAccessException ex) {
+                    throw new JemmyException("Unable to execute " + mainClass.getName(), ex);
+                } catch (IllegalArgumentException ex) {
+                    throw new JemmyException("Unable to execute " + mainClass.getName(), ex);
+                } catch (InvocationTargetException ex) {
+                    throw new JemmyException("Unable to execute " + mainClass.getName(), ex);
+                } catch (NoSuchMethodException ex) {
+                    throw new JemmyException("Unable to execute " + mainClass.getName(), ex);
+                } catch (SecurityException ex) {
+                    throw new JemmyException("Unable to execute " + mainClass.getName(), ex);
+                }
+            }
+        });
+    }
+
+    /**
+     * @deprecated Use static void execute(Class<? extends Application> program, String... parameters)
+     * @param program
+     */
+    public static void execute(Runnable program) {
+        Environment.getEnvironment().getOutput().printerr("It is recommended not to use " +
+                AppExecutor.class.getName() + ".execute(Runnable)");
+        Environment.getEnvironment().getOutput().printerr("use " +
+                AppExecutor.class.getName() + ".execute(Class<? extends " + Application.class.getName() + ">) instead");
+        // com.sun.javafx.application.PlatformImpl.startup(program); JJCBrowser is for work with FX app
+        //                                                           which starts FX platform in the main()
+        new Thread(program).start();
+    }
+
+    public static void execute(Class<? extends Application> program) {
+        execute(program, new String[0]);
+    }
+
+    public static void execute(Class<? extends Application> program, String... parameters) {
+        Application.launch(program, parameters);
+    }
+
+    public static void executeNoBlock(Class<? extends Application> program) {
+        executeNoBlock(program, new String[0]);
+    }
+
+    public static void executeNoBlock(final Class<? extends Application> program, final String... parameters) {
+        new Thread(new Runnable() {
+
+            public void run() {
+                execute(program, parameters);
+            }
+        }).start();
+    }
+
+    public static void executeReflect(String... argv) throws ClassNotFoundException {
+        if (argv.length == 0) {
+            throw new ClassNotFoundException("No class name to execute - empty parameters");
+        }
+        Class mainClass = Class.forName(argv[0]);
+
+        String[] parameters = Arrays.copyOfRange(argv, 1, argv.length);
+
+        if (Application.class.isAssignableFrom(mainClass)) {
+            Class<? extends Application> app = mainClass;
+            AppExecutor.execute(app, parameters);
+            return;
+        }
+        // throw new ClassNotFoundException("Class doesn't extends " + 
+        //                                   Application.class.getName() + ". Old way to start FX app isn't supported");
+        // then use old deprecated method to start.
+        new AppExecutor(mainClass).execute(parameters);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/ByID.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+package org.jemmy.fx;
+
+import javafx.scene.Node;
+import org.jemmy.action.GetAction;
+import org.jemmy.env.Environment;
+import org.jemmy.lookup.ByStringLookup;
+import org.jemmy.resources.StringComparePolicy;
+
+/**
+ *
+ * @param <T>
+ * @author Shura
+ */
+public class ByID<T extends Node> extends ByStringLookup <T> {
+
+    /**
+     *
+     * @param text
+     */
+    public ByID(String text) {
+        super(text, StringComparePolicy.EXACT);
+    }
+
+    @Override
+    public String getText(final T arg0) {
+        return new GetAction<String>() {
+
+            @Override
+            public void run(Object... parameters) {
+                setResult(arg0.getId());
+            }
+
+            @Override
+            public String toString() {
+                return null;
+            }
+
+        }.dispatch(Environment.getEnvironment());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/ByObject.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+
+package org.jemmy.fx;
+
+import org.jemmy.lookup.LookupCriteria;
+
+public class ByObject<ITEM> implements LookupCriteria<ITEM> {
+
+    private final ITEM item;
+
+    public ByObject(ITEM item) {
+        this.item = item;
+    }
+
+    @Override
+    public boolean check(ITEM item) {
+        return this.item.equals(item);
+    }
+
+    @Override
+    public String toString() {
+        return "Looking for a ITEM with the value '" + item + "'";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/ByStyleClass.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+
+package org.jemmy.fx;
+
+import javafx.scene.Node;
+import org.jemmy.lookup.LookupCriteria;
+
+/**
+ * LookupCriteria implementation for styleClass property name.
+ *
+ * @author ineverov
+ */
+
+public class ByStyleClass<T extends Node> implements LookupCriteria<T> {
+        private String scName;
+
+        public ByStyleClass(String styleClassName){
+            scName = styleClassName;
+        }
+
+        public boolean check(T cntrl) {
+            return cntrl.getStyleClass().contains(scName);
+        }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/ByText.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+package org.jemmy.fx;
+
+import javafx.scene.Node;
+import javafx.scene.control.ChoiceBox;
+import javafx.scene.control.Labeled;
+import javafx.scene.control.TextInputControl;
+import javafx.scene.text.Text;
+import org.jemmy.action.GetAction;
+import org.jemmy.env.Environment;
+import org.jemmy.lookup.ByStringLookup;
+import org.jemmy.resources.StringComparePolicy;
+
+/**
+ *
+ * @param <T>
+ * @author Shura
+ */
+public class ByText<T extends Node> extends ByStringLookup<T> {
+
+    /**
+     *
+     * @param text
+     */
+    public ByText(String text) {
+        super(text);
+    }
+
+    /**
+     *
+     * @param text
+     * @param policy
+     */
+    public ByText(String text, StringComparePolicy policy) {
+        super(text, policy);
+    }
+
+    @Override
+    public String getText(T arg0) {
+        return getNodeText(arg0);
+    }
+
+    /**
+     *
+     * @param nd
+     * @return
+     */
+    public static String getNodeText(final Node nd) {
+        return new GetAction<String>() {
+
+            @Override
+            public void run(Object... parameters) {
+                if(nd instanceof Text) {
+                    setResult(Text.class.cast(nd).getText());
+                } else if(nd instanceof Labeled) {
+                    setResult(Labeled.class.cast(nd).getText());
+                } else if(nd instanceof TextInputControl) {
+                    setResult(TextInputControl.class.cast(nd).getText());
+                } else if(nd instanceof ChoiceBox) {
+                    Object selectedItem = ChoiceBox.class.cast(nd).getSelectionModel().getSelectedItem();
+                    if (selectedItem != null)
+                    setResult(selectedItem.toString());
+                } else /*
+                // the rest is not yet implemented in javafx.scene.control
+
+                 if(nd instanceof TextBox) {
+                    setResult(TextBox.class.cast(nd).get$text());
+                } else if(nd instanceof ListView) {
+                    setResult(getText((ListView)nd));
+                } else if(nd instanceof ChoiceBox) {
+                    setResult(((ChoiceBox)nd).get$selectedItem().toString());
+                } else
+                 */ {
+                    setResult("");
+                }
+            }
+
+            @Override
+            public String toString() {
+                return "Getting text of " + nd;
+            }
+
+        }.dispatch(Environment.getEnvironment());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/ByTitleSceneLookup.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+package org.jemmy.fx;
+
+import javafx.scene.Scene;
+import javafx.stage.Stage;
+import javafx.stage.Window;
+import org.jemmy.action.GetAction;
+import org.jemmy.env.Environment;
+import org.jemmy.lookup.ByStringLookup;
+import org.jemmy.resources.StringComparePolicy;
+
+/**
+ *
+ * @param <T>
+ * @author shura
+ */
+public class ByTitleSceneLookup<T extends Scene> extends ByStringLookup<T> {
+
+    /**
+     *
+     * @param text
+     */
+    public ByTitleSceneLookup(String text) {
+        super(text);
+    }
+
+    public ByTitleSceneLookup(String text, StringComparePolicy policy) {
+        super(text, policy);
+    }
+
+    @Override
+    public String getText(final T control) {
+        return new GetAction<String>() {
+
+            @Override
+            public void run(Object... parameters) {
+                Window window = control.getWindow();
+                setResult((window instanceof Stage)
+                        ? ((Stage) window).getTitle() : null);
+            }
+        }.dispatch(Environment.getEnvironment());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/ByWindowType.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+
+package org.jemmy.fx;
+
+import javafx.scene.Scene;
+import javafx.stage.Window;
+import org.jemmy.lookup.LookupCriteria;
+
+/**
+ *
+ * @author shura
+ */
+public class ByWindowType<T extends Scene> implements LookupCriteria<T>{
+    private Class<? extends Window> type;
+
+    public ByWindowType(Class<? extends Window> type) {
+        this.type = type;
+    }
+    public boolean check(Scene cntrl) {
+        return type.isInstance(cntrl.getWindow());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/CriteriaList.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+
+package org.jemmy.fx;
+
+import java.util.Arrays;
+import java.util.List;
+import org.jemmy.lookup.LookupCriteria;
+
+public class CriteriaList<T> {
+    protected List<T> list;
+
+    public CriteriaList(T... list) {
+        this.list = Arrays.asList(list);
+    }
+
+    public LookupCriteria<T>[] getCriterias() {
+        LookupCriteria<T>[] criterias = new LookupCriteria[list.size()];
+        int i = 0;
+        for (final T item : list) {
+            criterias[i++] = new LookupCriteria<T>() {
+                public boolean check(T cntrl) {
+                    return item.equals(cntrl);
+                }
+            };
+        }
+        return criterias;
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/FXClickFocus.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,34 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jemmy.fx;
+
+import javafx.scene.Node;
+import org.jemmy.Point;
+import org.jemmy.control.Wrap;
+import org.jemmy.input.ClickFocus;
+
+/**
+ *
+ * @author shura
+ */
+public class FXClickFocus extends ClickFocus {
+
+    public static final String IS_FOCUSED_PROP = "isFocused";
+
+    public FXClickFocus(Wrap<? extends Node> topControl) {
+        super(topControl);
+    }
+
+    public FXClickFocus(Wrap<? extends Node> topControl, Point clickPoint) {
+        super(topControl, clickPoint);
+    }
+
+    @Override
+    public void focus() {
+        if (!Boolean.class.cast(getTopControl().getProperty(IS_FOCUSED_PROP))) {
+            super.focus();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/FXRelativeCoordinateLookup.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. DO NOT
+ * ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+package org.jemmy.fx;
+
+import javafx.scene.Node;
+import org.jemmy.Rectangle;
+import org.jemmy.control.Wrap;
+import org.jemmy.env.Environment;
+import org.jemmy.lookup.RelativeCoordinateLookup;
+
+/**
+ *
+ * @author Andrey Nazarov
+ */
+public class FXRelativeCoordinateLookup<CONTROL extends Node> extends RelativeCoordinateLookup<CONTROL> {
+
+    public FXRelativeCoordinateLookup(Wrap wrap, boolean includeControl, int hr, int vr) {
+        super(wrap, includeControl, hr, vr);
+    }
+
+    @Override
+    protected Rectangle getBounds(CONTROL control) {
+        return new NodeWrap<CONTROL>(Environment.getEnvironment(), control).getScreenBounds();
+    }
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/Lookups.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+
+package org.jemmy.fx;
+
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import org.jemmy.control.Wrap;
+import org.jemmy.interfaces.Parent;
+
+/**
+ * This class is intended for static import. It provides some shortcuts
+ * to the most used functionality of Jemmy classes.
+ * @author shura
+ */
+public class Lookups {
+    /**
+     * Equivalent to <code>parent.lookup(type, new ByID<T>(id)).wrap(0)</code>
+     * @param <T>
+     * @param parent
+     * @param id
+     * @param type
+     * @return
+     */
+    public static <T extends Node> Wrap<? extends T> byID(Parent<Node> parent, String id, Class<T> type) {
+        return parent.lookup(type, new ByID<T>(id)).wrap(0);
+    }
+    /**
+     * Takes <code>parent</code> as <code>Parent</code>. May throw an exception if not a parent.
+     * @see #byID(org.jemmy.interfaces.Parent, java.lang.String, java.lang.Class)
+     * @param <T>
+     * @param parent
+     * @param id
+     * @param type
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public static <T extends Node> Wrap<? extends T> byID(Wrap<?> parent, String id, Class<T> type) {
+        return byID(parent.as(Parent.class, Node.class), id, type);
+    }
+    /**
+     * Equivalent to <code>parent.lookup(type, new ByText<T>(text)).wrap(0)</code>
+     * @param <T>
+     * @param parent
+     * @param text
+     * @param type
+     * @return
+     */
+    public static <T extends Node> Wrap<? extends T> byText(Parent<Node> parent, String text, Class<T> type) {
+        return parent.lookup(type, new ByText<T>(text)).wrap(0);
+    }
+    /**
+     * Takes <code>parent</code> as <code>Parent</code>. May throw an exception if not a parent.
+     * @see #byID(org.jemmy.interfaces.Parent, java.lang.String, java.lang.Class)
+     * @param <T>
+     * @param parent
+     * @param id
+     * @param type
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public static <T extends Node> Wrap<? extends T> byText(Wrap<?> parent, String id, Class<T> type) {
+        return byText(parent.as(Parent.class, Node.class), id, type);
+    }
+    /**
+     * Equivalent to <code>FXRoot.ROOT.lookup(new ByTitleSceneLookup<Scene>(title)).wrap(0).as(Parent.class, Node.class)</code>
+     * @param title
+     * @return
+     */
+    public static Wrap<? extends Scene> byTitle(String title) {
+        return Root.ROOT.lookup(new ByTitleSceneLookup<Scene>(title)).wrap(0);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/NodeHierarchy.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+
+package org.jemmy.fx;
+
+import java.util.ArrayList;
+import java.util.List;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import org.jemmy.action.GetAction;
+import org.jemmy.env.Environment;
+import org.jemmy.lookup.ControlHierarchy;
+
+/**
+ *
+ * @author shura
+ */
+public class NodeHierarchy implements ControlHierarchy {
+
+    private javafx.scene.Parent root;
+    private Scene scene;
+    private Environment env;
+
+    public NodeHierarchy(Parent root, Environment env) {
+        this.root = root;
+        this.env = env;
+        this.scene = null;
+    }
+
+    public NodeHierarchy(Scene scene, Environment env) {
+        this.scene = scene;
+        this.env = env;
+        this.root = null;
+    }
+
+    public List<?> getChildren(final Object subParent) {
+        GetAction<List<?>> children = new GetAction<List<?>>() {
+
+            @Override
+            public void run(Object... parameters) {
+                if (subParent instanceof Parent) {
+                    setResult(new ArrayList(Parent.class.cast(subParent).getChildrenUnmodifiable()));
+                } else {
+                    setResult(null);
+                }
+            }
+        };
+        env.getExecutor().execute(env, true, children);
+        return children.getResult();
+    }
+
+    public Object getParent(final Object child) {
+        GetAction<Object> childAction = new GetAction<Object>() {
+
+            @Override
+            public void run(Object... parameters) {
+                if (!(child instanceof Node)) {
+                    setResult(null);
+                    return;
+                }
+                Node nd = Node.class.cast(child);
+                if (nd.getParent() != null) {
+                    setResult(nd.getParent());
+                } else {
+                    setResult(nd.getScene());
+                }
+            }
+        };
+        env.getExecutor().execute(env, true, childAction);
+        return childAction.getResult();
+    }
+
+    public List<?> getControls() {
+        GetAction<List<?>> controls = new GetAction<List<?>>() {
+            @Override
+            public void run(Object... parameters) {                
+                if (root != null) {
+                    setResult(root.getChildrenUnmodifiable());
+                } else {
+                    List root = new ArrayList();
+                    root.add(scene.getRoot());
+                    setResult(root);
+                }
+            }
+        };
+        env.getExecutor().execute(env, true, controls);
+        return controls.getResult();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/NodeParent.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+
+package org.jemmy.fx;
+
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import org.jemmy.env.Environment;
+import org.jemmy.interfaces.Parent;
+
+/**
+ *
+ * @author shura
+ */
+public interface NodeParent{
+    public SceneWrap<? extends Scene> getScene();
+    public Parent<Node> getParent();
+    public Environment getEnvironment();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/NodeParentImpl.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,47 @@
+/*
+ * To change this template, choose Tools | Templates and open the template in
+ * the editor.
+ */
+package org.jemmy.fx;
+
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import org.jemmy.env.Environment;
+import org.jemmy.lookup.AbstractParent;
+import org.jemmy.lookup.HierarchyLookup;
+import org.jemmy.lookup.Lookup;
+import org.jemmy.lookup.LookupCriteria;
+
+/**
+ *
+ * @author andrey
+ */
+public class NodeParentImpl extends AbstractParent<Node> {
+
+    private Environment env;
+    private Parent parent;
+
+    public NodeParentImpl(NodeWrap<? extends Node> wrap) {
+        this((javafx.scene.Parent) wrap.getControl(), wrap.getEnvironment());
+    }
+
+    public NodeParentImpl(Parent parent, Environment env) {
+        this.env = env;
+        this.parent = parent;
+    }
+
+    @Override
+    public <ST extends Node> Lookup<ST> lookup(Class<ST> controlClass, LookupCriteria<ST> criteria) {
+        return new HierarchyLookup<ST>(env, new NodeHierarchy(parent, env), new NodeWrapper(env), controlClass, criteria);
+    }
+
+    @Override
+    public Lookup<Node> lookup(LookupCriteria<Node> criteria) {
+        return lookup(Node.class, criteria);
+    }
+
+    @Override
+    public Class<Node> getType() {
+        return Node.class;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/NodeWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,228 @@
+package org.jemmy.fx;
+
+import javafx.geometry.Bounds;
+import javafx.geometry.Point2D;
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import org.jemmy.Point;
+import org.jemmy.Rectangle;
+import org.jemmy.action.GetAction;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.MethodProperties;
+import org.jemmy.control.Property;
+import org.jemmy.control.Wrap;
+import org.jemmy.control.Wrapper;
+import org.jemmy.dock.DefaultWrapper;
+import org.jemmy.dock.DockInfo;
+import org.jemmy.dock.ObjectLookup;
+import org.jemmy.env.Environment;
+import org.jemmy.interfaces.Focus;
+import org.jemmy.interfaces.Focusable;
+import org.jemmy.interfaces.Mouse;
+import org.jemmy.interfaces.Parent;
+import org.jemmy.interfaces.TypeControlInterface;
+import org.jemmy.lookup.LookupCriteria;
+
+/**
+ *
+ * @author shura, mrkam
+ */
+@ControlType(Node.class)
+@MethodProperties({"getBaselineOffset", "getBoundsInLocal", "getBoundsInParent",
+    "getCacheHint", "getClip", "getContentBias", "getCursor", "getEffect",
+    "getId", "getLayoutBounds", "getLayoutX", "getLayoutY", "getOpacity",
+    "getParent", "getProperties", "getRotate", "getRotationAxis", "getScaleX",
+    "getScaleY", "getScaleZ", "getStyle", "getStyleClass", "getTransforms",
+    "getTranslateX", "getTranslateY", "getTranslateZ", "getUserData",
+    "hasProperties", "isCache", "isDisable", "isDisabled",
+    FXClickFocus.IS_FOCUSED_PROP, "isHover", "isManaged",
+    "isMouseTransparent", "isPickOnBounds", "isPressed", "isResizable",
+    "isVisible"})
+@ControlInterfaces(value = Parent.class, encapsulates = Node.class)
+@DockInfo(generateSubtypeLookups = true)
+public class NodeWrap<T extends Node> extends Wrap<T> implements Focusable {
+
+    protected Scene scene;
+    private Parent parent = null;
+    private Mouse mouse = null;
+    private Focus focus;
+    private static Wrapper wrapper = new NodeWrapper(Root.ROOT.getEnvironment());
+
+    @DefaultWrapper
+    public static <TP extends Node> Wrap<? extends TP> wrap(Environment env, Class<TP> type, TP control) {
+        Wrap<? extends TP> res = wrapper.wrap(type, control);
+        res.setEnvironment(env);
+        return res;
+    }
+
+    @ObjectLookup("id")
+    public static <B extends Node> LookupCriteria<B> idLookup(Class<B> tp, String id) {
+        return new ByID<B>(id);
+    }
+
+    @ObjectLookup("type")
+    public static <B extends Node> LookupCriteria<B> typeLookup(Class<B> tp, final Class<?> subtype) {
+        return new LookupCriteria<B>() {
+
+            public boolean check(B control) {
+                return subtype.isInstance(control);
+            }
+        };
+    }
+
+    private NodeWrap(Environment env, Scene scene, T node) {
+        super(env, node);
+        this.scene = scene;
+        focus = new FXClickFocus(this);
+    }
+
+    public NodeWrap(Environment env, T node) {
+        this(env, node.getScene(), node);
+    }
+
+    @Property("scene")
+    public Scene getScene() {
+        return scene;
+    }
+
+    public static Rectangle getScreenBounds(final Environment env, final Node nd) {
+        GetAction<Rectangle> bounds = new GetAction<Rectangle>() {
+
+            @Override
+            public void run(Object... parameters) {
+                Bounds rect = nd.localToScene(nd.getLayoutBounds());
+                Rectangle res = SceneWrap.getScreenBounds(env, nd.getScene());
+                res.x += rect.getMinX();
+                res.y += rect.getMinY();
+                res.width = (int) rect.getWidth();
+                res.height = (int) rect.getHeight();
+                setResult(res);
+            }
+        };
+        env.getExecutor().execute(env, true, bounds);
+        return bounds.getResult();
+    }
+
+    @Override
+    public Rectangle getScreenBounds() {
+        return getScreenBounds(getEnvironment(), getControl());
+    }
+
+    @Override
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> boolean is(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (Parent.class.isAssignableFrom(interfaceClass) && Node.class.equals(type)) {
+            return true;
+        }
+        return super.is(interfaceClass, type);
+    }
+
+    @Override
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (Parent.class.isAssignableFrom(interfaceClass) && Node.class.equals(type)) {
+            if (parent == null) {
+                parent = new NodeParentImpl(this);
+            }
+            return (INTERFACE) parent;
+        }
+        return super.as(interfaceClass, type);
+    }
+
+    @Override
+    public Mouse mouse() {
+        if (mouse == null) {
+            mouse = super.mouse();
+            if (!Root.isPropertyTrue(getEnvironment(), Root.USE_NATIVE_COORDINATES)) {
+                mouse = new RelativeMouse(super.mouse(), this);
+            }
+        }
+        return mouse;
+    }
+
+    public Focus focuser() {
+        return focus;
+    }
+
+    /**
+     * Defines whether a cell is within another cell.
+     *
+     * @param parent
+     * @param cell
+     * @param env
+     * @return
+     */
+    public static boolean isInside(Node parent, Node cell, Environment env) {
+        if (cell != null) {
+            Rectangle bounds = NodeWrap.getScreenBounds(env, cell);
+            Rectangle viewBounds = NodeWrap.getScreenBounds(env, parent);
+            return (bounds.y > viewBounds.y
+                    && bounds.y + bounds.height < viewBounds.y + viewBounds.height);
+        } else {
+            return false;
+        }
+    }
+
+        /**
+     * Transforms point in local control coordinate system to screen coordinates.
+     * @param local
+     * @return
+     * @see #toLocal(org.jemmy.Point)
+     */
+    @Override
+    public Point toAbsolute(final Point local) {
+        Point p = convertToAbsoluteLayout(this, local);
+        Rectangle screenBounds = getScreenBounds();
+        return new Point(p.x + screenBounds.x, p.y + screenBounds.y);
+    }
+
+    /**
+     * Transforms point in screen coordinates to local control coordinate system.
+     * @param global
+     * @return coordinates which should be used for mouse operations.
+     * @see #toAbsolute(org.jemmy.Point)
+     */
+    @Override
+    public Point toLocal(final Point global) {
+        Rectangle screenBounds = getScreenBounds();
+        Point local = new Point(global.x - screenBounds.x, global.y - screenBounds.y);
+        return convertToLocalLayout(this, local);
+    }
+
+    static Point convertToAbsoluteLayout(final NodeWrap<? extends Node> node, final Point p) {
+        return new GetAction<Point>() {
+            @Override
+            public void run(Object... parameters) {
+                Bounds layout = node.getControl().getLayoutBounds();
+                Bounds toScene = node.getControl().localToScene(layout);
+                Point2D loc = node.getControl().localToScene(layout.getMinX() + p.x, layout.getMinY() + p.y);
+                setResult(new Point(loc.getX() - toScene.getMinX(), loc.getY() - toScene.getMinY()));
+            }
+        }.dispatch(node.getEnvironment());
+    }
+
+    static Point convertToLocalLayout(final NodeWrap<? extends Node> node, final Point p) {
+        return new GetAction<Point>() {
+            @Override
+            public void run(Object... parameters) {
+                Bounds layout = node.getControl().getLayoutBounds();
+                Bounds toScene = node.getControl().localToScene(layout);
+                Point2D loc = node.getControl().sceneToLocal(toScene.getMinX() + p.x, toScene.getMinY() + p.y);
+                setResult(new Point(loc.getX() - layout.getMinX(), loc.getY() - layout.getMinY()));
+            }
+        }.dispatch(node.getEnvironment());
+    }
+
+    protected boolean isFocused() {
+        return new GetAction<Boolean>() {
+                    @Override
+                    public void run(Object... parameters) {
+                        setResult(getControl().isFocused() ||
+                            (as(Parent.class, Node.class).lookup(new LookupCriteria<Node>() {
+                                public boolean check(Node node) {
+                                    return node.isFocused();
+                                }
+                            }).size() > 0));
+                    }
+                }.dispatch(getEnvironment());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/NodeWrapper.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+
+package org.jemmy.fx;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import org.jemmy.control.DefaultWrapper;
+import org.jemmy.control.Wrap;
+import org.jemmy.control.WrapperException;
+import org.jemmy.env.Environment;
+import org.jemmy.fx.control.*;
+
+/**
+ * Wraps <code>javafx.scene.Node</code> into an appropriate Wrap.
+ * @author shura
+ */
+public class NodeWrapper extends DefaultWrapper {
+
+    private static final Class<? extends Wrap>[] OPERATORS = new Class[] {
+        NodeWrap.class, TextWrap.class,
+        ControlWrap.class, TextControlWrap.class,
+        CheckBoxWrap.class, ToggleButtonWrap.class,
+        SliderWrap.class, ScrollBarWrap.class,
+	TextInputControlWrap.class, ListViewWrap.class,
+        MenuBarWrap.class, MenuButtonWrap.class,
+        ToolBarWrap.class, ChoiceBoxWrap.class, ComboBoxWrap.class,
+        TreeViewWrap.class, TabPaneWrap.class, TableViewWrap.class,
+        TableCellWrap.class, SplitPaneWrap.class, SeparatorWrap.class
+    };
+
+    /**
+     * 
+     * @param scene A scene where the Nodes are assumed to be within. The scene 
+     * is later passed to all newly created NodeWrap's
+     * @param env - an environment instance. Typically, a clone of the container 
+     * environment is used.
+     * @deprecated use <code>#NodeWrapper(org.jemmy.env.Environment)</code>
+     * @see #NodeWrapper(org.jemmy.env.Environment) 
+     */
+    public NodeWrapper(Scene scene, Environment env) {
+        super(env, OPERATORS);
+    }
+
+    public NodeWrapper(Environment env) {
+        super(env, OPERATORS);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    @SuppressWarnings("unchecked")
+    protected <T> Wrap<? extends T> doWrap(T control, Class controlClass, Class wrapperClass)
+            throws NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+        if (Node.class.isAssignableFrom(controlClass)) {
+            Constructor cns = null;
+            Class cls = controlClass;
+            do {
+                try {
+                    cns = wrapperClass.getConstructor(Environment.class, cls);
+                } catch (NoSuchMethodException e) {
+                }
+            } while (cns == null && (cls = cls.getSuperclass()) != null);
+            if (cns != null) {
+                return (Wrap<T>) cns.newInstance(new Environment(getEnvironment()), control);
+            } else {
+                throw new WrapperException(controlClass, wrapperClass);
+            }
+        } else {
+            return super.doWrap(control, controlClass, wrapperClass);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/QueueExecutor.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,226 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx;
+
+import javafx.application.Platform;
+import org.jemmy.JemmyException;
+import org.jemmy.TimeoutExpiredException;
+import org.jemmy.action.AbstractExecutor;
+import org.jemmy.action.Action;
+import org.jemmy.env.Environment;
+import org.jemmy.env.Timeout;
+import org.jemmy.timing.State;
+import com.sun.javafx.tk.Toolkit;
+
+/**
+ *
+ * @author shura, KAM
+ */
+public class QueueExecutor extends AbstractExecutor {
+
+    /**
+     *
+     */
+    public static final Timeout QUEUE_THROUGH_TIME = new Timeout("FXExecutor.FX_QUEUE_THROUGH_TIME", 50);
+    static final Timeout QUEUE_IDENTIFYING_TIMEOUT =
+            new Timeout("jemmyfx.executor.queue.thread", 1000);
+    /**
+     *
+     */
+    public static final QueueExecutor EXECUTOR = new QueueExecutor();
+    Thread queueThread = null;
+    EmptyFunction emptyFunction;
+
+    private QueueExecutor() {
+        super();
+        emptyFunction = new EmptyFunction();
+    }
+
+    public Thread getQueueThread() {
+        if (queueThread == null) {
+            try {
+                Platform.runLater(new Runnable() {
+
+                    @Override
+                    public void run() {
+                        queueThread = Thread.currentThread();
+                    }
+                });
+                Root.ROOT.getEnvironment().getWaiter(QUEUE_IDENTIFYING_TIMEOUT.getName()).ensureState(new State<Object>() {
+
+                    @Override
+                    public Object reached() {
+                        return queueThread;
+                    }
+                });
+            } catch (TimeoutExpiredException e) {
+                //this is bad. THere got to be a way to check if we're on the queue
+                //or not. right now - no other way - sorry
+                queueThread = Thread.currentThread();
+            }
+        }
+        return queueThread;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void executeQueue(Environment env, Action action, Object... parameters) {
+        if (isOnQueue()) {
+            action.execute(parameters);
+        } else {
+            final WrapperFunction wrapper = new WrapperFunction();
+            wrapper.setAction(action);
+            wrapper.setParameters(parameters);
+            Platform.runLater(wrapper);
+            wrapper.waitDone(env.getTimeout(MAX_ACTION_TIME));
+            if (wrapper.failed()) {
+                throw new JemmyException("Failed to execute action '" + action + "' through Platform.runLater", action.getThrowable());
+            }
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void executeQueueDetached(Environment env, Action action, Object... parameters) {
+        WrapperFunction w = new WrapperFunction();
+        w.setAction(action);
+        w.setParameters(parameters);
+        Platform.runLater(w);
+    }
+
+    @Override
+    public boolean isOnQueue() {
+        //return Thread.currentThread().equals(getQueueThread());
+        try {
+            Toolkit.getToolkit().checkFxUserThread();
+        } catch (Throwable th) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    protected boolean isQuiet() {
+        emptyFunction.prepare();
+        Platform.runLater(emptyFunction);
+        Environment.getEnvironment().getWaiter(MAX_ACTION_TIME).ensureState(new State<Object>() {
+
+            @Override
+            public Object reached() {
+                return emptyFunction.isExecuted() ? "" : null;
+            }
+        });
+        return emptyFunction.getTime() <= QUEUE_THROUGH_TIME.getValue();
+    }
+
+    class EmptyFunction implements Runnable {
+
+        private long time;
+        private long startTime;
+        private boolean executed;
+
+        @Override
+        public void run() {
+            time = System.currentTimeMillis() - startTime;
+            executed = true;
+        }
+
+        public boolean isExecuted() {
+            return executed;
+        }
+
+        public void prepare() {
+            executed = false;
+            startTime = System.currentTimeMillis();
+        }
+
+        public long getTime() {
+            return time;
+        }
+    }
+
+    class WrapperFunction implements Runnable {
+
+        private Action action = null;
+        private Object[] parameters = null;
+        private boolean done = false;
+
+        public void setAction(Action action) {
+            this.action = action;
+        }
+
+        public void setParameters(Object[] parameters) {
+            this.parameters = parameters;
+        }
+
+        @Override
+        public void run() {
+            try {
+                action.execute(parameters);
+            } catch (RuntimeException e) {
+            }
+            synchronized (this) {
+                done = true;
+                notifyAll();
+            }
+        }
+
+        public boolean isDone() {
+            return done;
+        }
+
+        public void clean() {
+            done = false;
+            action = null;
+            parameters = null;
+        }
+
+        public boolean failed() {
+            return action.failed();
+        }
+
+        public Throwable getThrowable() {
+            return action.getThrowable();
+        }
+
+        public synchronized void waitDone(Timeout timeout) {
+            try {
+                while (!done) {
+                    wait(timeout.getValue());
+                }
+            } catch (InterruptedException ex) {
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/RelativeMouse.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+
+package org.jemmy.fx;
+
+import javafx.geometry.BoundingBox;
+import javafx.geometry.Bounds;
+import javafx.scene.Node;
+import javafx.stage.Window;
+import org.jemmy.JemmyException;
+import org.jemmy.Point;
+import org.jemmy.action.GetAction;
+import org.jemmy.interfaces.Modifier;
+import org.jemmy.interfaces.Mouse;
+
+
+/**
+ * Port of the org.jemmy.fx.FXRelativeMouse
+ *
+ * @author Sergey Grinev
+ */
+public class RelativeMouse implements Mouse {
+
+    private Mouse theMouse;
+    private NodeWrap<? extends Node> node;
+    private Point lastMove = null;
+
+    public RelativeMouse(Mouse theMouse, NodeWrap<? extends Node> node) {
+        this.theMouse = theMouse;
+        this.node = node;
+    }
+
+    static Boolean isInWindow(final NodeWrap<? extends Node> node, final Point p) {
+        return new GetAction<Boolean>() {
+            @Override
+            public void run(Object... parameters) {
+                Window window = node.getControl().getScene().getWindow();
+                if (Double.isNaN(window.getX())) { // TODO: temporary stub for RT-12736
+                    setResult(true);
+                    return;
+                }
+                Bounds bounds = new BoundingBox(window.getX(), window.getY(), 0, window.getWidth(), window.getHeight(), 0);
+                double x = node.getScreenBounds().getX();
+                double y = node.getScreenBounds().getY();
+                if (p == null) {
+                    x+= node.getClickPoint().getX();
+                    y+= node.getClickPoint().getY();
+                } else {
+                    x+= p.getX();
+                    y+= p.getY();
+                }
+                setResult(bounds.contains(x, y));
+            }
+        }.dispatch(node.getEnvironment());
+    }
+
+    @Override
+    public void press() {
+        if (!isInWindow(node, lastMove)) {// TODO: using drag&drop is questionable
+            throw new JemmyException("Click point is outside the window", node);
+        }
+        theMouse.press();
+    }
+
+    @Override
+    public void press(MouseButton button) {
+        if (!isInWindow(node, null)) {// TODO: using drag&drop is questionable
+            throw new JemmyException("Click point is outside the window", node);
+        }
+        theMouse.press(button);
+    }
+
+    @Override
+    public void press(MouseButton button, Modifier... modifiers) {
+        if (!isInWindow(node, null)) {// TODO: using drag&drop is questionable
+            throw new JemmyException("Click point is outside the window", node);
+        }
+        theMouse.press(button, modifiers);
+    }
+
+    @Override
+    public void release() {
+        theMouse.release();
+    }
+
+    @Override
+    public void release(MouseButton button) {
+        theMouse.release(button);
+    }
+
+    @Override
+    public void release(MouseButton button, Modifier... modifiers) {
+        theMouse.release(button, modifiers);
+    }
+
+    @Override
+    public void move() {
+        theMouse.move();
+    }
+
+    @Override
+    public void move(Point p) {
+        lastMove = p;
+        theMouse.move(NodeWrap.convertToAbsoluteLayout(node, p));
+    }
+
+    @Override
+    public void click() {
+        if (!isInWindow(node, null)) {// TODO: using drag&drop is questionable
+            throw new JemmyException("Click point is outside the window", node);
+        }
+        theMouse.click();
+    }
+
+    @Override
+    public void click(int count) {
+        if (!isInWindow(node, null)) {// TODO: using drag&drop is questionable
+            throw new JemmyException("Click point is outside the window", node);
+        }
+        theMouse.click(count);
+    }
+
+    @Override
+    public void click(int count, Point p) {
+        if (!isInWindow(node, p)) {// TODO: using drag&drop is questionable
+            throw new JemmyException("Click point is outside the window", node);
+        }
+        theMouse.click(count, NodeWrap.convertToAbsoluteLayout(node, p));
+    }
+
+    @Override
+    public void click(int count, Point p, MouseButton button) {
+        if (!isInWindow(node, p)) {// TODO: using drag&drop is questionable
+            throw new JemmyException("Click point is outside the window", node);
+        }
+        theMouse.click(count, NodeWrap.convertToAbsoluteLayout(node, p), button);
+    }
+
+    @Override
+    public void click(int count, Point p, MouseButton button, Modifier... modifiers) {
+        if (!isInWindow(node, p)) {// TODO: using drag&drop is questionable
+            throw new JemmyException("Click point is outside the window", node);
+        }
+        theMouse.click(count, NodeWrap.convertToAbsoluteLayout(node, p), button, modifiers);
+    }
+
+    @Override
+    public Mouse detached() {
+        return theMouse.detached();
+    }
+
+    public void turnWheel(int i) {
+        theMouse.turnWheel(i);
+    }
+
+    public void turnWheel(Point point, int i) {
+        theMouse.turnWheel(point, i);
+    }
+
+    public void turnWheel(Point point, int i, Modifier... mdfrs) {
+        theMouse.turnWheel(point, i, mdfrs);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/Root.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+
+package org.jemmy.fx;
+
+import javafx.scene.Scene;
+import org.jemmy.control.Wrapper;
+import org.jemmy.env.Environment;
+import org.jemmy.fx.control.ThemeDriverFactory;
+import org.jemmy.input.AWTRobotInputFactory;
+import org.jemmy.lookup.AbstractParent;
+import org.jemmy.lookup.Lookup;
+import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.lookup.PlainLookup;
+
+/**
+ *
+ * @author shura
+ */
+public class Root extends AbstractParent<Scene> {
+
+    public static final Root ROOT = new Root();
+    public static final String LOOKUP_STRING_COMPARISON = Root.class.getName() +
+            ".lookup.string.compare";
+    public static final String THEME_FACTORY = "fx.theme.factory";
+    public static final String INPUT_SOURCE = Root.class.getName() + ".input.method";
+
+    private Environment env;
+    private SceneWrapper wrapper;
+    private SceneList scenes;
+
+    private Root() {
+        this.env = new Environment(Environment.getEnvironment());
+        this.env.setExecutor(QueueExecutor.EXECUTOR);
+        if (Environment.getEnvironment().getInputFactory() == null) {
+            Environment.getEnvironment().setInputFactory(new AWTRobotInputFactory());
+        }
+        Environment.getEnvironment().setProperty(THEME_FACTORY, ThemeDriverFactory.newInstance());
+        Environment.getEnvironment().initTimeout(QueueExecutor.QUEUE_THROUGH_TIME);
+        Environment.getEnvironment().initTimeout(QueueExecutor.QUEUE_IDENTIFYING_TIMEOUT);
+        wrapper = new SceneWrapper(env);
+        scenes = new SceneList();
+    }
+
+    public Wrapper getSceneWrapper() {
+        return wrapper;
+    }
+
+    /**
+     * This is the environment to be used for all test code for client.
+     * All wraps and other objects are assinged a child of this environment, ultimately.
+     * @return the client testing environment
+     */
+    public Environment getEnvironment() {
+        return env;
+    }
+
+    /**
+     *
+     * @param factory
+     * @return
+     */
+    public ThemeDriverFactory setThemeFactory(ThemeDriverFactory factory) {
+        return (ThemeDriverFactory) env.setProperty(THEME_FACTORY, factory);
+    }
+
+    /**
+     *
+     * @return
+     */
+    public ThemeDriverFactory getThemeFactory() {
+        return (ThemeDriverFactory) env.getProperty(THEME_FACTORY);
+    }
+
+    public <ST extends Scene> Lookup<ST> lookup(Class<ST> controlClass, LookupCriteria<ST> criteria) {
+        return new PlainLookup<ST>(env, scenes, wrapper, controlClass, criteria);
+    }
+
+    public Lookup<Scene> lookup(LookupCriteria<Scene> criteria) {
+        return new PlainLookup<Scene>(env, scenes, wrapper, Scene.class, criteria);
+    }
+
+    public Class<Scene> getType() {
+        return Scene.class;
+    }
+
+    public static final String USE_NATIVE_COORDINATES = "use.native.sg.coordinates";
+
+    //TODO: shouldn't this be in utility class used by all root impls?
+    static boolean isPropertyTrue(Environment env, String property) {
+        Object propValue = env.getProperty(property);
+        return propValue != null && (propValue.equals(true) || propValue.equals("true"));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/SceneList.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,41 @@
+package org.jemmy.fx;
+
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import javafx.scene.Scene;
+import javafx.stage.Window;
+import org.jemmy.action.GetAction;
+import org.jemmy.lookup.ControlList;
+
+
+/**
+ *
+ * @author shura
+ */
+class SceneList implements ControlList {
+
+    public List<?> getControls() {
+        GetAction<List<?>> scenes = new GetAction<List<?>>() {
+
+            @Override
+            public void run(Object... parameters) {
+                LinkedList<Scene> res = new LinkedList<Scene>();
+                Iterator<Window> windows = Window.impl_getWindows();
+                while(windows.hasNext()) {
+                    res.add(windows.next().getScene());
+                }
+                setResult(res);
+            }
+        };
+        try {
+            Root.ROOT.getEnvironment().getExecutor().execute(Root.ROOT.getEnvironment(), true, scenes);
+            return scenes.getResult();
+        } catch (Throwable th) {
+            th.printStackTrace(System.err);
+            return new ArrayList();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/SceneWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. DO NOT
+ * ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+package org.jemmy.fx;
+
+import java.awt.Point;
+import javafx.embed.swing.JFXPanel;
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import javafx.stage.Window;
+import org.jemmy.Rectangle;
+import org.jemmy.action.GetAction;
+import org.jemmy.awt.AWT;
+import org.jemmy.awt.Showing;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.Wrap;
+import org.jemmy.dock.DefaultParent;
+import org.jemmy.dock.DefaultWrapper;
+import org.jemmy.dock.ObjectLookup;
+import org.jemmy.env.Environment;
+import org.jemmy.interfaces.Parent;
+import org.jemmy.interfaces.TypeControlInterface;
+import org.jemmy.lookup.AbstractParent;
+import org.jemmy.lookup.Any;
+import org.jemmy.lookup.HierarchyLookup;
+import org.jemmy.lookup.Lookup;
+import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.resources.StringComparePolicy;
+
+/**
+ *
+ * @author shura
+ */
+@ControlType(Scene.class)
+@ControlInterfaces(value = Parent.class, encapsulates = Node.class)
+public class SceneWrap<T extends Scene> extends Wrap<Scene> {
+
+    @DefaultWrapper
+    public static <TP extends Scene> Wrap<? extends TP> wrap(Environment env, Class<TP> type, TP control) {
+        Wrap<? extends TP> res = Root.ROOT.getSceneWrapper().wrap(type, control);
+        res.setEnvironment(env);
+        return res;
+    }
+
+    @ObjectLookup("title and comparison policy")
+    public static <B extends Scene> LookupCriteria<B> titleLookup(Class<B> tp, String title, StringComparePolicy policy) {
+        return new ByTitleSceneLookup<B>(title, policy);
+    }
+
+    @ObjectLookup("")
+    public static <B extends Scene> LookupCriteria<B> anyLookup(Class<B> tp) {
+        return new Any<B>();
+    }
+
+    @DefaultParent("all scenes")
+    public static <CONTROL extends Scene> Parent<? super Scene> getRoot(Class<CONTROL> controlType) {
+        return Root.ROOT;
+    }
+    private Parent parent = null;
+
+    public SceneWrap(Environment env, Scene node) {
+        super(env, node);
+    }
+
+    @Override
+    public Rectangle getScreenBounds() {
+        return getScreenBounds(getEnvironment(), getControl());
+    }
+
+    public static Rectangle getScreenBounds(final Environment env, final Scene scene) {
+        GetAction<Rectangle> bounds = new GetAction<Rectangle>() {
+
+            @Override
+            public void run(Object... parameters) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
+                Rectangle sceneBounds = getSceneBounds(env, scene);
+                Point stageCoordinates = null;
+                // TODO: stub
+                String prop = System.getProperty("javafx.swinginteroperability");
+                if (prop != null && prop.compareToIgnoreCase("true") == 0) {
+                    JFXPanel panel = AWT.getAWT().lookup(JFXPanel.class, new Showing<JFXPanel>() {
+
+                        @Override
+                        public boolean check(JFXPanel control) {
+                            return super.check(control) && (control.getScene() == scene);
+                        }
+                    }).wrap().getControl();
+                    sceneBounds.translate((int) panel.getLocationOnScreen().getX(), (int) panel.getLocationOnScreen().getY());
+                } else {
+                    Window window = scene.getWindow();
+                    /*
+                     * Field host_field =
+                     * window.getClass().getDeclaredField("host");
+                     * host_field.setAccessible(true); Object host =
+                     * host_field.get(window); Field panel_field =
+                     * host.getClass().getDeclaredField("this$0");
+                     * panel_field.setAccessible(true); JFXPanel panel =
+                     * (JFXPanel)panel_field.get(host);
+                     * sceneBounds.translate((int)panel.getLocationOnScreen().getX(), (int)panel.getLocationOnScreen().getY());
+                     */
+                    // TODO: RT-12793
+                    sceneBounds.translate((int) window.getX(), (int) window.getY());
+                }
+                setResult(sceneBounds);
+            }
+        };
+        env.getExecutor().execute(env, true, bounds);
+        return bounds.getResult();
+    }
+
+    /**
+     * Returns bounds of the Scene relative to Stage containing it
+     */
+    private static Rectangle getSceneBounds(Environment env, final Scene scene) {
+        return new Rectangle(scene.getX(), scene.getY(),
+                scene.getWidth(), scene.getHeight());
+    }
+
+    /**
+     * Returns bounds of the Stage relative to screen
+     */
+    private static Rectangle getScreenBounds(Environment env, final Window window) {
+        return new Rectangle(window.getX(), window.getY(),
+                window.getWidth(), window.getHeight());
+    }
+
+    @Override
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> boolean is(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (Parent.class.isAssignableFrom(interfaceClass) && Node.class.equals(type)) {
+            return true;
+        }
+        return super.is(interfaceClass, type);
+    }
+
+    @Override
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (Parent.class.isAssignableFrom(interfaceClass) && Node.class.equals(type)) {
+            if (parent == null) {
+                parent = new SceneParentNode();
+            }
+            return (INTERFACE) parent;
+        }
+        return super.as(interfaceClass, type);
+    }
+
+    private class SceneParentNode extends AbstractParent<Node> {
+
+        @Override
+        public <ST extends Node> Lookup<ST> lookup(Class<ST> controlClass, LookupCriteria<ST> criteria) {
+            javafx.scene.Parent parent = new GetAction<javafx.scene.Parent>() {
+
+                public void run(Object... parameters) throws Exception {
+                    setResult(getControl().getRoot());
+                }
+            }.dispatch(getEnvironment());
+            return new HierarchyLookup<ST>(getEnvironment(), new NodeHierarchy(getControl(), getEnvironment()),
+                    new NodeWrapper(getEnvironment()), controlClass, criteria);
+        }
+
+        @Override
+        public Lookup<Node> lookup(LookupCriteria<Node> criteria) {
+            return lookup(Node.class, criteria);
+        }
+
+        @Override
+        public Class<Node> getType() {
+            return Node.class;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/SceneWrapper.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,26 @@
+package org.jemmy.fx;
+
+
+import javafx.scene.Scene;
+import org.jemmy.control.Wrap;
+import org.jemmy.env.Environment;
+
+/**
+ *
+ * @author shura
+ */
+class SceneWrapper implements org.jemmy.control.Wrapper {
+
+    private Environment env;
+
+    SceneWrapper(Environment env) {
+        this.env = env;
+    }
+
+    public <T> Wrap<? extends T> wrap(Class<T> controlClass, T control) {
+        if (controlClass.isAssignableFrom(Scene.class)) {
+            return new SceneWrap(new Environment(env), (Scene) control);
+        }
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/TextWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,91 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx;
+
+import javafx.scene.Scene;
+import javafx.scene.text.Text;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.Wrap;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.MethodProperties;
+import org.jemmy.control.Property;
+import org.jemmy.env.Environment;
+import org.jemmy.lookup.Any;
+import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.resources.StringComparePolicy;
+
+/**
+ *
+ * @param <T>
+ * @author Shura
+ */
+@ControlType({Text.class})
+@ControlInterfaces({org.jemmy.interfaces.Text.class})
+public class TextWrap<T extends Text> extends NodeWrap<T> implements org.jemmy.interfaces.Text {
+
+    /**
+     *
+     * @param scene
+     * @param nd
+     */
+    public TextWrap(Environment env, T node) {
+        super(env, node);
+    }
+
+    /**
+     * Look for a certain node and create an operator for it.
+     * @param parent
+     * @param type
+     * @param criteria
+     */
+    public static TextWrap<Text> find(NodeParent parent, LookupCriteria<Text> criteria) {
+        return new TextWrap<Text>(parent.getEnvironment(),
+                parent.getParent().lookup(Text.class, criteria).get());
+    }
+
+    public static TextWrap<Text> find(NodeParent parent, String text) {
+        return find(parent, new ByText<Text>(text, parent.getEnvironment().
+                getProperty(Root.LOOKUP_STRING_COMPARISON, StringComparePolicy.EXACT)));
+    }
+
+    @Override
+    @Property(Wrap.TEXT_PROP_NAME)
+    public String text() {
+        return ByText.getNodeText(getControl());
+    }
+
+    @Override
+    public void type(String arg0) {
+    }
+
+    @Override
+    public void clear() {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/WindowElement.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,49 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+
+package org.jemmy.fx;
+
+import org.jemmy.interfaces.TypeControlInterface;
+
+/**
+ * The interface specifies how to get window (a.k.a. root element) where control
+ * resides. For different control libraries this could be
+ * different things: <code>java.awt.Window</code> for AWT,
+ * <code>javafx.scene.Scene</code> for FX, etc.
+ * @param <WINDOW> type of the root element.
+ * @author shura
+ */
+public interface WindowElement<WINDOW> extends TypeControlInterface<WINDOW>{
+    /**
+     * Returns root hierarchy element.
+     * @return
+     */
+    public WINDOW getWindow();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/AbstractItemsParent.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,89 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+
+import java.util.List;
+import org.jemmy.control.Wrap;
+import org.jemmy.control.Wrapper;
+import org.jemmy.lookup.AbstractParent;
+import org.jemmy.lookup.ControlList;
+import org.jemmy.lookup.Lookup;
+import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.lookup.PlainLookup;
+
+
+public abstract class AbstractItemsParent<ITEM extends Object> extends AbstractParent<ITEM> {
+
+    protected ItemsList itemsListCreator;
+    protected Wrap wrap;
+    protected Wrapper wrapper;
+    protected Class<ITEM> itemClass;
+
+    /**
+     *
+     * @param scene
+     * @param listViewWrap
+     * @param itemClass
+     */
+    public AbstractItemsParent(Wrap wrap, Wrapper wrapper, Class<ITEM> itemClass) {
+        this.wrap = wrap;
+        this.wrapper = wrapper;
+        this.itemClass = itemClass;
+        itemsListCreator = new ItemsList();
+    }
+
+    @Override
+    public <ST extends ITEM> Lookup<ST> lookup(Class<ST> controlClass, LookupCriteria<ST> criteria) {
+        return new PlainLookup<ST>(wrap.getEnvironment(),
+                                   itemsListCreator, wrapper, controlClass, criteria);
+    }
+
+    @Override
+    public Lookup<ITEM> lookup(LookupCriteria<ITEM> criteria) {
+        return this.lookup(itemClass, criteria);
+    }
+
+    @Override
+    public Class<ITEM> getType() {
+        return itemClass;
+    }
+
+    protected class ItemsList implements ControlList {
+
+        @Override
+        @SuppressWarnings("unchecked")
+        public List<ITEM> getControls() {
+            return AbstractItemsParent.this.getControls();
+        }
+    }
+
+    protected abstract List<ITEM> getControls();
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/AbstractMenuItemsParent.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,62 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.control.Menu;
+import javafx.scene.control.MenuItem;
+import org.jemmy.JemmyException;
+import org.jemmy.control.Wrap;
+import org.jemmy.control.Wrapper;
+
+public abstract class AbstractMenuItemsParent<ITEM extends MenuItem> extends AbstractItemsParent<ITEM> {
+
+    public AbstractMenuItemsParent(Wrap wrap, Class<ITEM> itemClass) {
+        super(wrap, new ItemWrapper(wrap), itemClass);
+    }
+
+    protected static class ItemWrapper<ITEM extends MenuItem> implements Wrapper {
+        protected Wrap wrap;
+
+        public ItemWrapper(Wrap wrap) {
+            this.wrap = wrap;
+        }
+
+        @Override
+        public <T> Wrap<? extends T> wrap(Class<T> controlClass, T control) {
+            if (MenuItem.class.isAssignableFrom(controlClass)) {
+                if (Menu.class.isAssignableFrom(control.getClass())) {
+                    return (Wrap<? extends T>) new MenuWrap<Menu>((Menu)control, wrap);
+                }
+                return (Wrap<? extends T>) new MenuItemWrap<ITEM>((ITEM)control, wrap);
+            }
+            throw new JemmyException("Unexpected control class is used: " + controlClass);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ByIdMenuItem.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,29 @@
+/*
+ * To change this template, choose Tools | Templates and open the template in
+ * the editor.
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.control.MenuItem;
+import org.jemmy.lookup.ByStringLookup;
+import org.jemmy.resources.StringComparePolicy;
+
+/**
+ *
+ * @author shura
+ */
+public class ByIdMenuItem<T extends MenuItem> extends ByStringLookup<T> {
+
+    public ByIdMenuItem(String text, StringComparePolicy policy) {
+        super(text, policy);
+    }
+
+    public ByIdMenuItem(String text) {
+        this(text, StringComparePolicy.EXACT);
+    }
+
+    @Override
+    public String getText(T t) {
+        return t.getId();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ByTextMenuItem.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,26 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.control.MenuItem;
+import org.jemmy.lookup.ByStringLookup;
+import org.jemmy.resources.StringComparePolicy;
+
+/**
+ *
+ * @author shura
+ */
+public class ByTextMenuItem<T extends MenuItem> extends ByStringLookup<T> {
+
+    public ByTextMenuItem(String text, StringComparePolicy policy) {
+        super(text, policy);
+    }
+
+    @Override
+    public String getText(T t) {
+        return t.getText();
+    }
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/CheckBoxWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,274 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import java.util.ArrayList;
+import java.util.List;
+import javafx.scene.Scene;
+import javafx.scene.control.CheckBox;
+import org.jemmy.JemmyException;
+import org.jemmy.action.GetAction;
+import org.jemmy.fx.ByText;
+import org.jemmy.fx.NodeParent;
+import org.jemmy.fx.Root;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.MethodProperties;
+import org.jemmy.control.Property;
+import org.jemmy.control.SelectorImpl;
+import org.jemmy.env.Environment;
+import org.jemmy.interfaces.ControlInterface;
+import org.jemmy.interfaces.Selectable;
+import org.jemmy.interfaces.Selector;
+import org.jemmy.interfaces.TypeControlInterface;
+import org.jemmy.lookup.Any;
+import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.resources.StringComparePolicy;
+
+/**
+ *
+ * @param <T>
+ * @author Shura
+ */
+@ControlType({CheckBox.class})
+@ControlInterfaces({Selectable.class})
+public class CheckBoxWrap<T extends CheckBox> extends TextControlWrap<T> implements Selectable<CheckBoxWrap.State> {
+
+    /**
+     *
+     */
+    public static final String IS_TRI_STATE_PROP_NAME = "is.tri.state";
+
+    @Override
+    public List<State> getStates() {
+            return new GetAction<List<State>>() {
+
+                @Override
+                public void run(Object... parameters) {
+                    if (getControl().isAllowIndeterminate()) {
+                        setResult(triStates);
+                    } else {
+                        setResult(twoStates);
+                    }
+                }
+            }.dispatch(getEnvironment());
+    }
+
+    @Override
+    public Selector<State> selector() {
+            return stateSelector;
+    }
+
+    @Override
+    public Class<State> getType() {
+            return State.class;
+    }
+
+    /**
+     *
+     */
+    public enum State {
+
+        /**
+         *
+         */
+        CHECKED,
+        /**
+         * 
+         */
+        UNCHECKED,
+        /**
+         *
+         */
+        UNDEFINED
+    };
+    private final static List<Boolean> booleanStates;
+    private final static List<State> twoStates;
+    private final static List<State> triStates;
+    private Selector<State> stateSelector = new SelectorImpl<CheckBox, State>(this, this);
+    private Selectable<Boolean> booleanSelectable = new Selectable<Boolean>() {
+
+        @Override
+        public List<Boolean> getStates() {
+            return booleanStates;
+        }
+
+        @Override
+        public Boolean getState() {
+            return CheckBoxWrap.this.getState() == State.CHECKED;
+        }
+
+        @Override
+        public Selector<Boolean> selector() {
+            return booleanSelector;
+        }
+
+        @Override
+        public Class<Boolean> getType() {
+            return Boolean.class;
+        }
+    };
+    private Selector<Boolean> booleanSelector = new Selector<Boolean>() {
+
+        @Override
+        public void select(Boolean state) {
+            stateSelector.select(state ? State.CHECKED : State.UNCHECKED);
+        }
+    };
+
+    static {
+        booleanStates = new ArrayList<Boolean>();
+        booleanStates.add(false);
+        booleanStates.add(true);
+        twoStates = new ArrayList<State>();
+        twoStates.add(State.UNCHECKED);
+        twoStates.add(State.CHECKED);
+        triStates = new ArrayList<State>();
+        triStates.add(State.UNCHECKED);
+        triStates.add(State.UNDEFINED);
+        triStates.add(State.CHECKED);
+    }
+
+    /**
+     *
+     * @param scene
+     * @param nd
+     */
+    public CheckBoxWrap(Environment env, T node) {
+        super(env, node);
+    }
+
+    public static CheckBoxWrap<CheckBox> find(NodeParent parent, LookupCriteria<CheckBox> criteria) {
+        return new CheckBoxWrap<CheckBox>(parent.getEnvironment(), 
+                parent.getParent().lookup(CheckBox.class, criteria).get());
+    }
+
+    public static CheckBoxWrap<CheckBox> find(NodeParent parent, String text) {
+        return find(parent, new ByText<CheckBox>(text, parent.getEnvironment().
+                getProperty(Root.LOOKUP_STRING_COMPARISON, StringComparePolicy.EXACT)));
+    }
+    /**
+     *
+     * @param box
+     * @return
+     */
+    public static State getState(CheckBox box) {
+        if (!box.isIndeterminate()) {
+            return box.isSelected() ? State.CHECKED : State.UNCHECKED;
+        } else {
+            return State.UNDEFINED;
+        }
+    }
+
+    /**
+     *
+     * @return
+     */
+    @Property(SELECTED_PROP_NAME)
+    @Override
+    public State getState() {
+        return new GetAction<State>() {
+
+            @Override
+            public void run(Object... parameters) {
+                setResult(getState(getControl()));
+            }
+
+            @Override
+            public String toString() {
+                return "Getting state of " + getControl();
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    /**
+     *
+     * @return
+     */
+    @Property(IS_TRI_STATE_PROP_NAME)
+    public boolean isTriState() {
+        return new GetAction<Boolean>() {
+
+            @Override
+            public void run(Object... parameters) {
+                setResult(getControl().isAllowIndeterminate());
+            }
+
+            @Override
+            public String toString() {
+                return "Checking if tri-state " + getControl();
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    private void ensureNoTriState() {
+        if (isTriState()) {
+            throw new JemmyException("The check box has allowTriState on - not possible to treat as boolean selectable", getControl());
+        }
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>>  boolean is(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (interfaceClass.equals(Selectable.class) && (type.equals(State.class) || type.equals(Boolean.class) && !isTriState())) {
+            return true;
+        }
+        return super.is(interfaceClass, type);
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> boolean is(Class<INTERFACE> interfaceClass) {
+        return interfaceClass.equals(Selectable.class) || super.is(interfaceClass);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>>  INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (interfaceClass.equals(Selectable.class)) {
+            if (type.equals(State.class)) {
+                return (INTERFACE) this;
+            }
+            if (type.equals(Boolean.class)) {
+                ensureNoTriState();
+                return (INTERFACE) booleanSelectable;
+            }
+        }
+        return super.as(interfaceClass, type);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass) {
+        if (interfaceClass.equals(Selectable.class)) {
+            return (INTERFACE) as(Selectable.class, State.class);
+        }
+        return super.as(interfaceClass);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ChoiceBoxWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+package org.jemmy.fx.control;
+
+import java.util.List;
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.ChoiceBox;
+import javafx.scene.control.MenuButton;
+import javafx.scene.control.MenuItem;
+import javafx.stage.PopupWindow;
+import org.jemmy.action.GetAction;
+import org.jemmy.fx.ByText;
+import org.jemmy.fx.ByWindowType;
+import org.jemmy.fx.Root;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.MethodProperties;
+import org.jemmy.control.Property;
+import org.jemmy.control.Wrap;
+import org.jemmy.env.Environment;
+import org.jemmy.interfaces.ControlInterface;
+import org.jemmy.interfaces.Parent;
+import org.jemmy.interfaces.Selectable;
+import org.jemmy.interfaces.Selector;
+import org.jemmy.lookup.LookupCriteria;
+
+/**
+ *
+ * @author shura
+ */
+@ControlType(ChoiceBox.class)
+@ControlInterfaces(value=Selectable.class)
+public class ChoiceBoxWrap<T extends ChoiceBox> extends ControlWrap<T>
+        implements Selectable<Object> {
+
+    public static final String IS_SHOWING_PROP_NAME = "isShowing";
+
+    public ChoiceBoxWrap(Environment env, T node) {
+        super(env, node);
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> boolean is(Class<INTERFACE> interfaceClass) {
+        if (interfaceClass.equals(Selectable.class)) {
+            return true;
+        }
+        return super.is(interfaceClass);
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass) {
+        if (interfaceClass.equals(Selectable.class)) {
+            return (INTERFACE) this;
+        }
+        return super.as(interfaceClass);
+    }
+
+    public List getStates() {
+        return new GetAction<List>() {
+
+            @Override
+            public void run(Object... os) throws Exception {
+                setResult(getControl().getItems());
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    public Object getState() {
+        return new GetAction() {
+
+            @Override
+            public void run(Object... os) throws Exception {
+                setResult(getControl().getSelectionModel().getSelectedItem());
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    public Selector<Object> selector() {
+        return new ChoiceSelector();
+    }
+
+    public Class<Object> getType() {
+        return Object.class;
+    }
+
+    @Property(IS_SHOWING_PROP_NAME)
+    public boolean isShowing() {
+        return new GetAction<Boolean>() {
+
+            @Override
+            public void run(Object... os) throws Exception {
+                setResult(getControl().isShowing());
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    private class ChoiceSelector implements Selector {
+
+        public void select(final Object state) {
+            if (!isShowing()) {
+                mouse().click();
+            }
+            Parent<Node> popupContainer =
+                    Root.ROOT.lookup(new ByWindowType(PopupWindow.class)).
+                    as(Parent.class, Node.class);
+
+            // TODO: figure out what to do with duplicate strings
+            popupContainer.lookup(Node.class, new LookupCriteria<Node>() {
+                public boolean check(Node cntrl) {
+                    MenuItem item = (MenuItem)cntrl.getProperties().get(MenuItem.class);
+                    if (item == null) {
+                        return false;
+                    };
+                    if (!item.getText().contentEquals(state.toString())) {
+                        return false;
+                    }
+                    return true;
+                }
+            }).wrap().mouse().click();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ComboBoxWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,152 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.jemmy.fx.control;
+
+import java.util.List;
+import javafx.scene.Node;
+import javafx.scene.control.ComboBox;
+import javafx.scene.control.ListView;
+import javafx.scene.control.TextField;
+import javafx.stage.PopupWindow;
+import org.jemmy.action.GetAction;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.Property;
+import org.jemmy.control.Wrap;
+import org.jemmy.env.Environment;
+import org.jemmy.fx.ByStyleClass;
+import org.jemmy.fx.ByWindowType;
+import org.jemmy.fx.Root;
+import org.jemmy.interfaces.ControlInterface;
+import org.jemmy.interfaces.Focus;
+import org.jemmy.interfaces.Focusable;
+import org.jemmy.interfaces.Parent;
+import org.jemmy.interfaces.Selectable;
+import org.jemmy.interfaces.Selector;
+import org.jemmy.lookup.Lookup;
+import org.jemmy.timing.State;
+
+@ControlType(ComboBox.class)
+@ControlInterfaces(value=Selectable.class)
+public class ComboBoxWrap<T extends ComboBox> extends ControlWrap<T>
+        implements Selectable<Object> {
+
+    public ComboBoxWrap(Environment env, T node) {
+        super(env, node);
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> boolean is(Class<INTERFACE> interfaceClass) {
+        if (interfaceClass.equals(Selectable.class)) {
+            return true;
+        }
+        if (interfaceClass.equals(Focusable.class)) {
+            return true;
+        }
+        Wrap<? extends TextField> inputField = getTextField();
+        if (inputField != null) {
+            return inputField.is(interfaceClass);
+        }
+        return super.is(interfaceClass);
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass) {
+        if (interfaceClass.equals(Selectable.class)) {
+            return (INTERFACE) this;
+        }
+        if (interfaceClass.equals(Focusable.class)) {
+            return (INTERFACE) this;
+        }
+        Wrap<? extends TextField> inputField = getTextField();
+        if (inputField != null) {
+            return inputField.as(interfaceClass);
+        }
+        return super.as(interfaceClass);
+    }
+
+    @Override
+    public Focus focuser() {
+        return focus;
+    }
+
+    private Focus focus = new Focus() {
+        public void focus() {
+            if (!isFocused()) {
+                ComboBoxWrap.this.as(Parent.class, Node.class).lookup(new ByStyleClass<Node>("arrow-button")).wrap().mouse().click(isShowing() ? 1 : 2);
+            }
+            waitState(focusedState, true);
+        }
+    };
+
+    private State<Boolean> focusedState = new State<Boolean>() {
+        public Boolean reached() {
+            return isFocused();
+        }
+    };
+
+    protected Wrap<? extends TextField> getTextField() {
+        Lookup lookup = as(Parent.class, Node.class).lookup(TextField.class);
+        if (lookup.size() > 0) {
+            Wrap<? extends TextField> inputField = as(Parent.class, Node.class).lookup(TextField.class).wrap();
+            return inputField;
+        }
+        return null;
+    }
+
+
+    public List getStates() {
+        return new GetAction<List>() {
+            @Override
+            public void run(Object... os) throws Exception {
+                setResult(getControl().getItems());
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    public Object getState() {
+        return new GetAction() {
+
+            @Override
+            public void run(Object... os) throws Exception {
+                setResult(getControl().getSelectionModel().getSelectedItem());
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    public Selector<Object> selector() {
+        return new ComboSelector();
+    }
+
+    public Class<Object> getType() {
+        return Object.class;
+    }
+
+    @Property(ChoiceBoxWrap.IS_SHOWING_PROP_NAME)
+    public boolean isShowing() {
+        return new GetAction<Boolean>() {
+            @Override
+            public void run(Object... os) throws Exception {
+                setResult(getControl().isShowing());
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    private class ComboSelector implements Selector {
+
+        public void select(final Object state) {
+            if (!isShowing()) {
+                ComboBoxWrap.this.as(Parent.class, Node.class).lookup(new ByStyleClass<Node>("arrow-button")).wrap().mouse().click();
+            }
+            Parent<Node> popupContainer =
+                    Root.ROOT.lookup(new ByWindowType(PopupWindow.class)).
+                    as(Parent.class, Node.class);
+
+            Wrap<? extends ListView> list = popupContainer.lookup(ListView.class).wrap();
+            list.as(Selectable.class).selector().select(state);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ControlWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,53 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the Common Development
+ * and Distribution License (the "License"). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header Notice in each
+ * file.
+ *
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library. The Initial Developer of the
+ * Original Software is Alexandre Iline. All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.Scene;
+import javafx.scene.control.Tooltip;
+import org.jemmy.fx.NodeWrap;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.MethodProperties;
+import org.jemmy.env.Environment;
+
+/**
+ *
+ * @param <T>
+ * @author shura
+ */
+@ControlType(javafx.scene.control.Control.class)
+@MethodProperties(value = "getTooltip", types = Tooltip.class)
+public class ControlWrap<T extends javafx.scene.control.Control> extends NodeWrap<T> {
+
+    /**
+     *
+     * @param scene
+     * @param nd
+     */
+    public ControlWrap(Environment env, T node) {
+        super(env, node);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/FXStringMenuOwner.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,85 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.control.Menu;
+import javafx.scene.control.MenuItem;
+import org.jemmy.control.Wrap;
+import org.jemmy.input.StringMenuOwner;
+import org.jemmy.interfaces.Parent;
+import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.resources.StringComparePolicy;
+
+/**
+ *
+ * @author shura
+ */
+class FXStringMenuOwner extends StringMenuOwner<MenuItem> {
+
+    Parent<Menu> parent;
+    public FXStringMenuOwner(Wrap<?> wrap, Parent<Menu> parent) {
+        super(wrap);
+        this.parent = parent;
+    }
+
+    @Override
+    protected LookupCriteria<MenuItem> createCriteria(String string, StringComparePolicy scp) {
+        return new ByTextMenuItem(string, scp);
+    }
+
+    public Class<MenuItem> getType() {
+        return MenuItem.class;
+    }
+
+    public org.jemmy.interfaces.Menu menu() {
+        return new org.jemmy.interfaces.Menu() {
+
+            public void push(LookupCriteria... lcs) {
+                select(lcs).mouse().click();
+            }
+
+            public Wrap select(LookupCriteria... criteria) {
+                if (criteria.length == 0) {
+                    throw new IllegalStateException("criteria list supposed to be not empty");
+                }
+                Wrap<? extends MenuItem> res = findMenu(criteria[0]);
+                if (criteria.length > 1) {
+                    res = showMenu(res, decreaseCriteria(criteria));
+                }
+                res.mouse().move();
+                return res;
+            }
+
+            private Wrap<? extends javafx.scene.control.Menu> findMenu(LookupCriteria<Menu> criteria) {
+                return parent.lookup(criteria).wrap();
+            }
+        };
+    }
+    
+    static Wrap<? extends MenuItem> showMenu(Wrap<? extends MenuItem> parent, LookupCriteria<MenuItem>... criteria) {
+        if (criteria.length == 0) {
+            throw new IllegalStateException("Length supposed to be greater than 0 at this moment");
+        }
+        parent.mouse().move();
+        Parent<MenuItem> container = parent.as(Parent.class, MenuItem.class);
+        Wrap<? extends MenuItem> next = container.lookup(criteria[0]).wrap();
+        if (criteria.length == 1) {
+            return next;
+        } else {
+            if (!(next.getControl() instanceof Menu)) {
+                throw new IllegalStateException("Should be menu: " + next.getControl().toString());
+            }
+            return showMenu((Wrap<? extends Menu>) next, decreaseCriteria(criteria));
+        }
+    }
+
+    static <T> LookupCriteria<T>[] decreaseCriteria(LookupCriteria<T>[] longer) {
+        LookupCriteria[] res = new LookupCriteria[longer.length - 1];
+        for (int i = 1; i < longer.length; i++) {
+            res[i - 1] = longer[i];
+        }
+        return res;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ItemParent.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,247 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+import org.jemmy.control.Wrap;
+import org.jemmy.interfaces.*;
+import org.jemmy.interfaces.EditableCellOwner.CellEditor;
+import org.jemmy.interfaces.Keyboard.KeyboardModifier;
+import org.jemmy.interfaces.Keyboard.KeyboardModifiers;
+import org.jemmy.interfaces.Mouse.MouseButtons;
+import org.jemmy.lookup.Any;
+import org.jemmy.lookup.Lookup;
+import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.timing.State;
+
+public abstract class ItemParent<ITEM, T, AUX> implements EditableCellOwner<T> {
+
+    private List<ITEM> found = new ArrayList<ITEM>();
+    private List<AUX> aux = new ArrayList<AUX>();
+    private Class<T> lookupClass;
+    private LookupCriteria<T> lookupCriteria;
+    private Wrap<?> owner;
+    private CellEditor<? super T> editor = null;
+
+    public ItemParent(Wrap<?> owner, Class<T> lookupClass) {
+        this(owner, lookupClass, new Any<T>());
+    }
+
+    protected ItemParent(Wrap<?> owner, Class<T> lookupClass, LookupCriteria<T> lookupCriteria) {
+        this.lookupClass = lookupClass;
+        this.lookupCriteria = lookupCriteria;
+        this.owner = owner;
+    }
+    
+    protected abstract void doRefresh();
+    protected abstract T getValue(ITEM item);
+    protected abstract <DT extends T> Wrap<? extends DT> wrap(Class<DT>type, ITEM item, AUX aux);
+
+    public Class<T> getLookupClass() {
+        return lookupClass;
+    }
+
+    public LookupCriteria<T> getLookupCriteria() {
+        return lookupCriteria;
+    }
+
+    public Wrap<?> getOwner() {
+        return owner;
+    }
+
+    protected void refresh() {
+        found.clear();
+        aux.clear();
+        doRefresh();
+    }
+
+    protected List<ITEM> getFound() {
+        return found;
+    }
+
+    protected List<AUX> getAux() {
+        return aux;
+    }
+
+    protected boolean check(ITEM item, AUX aux) {
+        T value = getValue(item);
+        return lookupClass.isInstance(value)
+                && lookupCriteria.check(lookupClass.cast(value))
+                && (!(lookupCriteria instanceof AuxLookupCriteria) ||
+                    ((AuxLookupCriteria<T, AUX>)lookupCriteria).checkAux(aux));
+    }
+
+    public <ST extends T> Lookup<ST> lookup(Class<ST> type, LookupCriteria<ST> lc) {
+        return new ItemLookup<ST>(this, type, lc);
+    }
+
+    public <ST extends T> Lookup<ST> lookup(Class<ST> type) {
+        return lookup(type, new Any<ST>());
+    }
+
+    public Lookup<T> lookup(LookupCriteria<T> lc) {
+        return lookup(getType(), lc);
+    }
+
+    public Lookup<T> lookup() {
+        return lookup(new Any<T>());
+    }
+
+    public Class<T> getType() {
+        return lookupClass;
+    }
+
+    public void setEditor(CellEditor<? super T> editor) {
+        this.editor = editor;
+    }
+
+    CellEditor<? super T> getEditor() {
+        return editor;
+    }
+
+    public List<Wrap<? extends T>> select(LookupCriteria<T>... criteria) {
+        List<Wrap<? extends T>> res = new ArrayList<Wrap<? extends T>>();
+        KeyboardModifier[] mods = new KeyboardModifier[0];
+        for (LookupCriteria<T> cr : criteria) {
+            Lookup<T> lu = lookup(cr);
+            for (int j = 0; j < lu.size(); j++) {
+                Wrap<? extends T> w = lu.wrap(j);
+                w.as(Showable.class).shower().show();
+                w.mouse().click(1, w.getClickPoint(), MouseButtons.BUTTON1,
+                        mods);
+                mods = new KeyboardModifier[]{KeyboardModifiers.CTRL_DOWN_MASK};
+                res.add(w);
+            }
+        }
+        return res;
+    }
+
+    private class ItemLookup<ST extends T> extends ItemParent<ITEM, ST, AUX>
+            implements Lookup<ST> {
+
+        ItemParent<ITEM, ? super ST, AUX> prev;
+
+        public ItemLookup(ItemParent<ITEM, ? super ST, AUX> prev,
+                Class<ST> type, LookupCriteria<ST> lc) {
+            super(prev.owner, type, lc);
+            this.prev = prev;
+        }
+
+        @Override
+        protected void refresh() {
+            prev.refresh();
+            getFound().clear();
+            for (int i = 0; i < prev.getFound().size(); i++) {
+                if (check(prev.getFound().get(i), prev.getAux().get(i))) {
+                    getFound().add(prev.getFound().get(i));
+                    getAux().add(prev.getAux().get(i));
+                }
+            }
+        }
+
+        public Lookup<? extends ST> wait(final int i) {
+            owner.getEnvironment().getWaiter(Lookup.WAIT_CONTROL_TIMEOUT).
+                    ensureState(new State() {
+
+                public Object reached() {
+                    refresh();
+                    return (getFound().size() >= i) ? true : null;
+                }
+            });
+            return this;
+        }
+
+        public Wrap<? extends ST> wrap(int i) {
+            wait(i + 1);
+            return prev.wrap(super.getType(), getFound().get(i), getAux().get(i));
+        }
+
+        public Wrap<? extends ST> wrap() {
+            return wrap(0);
+        }
+
+        public ST get(int i) {
+            wait(i + 1);
+            return (ST)getValue(getFound().get(i));
+        }
+
+        public ST get() {
+            return get(0);
+        }
+
+        public <INTERFACE extends ControlInterface> INTERFACE as(int i, Class<INTERFACE> type) {
+            return wrap(i).as(type);
+        }
+
+        public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> type) {
+            return as(0, type);
+        }
+
+        public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(int i, Class<INTERFACE> type, Class<TYPE> type1) {
+            return wrap(i).as(type, type1);
+        }
+
+        public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(Class<INTERFACE> type, Class<TYPE> type1) {
+            return as(0, type, type1);
+        }
+
+        public int size() {
+            refresh();
+            return getFound().size();
+        }
+
+        public void dump(PrintStream stream) {
+            //TODO
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        protected void doRefresh() {
+            //this is not needed - should never be called
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        protected ST getValue(ITEM item) {
+            return (ST)prev.getValue(item);
+        }
+
+        @Override
+        public <DT extends ST> Wrap<? extends DT> wrap(Class<DT> type, ITEM item, AUX aux) {
+            return prev.wrap(type, item, aux);
+        }
+    }
+    
+    public interface AuxLookupCriteria<T, AUX> extends LookupCriteria<T> {
+        public boolean checkAux(AUX aux);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ItemWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,55 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.Node;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.Wrap;
+import org.jemmy.interfaces.EditableCellOwner.CellEditor;
+import org.jemmy.interfaces.EditableCellOwner.EditableCell;
+import org.jemmy.interfaces.Show;
+import org.jemmy.interfaces.Showable;
+
+/**
+ *
+ * @author shura
+ */
+@ControlType(Object.class)
+public abstract class ItemWrap<ITEM extends Object> extends Wrap<ITEM> implements Showable, Show, EditableCell<ITEM> {
+
+    protected Wrap<?> viewWrap;
+    protected CellEditor<? super ITEM> editor;
+
+    /**
+     *
+     * @param env
+     * @param item
+     * @param viewWrap
+     */
+    public ItemWrap(ITEM item, Wrap<?> listViewWrap, CellEditor<? super ITEM> editor) {
+        super(listViewWrap.getEnvironment(), item);
+        this.viewWrap = listViewWrap;
+        this.editor = editor;
+    }
+
+    public void edit(ITEM newValue) {
+        as(Showable.class).shower().show();
+        editor.edit(this, newValue);
+    }
+
+    public void select() {
+        as(Showable.class).shower().show();
+        mouse().click();
+    }
+
+    public Class getType() {
+        //this is only needed for editing where type is not really sticking
+        //outside anywhere
+        return Object.class;
+    }
+    
+    protected abstract Wrap<? extends Node> cellWrap();
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ListItemParent.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,95 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the Common Development
+ * and Distribution License (the "License"). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header Notice in each
+ * file.
+ *
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library. The Initial Developer of the
+ * Original Software is Alexandre Iline. All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import java.util.List;
+import javafx.scene.control.ListView;
+import org.jemmy.control.Wrap;
+import org.jemmy.lookup.LookupCriteria;
+
+/**
+ *
+ * @param <ITEM>
+ * @author Shura, KAM
+ */
+public class ListItemParent<ITEM> extends ItemParent<ITEM, ITEM, Integer>
+        implements org.jemmy.interfaces.List<ITEM> {
+
+    ListViewWrap<? extends ListView> listViewOp;
+
+    public ListItemParent(ListViewWrap<? extends ListView> listViewOp, Class<ITEM> itemClass) {
+        super(listViewOp, itemClass);
+        this.listViewOp = listViewOp;
+    }
+
+    @Override
+    protected void doRefresh() {
+        List items = listViewOp.getItems();
+        for (int i = 0; i < items.size(); i++) {
+            Object item = items.get(i);
+            if (getType().isInstance(item)) {
+                getFound().add(getType().cast(item));
+                getAux().add(i);
+            }
+        }
+    }
+
+    @Override
+    protected ITEM getValue(ITEM item) {
+        return item;
+    }
+
+    @Override
+    protected <DT extends ITEM> Wrap<? extends DT> wrap(Class<DT> type, ITEM item, Integer aux) {
+        return new ListItemWrap<DT>((DT)item, aux, listViewOp, getEditor());
+    }
+
+    public List<Wrap<? extends ITEM>> select(final int... index) {
+        LookupCriteria<ITEM>[] criteria = new LookupCriteria[index.length];
+        for (int i = 0; i < index.length; i++) {
+            criteria[i] = new ByIndex<ITEM>(index[i]);
+        }
+        return super.select(criteria);
+    }
+    
+
+    public static class ByIndex<ITEM> implements AuxLookupCriteria<ITEM, Integer> {
+        int index;
+
+        public ByIndex(int index) {
+            this.index = index;
+        }
+
+        public boolean checkAux(Integer aux) {
+            return aux.equals(index);
+        }
+
+        public boolean check(ITEM control) {
+            return true;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ListItemWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,286 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+
+package org.jemmy.fx.control;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import javafx.geometry.Bounds;
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import javafx.scene.control.ListCell;
+import javafx.scene.control.ListView;
+import javafx.scene.control.ScrollBar;
+import org.jemmy.Rectangle;
+import org.jemmy.action.GetAction;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.Wrap;
+import org.jemmy.dock.DockInfo;
+import org.jemmy.dock.ObjectLookup;
+import org.jemmy.fx.NodeWrap;
+import org.jemmy.fx.WindowElement;
+import org.jemmy.interfaces.Caret.Direction;
+import org.jemmy.interfaces.EditableCellOwner.EditableCell;
+import org.jemmy.interfaces.EditableCellOwner.CellEditor;
+import org.jemmy.interfaces.*;
+import org.jemmy.lookup.LookupCriteria;
+
+
+/**
+ * Wrapper for item classes held in ListCell children of ListView. It implements Showable to be able
+ * moving hidden Cells to visible area via Show.show(). That can be needed eg. for clicking the cell with mouse.
+ *
+ * The class is ported from ListCellOperator in the project JemmyFX.
+ * @param <ITEM>
+ * @author KAM, shura
+ */
+
+@ControlType(Object.class)
+@ControlInterfaces({EditableCell.class, Showable.class})
+@DockInfo(name="org.jemmy.fx.control.ListItemDock")
+public class ListItemWrap<ITEM extends Object> extends ItemWrap<ITEM> implements Showable {
+
+    private ListViewWrap<? extends ListView> listViewWrap;
+    private int index = -1;
+    
+    /**
+     *
+     * @param env
+     * @param item
+     * @param listViewWrap
+     */
+    public ListItemWrap(ITEM item, int index, ListViewWrap<? extends ListView> listViewWrap, CellEditor<? super ITEM> editor) {
+        super(item, listViewWrap, editor);
+        this.listViewWrap = listViewWrap;
+        this.index = index;
+    }
+
+    int getIndex() {
+        return index;
+    }
+
+    /**
+     * This method finds listCell for the selected item. Should be invoked only
+     * using FX.deferAction()
+     * That can be needed for cases like obtaining screenBounds for corresponding ListCell.
+     */
+    @Override
+    protected Wrap<? extends ListCell> cellWrap() {
+        return listViewWrap.as(Parent.class, Node.class).lookup(ListCell.class,
+          new ListItemByObjectLookup<ITEM>(getControl())).wrap(0);
+    }
+
+    @Override
+    public Rectangle getScreenBounds() {
+        return cellWrap().getScreenBounds();
+    }
+
+    @Override
+    public Show shower() {
+        return this;
+    }
+
+    @Override
+    public void show() {
+        final List<ITEM> items = listViewWrap.getItems();
+
+        final long desiredIndex = new GetAction<Long>() {
+
+            @Override
+            public void run(Object... parameters) {
+                int len=items.size();
+                
+                for (int i=0; i<len; i++) {
+                    if (getControl().equals(items.get(i))) {
+                        setResult((long)i);
+                        return;
+                    }
+                }
+            }
+            
+        }.dispatch(getEnvironment());
+
+        Wrap<? extends ScrollBar> scr =listViewWrap.as(Parent.class, Node.class).
+                lookup(ScrollBar.class, new ScrollBarWrap.ByOrientationScrollBar(true)).
+                wrap();
+        Caret c = scr.as(Scroll.class).caret();
+
+        Direction direction = new Direction() {
+
+            /**
+             * @return < 0 to scroll toward decreasing value, > 0 - vice versa
+             * 0 to stop scrolling
+             * NOTE - see implementation KnobDragScrollerImpl.to(Direction) which is used in ScrollBarWrap
+             *        better to return constant values (-1 || 0 || +1) to get smooth dragging
+             */
+            @Override
+            public int to() {
+                final int[] minmax = new int[]{listViewWrap.as(Selectable.class, Object.class).getStates().size(), -1}; //minmax[0] - the least index of visible element. minmax[1] - the most index. 
+                final List items = listViewWrap.getItems();
+                listViewWrap.as(Parent.class, Node.class).lookup(ListCell.class,
+                        new LookupCriteria<ListCell>() {
+
+                            public boolean check(ListCell control) {
+                                if (NodeWrap.isInside(listViewWrap.getControl(), control, getEnvironment())) {
+                                    int index = items.indexOf(control.getItem());
+                                    if (index >= 0) {
+                                        if (index < minmax[0]) {
+                                            minmax[0] = index;
+                                        //} else if (index > minmax[1]) {//doesn't work, if we have 1 element in list. So rewrite:
+                                        }
+                                        if (index > minmax[1]) {
+                                            minmax[1] = index;
+                                        }
+                                    }
+                                }
+                                return true;
+                            }
+                        }).size();
+                int index = items.indexOf(getControl());
+                if (index < minmax[0]) {
+                    return -1;
+                } else if (index > minmax[1]) {
+                    return 1;
+                } else {
+                    return 0;
+                }
+            }
+
+            @Override
+            public String toString() {
+                return "'" + getControl() + "' state at index " + desiredIndex;
+            }
+        };
+        c.to(direction);
+    }
+
+    /**
+     * Identifies which elements are shown in the list currently.
+     * @return list of indices of all elements that are fully visible in the
+     * list.
+     */
+    List<Long> shown() {
+        final ListView lv = (ListView) listViewWrap.getControl();
+        final Bounds viewArea = lv.getBoundsInLocal();
+
+        List<Long> res = new GetAction<List<Long>>() {
+
+            @Override
+            @SuppressWarnings("unchecked")
+            public void run(Object... parameters) {
+                final List<Long> res = new LinkedList<Long>();
+
+                listViewWrap.as(Parent.class, Node.class).lookup(
+                                     ListCell.class, new LookupCriteria<ListCell>() {
+
+                    @Override
+                    public boolean check(ListCell control) {
+                        if (control.isVisible() && control.getOpacity() == 1.0 ) {
+                            Bounds controlBounds = lv.sceneToLocal(
+                                    control.localToScene(control.getBoundsInLocal()));
+                            if (viewArea.contains(controlBounds)) {
+                                Long index = new Long(control.getIndex());
+                                    res.add(index);
+                                    return false;
+                                }
+                            }
+                        return false;
+                    }
+                }).size();
+
+                setResult(res);
+            }
+        }.dispatch(getEnvironment());
+
+        Collections.sort(res);
+        return res;
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> boolean is(Class<INTERFACE> interfaceClass) {
+        if(WindowElement.class.equals(interfaceClass)) {
+            return true;
+        }
+        return super.is(interfaceClass);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> boolean is(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if(WindowElement.class.equals(interfaceClass) && Scene.class.equals(type)) {
+            return true;
+        }
+        return super.is(interfaceClass, type);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass) {
+        if(WindowElement.class.equals(interfaceClass)) {
+            return (INTERFACE) listViewWrap.as(interfaceClass);
+        }
+        return super.as(interfaceClass);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if(WindowElement.class.equals(interfaceClass) && Scene.class.equals(type)) {
+            return (INTERFACE) listViewWrap.as(interfaceClass, type);
+        }
+        return super.as(interfaceClass, type);
+    }
+
+    public static class ListItemByObjectLookup<ITEM> implements LookupCriteria<ListCell> {
+
+        private final ITEM item;
+
+        public ListItemByObjectLookup(ITEM item) {
+            this.item = item;
+        }
+
+        @Override
+        public boolean check(ListCell control) {
+            if (control.isVisible() && control.getOpacity() == 1.0) {
+                if ((control.getItem() != null) && control.getItem().equals(item)) {
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        @Override
+        public String toString() {
+            return "Looking for a visible listCell with the value '" + item + "'";
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ListViewWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,474 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import javafx.geometry.Orientation;
+import javafx.scene.Node;
+import javafx.scene.control.ListView;
+import javafx.scene.control.ScrollBar;
+import org.jemmy.JemmyException;
+import org.jemmy.action.GetAction;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.Property;
+import org.jemmy.control.Wrap;
+import org.jemmy.env.Environment;
+import org.jemmy.fx.NodeParent;
+import org.jemmy.fx.NodeWrap;
+import org.jemmy.input.AbstractScroll;
+import org.jemmy.interfaces.*;
+import org.jemmy.lookup.Any;
+import org.jemmy.lookup.EqualsLookup;
+import org.jemmy.lookup.Lookup;
+import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.timing.State;
+import org.jemmy.timing.Waiter;
+
+/**
+ * Wrapper for ListView control. It implements Selectable to be able to select specific item
+ * via Selectable.selector().select(STATE state).
+ * @param <CONTROL>
+ * @author Alexander Kouznetsov <mrkam@mail.ru>
+ */
+@ControlType({ListView.class})
+@ControlInterfaces(value = {org.jemmy.interfaces.List.class, Selectable.class},
+encapsulates = {Object.class, Object.class})
+public class ListViewWrap<CONTROL extends ListView> extends NodeWrap<CONTROL>
+        implements Scroll, Selectable<Object> {
+
+    private AbstractScroll scroll;
+    private AbstractScroll emptyScroll = new EmptyScroll();
+    private static Scroller emptyScroller = new EmptyScroller();
+    private Selectable<Object> objectSelectable = new ListViewSelectable<Object>(Object.class);
+
+    ;
+
+    /**
+     *
+     * @param env
+     * @param scene
+     * @param nd
+     */
+    @SuppressWarnings("unchecked")
+    public ListViewWrap(Environment env, CONTROL nd) {
+        super(env, nd);
+    }
+
+    /**
+     * Look for a certain node and create an ListViewWrap for it.
+     * @param parent
+     * @param type
+     * @param criteria
+     */
+    public static ListViewWrap<ListView> find(NodeParent parent, LookupCriteria<ListView> criteria) {
+        return new ListViewWrap<ListView>(parent.getEnvironment(),
+                parent.getParent().lookup(ListView.class, criteria).get());
+    }
+
+    public static ListViewWrap<ListView> find(NodeParent parent, final Object item, final int itemIndex) {
+        return find(parent, new LookupCriteria<ListView>() {
+
+            @Override
+            public boolean check(ListView control) {
+                return control.getItems().get(itemIndex).equals(item);
+            }
+        });
+    }
+
+    public static ListViewWrap<ListView> find(NodeParent parent) {
+        return find(parent, new Any<ListView>());
+    }
+
+    @SuppressWarnings("unchecked")
+    private void checkScroll() {
+        if (scroll == null) {
+            final boolean vertical = vertical();
+            Lookup<ScrollBar> lookup = as(Parent.class, Node.class).lookup(ScrollBar.class,
+                    new LookupCriteria<ScrollBar>() {
+
+                        @Override
+                        public boolean check(ScrollBar control) {
+                            return (control.getOrientation() == Orientation.VERTICAL) == vertical;
+                        }
+                    });
+            int count = lookup.size();
+            if (count == 0) {
+                scroll = null;
+            } else if (count == 1) {
+                scroll = lookup.wrap(0).as(AbstractScroll.class);
+            } else {
+                throw new JemmyException("There are more than 1 "
+                        + (vertical ? "vertical" : "horizontal")
+                        + " ScrollBars in this ListView");
+            }
+        }
+    }
+
+    /**
+     *
+     * @return
+     */
+    @Property(ScrollBarWrap.VERTICAL_PROP_NAME)
+    public boolean vertical() {
+        return new GetAction<Boolean>() {
+
+            @Override
+            public void run(Object... parameters) {
+                setResult(getControl().getOrientation() == Orientation.VERTICAL);
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> boolean is(Class<INTERFACE> interfaceClass) {
+        // Default Parent is Parent<Node> which is super
+        if (Selectable.class.equals(interfaceClass)) {
+            return true;
+        }
+        if (interfaceClass.isAssignableFrom(AbstractScroll.class)) {
+            return true;
+        }
+        return super.is(interfaceClass);
+    }
+
+    @Override
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> boolean is(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (Parent.class.equals(interfaceClass)
+                && !Node.class.equals(type)) {
+            return true;
+        }
+        if (Selectable.class.equals(interfaceClass)) {
+            return true;
+        }
+        return super.is(interfaceClass, type);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass) {
+        // Default Parent is Parent<Node> which is super
+        if (Selectable.class.equals(interfaceClass)) {
+            return (INTERFACE) objectSelectable;
+        }
+        if (interfaceClass.isAssignableFrom(AbstractScroll.class)) {
+            checkScroll();
+            if (scroll != null) {
+                return (INTERFACE) scroll;
+            } else {
+                return (INTERFACE) emptyScroll;
+            }
+        }
+        return super.as(interfaceClass);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (Parent.class.isAssignableFrom(interfaceClass)
+                && !Node.class.equals(type)) {
+            return (INTERFACE) new ListItemParent<TYPE>(this, type);
+        }
+        if (Selectable.class.equals(interfaceClass)) {
+            return (INTERFACE) new ListViewSelectable<TYPE>(type);
+        }
+        return super.as(interfaceClass, type);
+    }
+
+    /**
+     *
+     * @return
+     */
+    public CONTROL getListView() {
+        return getControl();
+    }
+
+    long getSelectedIndex() {
+        return new GetAction<Long>() {
+
+            @Override
+            public void run(Object... parameters) {
+                setResult(new Long(getListView().getSelectionModel().getSelectedIndex()));
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    /**
+     *
+     * @return
+     */
+    public Object getSelectedItem() {
+        return new GetAction<Object>() {
+
+            @Override
+            public void run(Object... parameters) {
+                setResult(getListView().getSelectionModel().getSelectedItem());
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    @Override
+    @Property(MAXIMUM_PROP_NAME)
+    public double maximum() {
+        checkScroll();
+        if (scroll != null) {
+            return scroll.maximum();
+        } else {
+            return 0;
+        }
+    }
+
+    @Override
+    @Property(MINIMUM_PROP_NAME)
+    public double minimum() {
+        checkScroll();
+        if (scroll != null) {
+            return scroll.minimum();
+        } else {
+            return 0;
+        }
+    }
+
+    @Override
+    @Deprecated
+    public double value() {
+        return position();
+    }
+
+    @Override
+    @Property(VALUE_PROP_NAME)
+    public double position() {
+        checkScroll();
+        if (scroll != null) {
+            return scroll.value();
+        } else {
+            return 0;
+        }
+    }
+
+    @Override
+    public Caret caret() {
+        checkScroll();
+        if (scroll != null) {
+            return scroll.caret();
+        } else {
+            return emptyScroller;
+        }
+    }
+
+    @Override
+    public void to(double position) {
+        checkScroll();
+        if (scroll != null) {
+            scroll.to(position);
+        }
+    }
+
+    @Deprecated
+    @Override
+    public Scroller scroller() {
+        checkScroll();
+        if (scroll != null) {
+            return scroll.scroller();
+        } else {
+            return emptyScroller;
+        }
+    }
+
+    @Override
+    public List<Object> getStates() {
+        return objectSelectable.getStates();
+    }
+
+    @Override
+    public Object getState() {
+        return objectSelectable.getState();
+    }
+
+    @Override
+    public Selector<Object> selector() {
+        return objectSelectable.selector();
+    }
+
+    @Override
+    public Class<Object> getType() {
+        return Object.class;
+    }
+
+    @Property("items")
+    public List getItems() {
+        return new GetAction<List<?>>() {
+
+            @Override
+            public void run(Object... parameters) throws Exception {
+                setResult(getControl().getItems());
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    /**
+     * That class holds code which implements interfaces MultiSelectable<ITEM> and selector
+     * for enclosing ListViewWrap
+     */
+    private class ListViewSelectable<ITEM extends Object> implements Selectable<ITEM>, Selector<ITEM> {
+
+        Class<ITEM> itemType;
+
+        public ListViewSelectable(Class<ITEM> itemType) {
+            this.itemType = itemType;
+        }
+
+        ArrayList<ITEM> createResult(Iterator<? extends Object> it) {
+            ArrayList<ITEM> res = new ArrayList<ITEM>();
+            while (it.hasNext()) {
+                Object obj = it.next();
+                if (itemType.isAssignableFrom(obj.getClass())) {
+                    res.add(itemType.cast(obj));
+                }
+            }
+            return res;
+        }
+
+        @Override
+        public List<ITEM> getStates() {
+            return new GetAction<ArrayList<ITEM>>() {
+
+                @Override
+                public void run(Object... parameters) {
+                    setResult(createResult(getListView().getItems().iterator()));
+                }
+
+                @Override
+                public String toString() {
+                    return "Fetching all data items from " + ListViewSelectable.this;
+                }
+            }.dispatch(getEnvironment());
+        }
+
+        @Override
+        @Property(Selectable.STATE_PROP_NAME)
+        public ITEM getState() {
+            Object obj = getSelectedItem();
+            if (obj != null && itemType.isAssignableFrom(obj.getClass())) {
+                return itemType.cast(obj);
+            }
+            return null;
+        }
+
+        @Override
+        public Selector<ITEM> selector() {
+            return this;
+        }
+
+        @Override
+        public Class<ITEM> getType() {
+            return itemType;
+        }
+
+        @Override
+        @SuppressWarnings("unchecked")
+        public void select(final ITEM state) {
+
+            Wrap<ITEM> cellItem = as(Parent.class, itemType).lookup(new EqualsLookup<ITEM>(state)).wrap(0);
+            cellItem.mouse().click();
+
+            new Waiter(WAIT_STATE_TIMEOUT).waitValue(state, new State<ITEM>() {
+
+                @Override
+                public ITEM reached() {
+                    Object selected = getSelectedItem();
+                    return selected == null ? null
+                            : (itemType.isAssignableFrom(selected.getClass())
+                            ? itemType.cast(selected) : null);
+                }
+
+                @Override
+                public String toString() {
+                    return "Checking that selected item [" + getSelectedItem()
+                            + "] is " + state;
+                }
+            });
+        }
+    }
+
+    private class EmptyScroll extends AbstractScroll {
+
+        @Override
+        public double position() {
+            return ListViewWrap.this.position();
+        }
+
+        @Override
+        public Caret caret() {
+            return emptyScroller;
+        }
+
+        @Override
+        public double maximum() {
+            return ListViewWrap.this.maximum();
+        }
+
+        @Override
+        public double minimum() {
+            return ListViewWrap.this.minimum();
+        }
+
+        @Override
+        public double value() {
+            return position();
+        }
+
+        @Override
+        public Scroller scroller() {
+            return emptyScroller;
+        }
+    }
+
+    private static class EmptyScroller implements Scroller {
+
+        @Override
+        public void to(double value) {
+        }
+
+        @Override
+        public void to(Direction condition) {
+        }
+
+        @Override
+        public void scrollTo(double value) {
+        }
+
+        @Override
+        public void scrollTo(ScrollCondition condition) {
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/MenuBarWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,123 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import java.util.List;
+import javafx.scene.Node;
+import javafx.scene.control.Menu;
+import javafx.scene.control.MenuBar;
+import javafx.scene.control.MenuItem;
+import org.jemmy.action.GetAction;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.env.Environment;
+import org.jemmy.fx.NodeWrap;
+import org.jemmy.interfaces.Focus;
+import org.jemmy.interfaces.Keyboard.KeyboardButtons;
+import org.jemmy.interfaces.MenuOwner;
+import org.jemmy.interfaces.Parent;
+import org.jemmy.interfaces.TypeControlInterface;
+import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.timing.State;
+
+@ControlType({MenuBar.class})
+@ControlInterfaces(value = {Parent.class, MenuOwner.class},
+encapsulates = {MenuItem.class, MenuItem.class},name={"asMenuParent"})
+
+public class MenuBarWrap<CONTROL extends MenuBar> extends NodeWrap<CONTROL> {
+
+    private StringMenuOwnerImpl menuOwner = new StringMenuOwnerImpl(this, this.as(Parent.class, Menu.class));
+    
+    private Focus focus = new Focus() {
+        public void focus() {
+            if (!isFocused()) {
+                // pressKey()/releaseKey() are used to prevent an attempt to get focus in pushKey()
+                keyboard().pressKey(KeyboardButtons.F10);
+                getEnvironment().getTimeout(keyboard().PUSH.getName());
+                keyboard().releaseKey(KeyboardButtons.F10);
+            }
+            waitState(focusedState, true);
+        }
+    };
+
+    private State<Boolean> focusedState = new State<Boolean>() {
+        public Boolean reached() {
+            return isFocused();
+        }
+    };
+
+    /**
+     *
+     * @param env
+     * @param scene
+     * @param nd
+     */
+    @SuppressWarnings("unchecked")
+    public MenuBarWrap(Environment env, CONTROL nd) {
+        super(env, nd);
+    }
+
+    @Override
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> boolean is(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (MenuItem.class.isAssignableFrom(type)) {
+            if (Parent.class.isAssignableFrom(interfaceClass)) {
+                return true;
+            }
+            if (MenuOwner.class.isAssignableFrom(interfaceClass)) {
+                return true;
+            }
+        }
+        return super.is(interfaceClass, type);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (MenuItem.class.isAssignableFrom(type)) {
+            if (Parent.class.equals(interfaceClass)) {
+                return (INTERFACE) new AbstractMenuItemsParent(this, type) {
+                    @Override
+                    protected List getControls() {
+                        return getControl().getMenus();
+                    }
+                };
+            }
+            if (MenuOwner.class.isAssignableFrom(interfaceClass)) {
+                return (INTERFACE) menuOwner;
+            }
+        }
+        return super.as(interfaceClass, type);
+    }
+
+    @Override
+    public Focus focuser() {
+        return focus;
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/MenuButtonWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,100 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import java.util.List;
+import javafx.scene.Scene;
+import javafx.scene.control.Menu;
+import javafx.scene.control.MenuButton;
+import javafx.scene.control.MenuItem;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.env.Environment;
+import org.jemmy.input.StringMenuOwner;
+import org.jemmy.interfaces.MenuOwner;
+import org.jemmy.interfaces.Parent;
+import org.jemmy.interfaces.Tree;
+import org.jemmy.interfaces.TypeControlInterface;
+
+@ControlType({MenuButton.class})
+//@ControlInterfaces(value = {Parent.class, StringMenuOwner.class},
+//encapsulates = {Menu.class, Menu.class, MenuItem.class})
+
+public class MenuButtonWrap<CONTROL extends MenuButton> extends TextControlWrap<CONTROL> {
+
+    private StringMenuOwnerImpl menuOwner = new StringMenuOwnerImpl(this, this.as(Parent.class, Menu.class));
+
+    /**
+     *
+     * @param env
+     * @param scene
+     * @param nd
+     */
+    @SuppressWarnings("unchecked")
+    public MenuButtonWrap(Environment env, CONTROL nd) {
+        super(env, nd);
+    }
+
+    @Override
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> boolean is(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (MenuItem.class.isAssignableFrom(type)) {
+            if (Parent.class.equals(interfaceClass)) {
+                return true;
+            }
+            if (MenuOwner.class.isAssignableFrom(interfaceClass)) {
+                return true;
+            }
+            if (Tree.class.isAssignableFrom(interfaceClass)) {
+                return true;
+            }
+        }
+        return super.is(interfaceClass, type);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>>
+           INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (MenuItem.class.isAssignableFrom(type)) {
+            if (Parent.class.equals(interfaceClass)) {
+                return (INTERFACE) new AbstractMenuItemsParent(this, type) {
+                    @Override
+                    protected List getControls() {
+                        return getControl().getItems();
+                    }
+                };
+            }
+            if (MenuOwner.class.isAssignableFrom(interfaceClass)) {
+                return (INTERFACE) menuOwner;
+            }
+        }
+        return super.as(interfaceClass, type);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/MenuItemWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,148 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+
+package org.jemmy.fx.control;
+
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import javafx.scene.control.ContextMenu;
+import org.jemmy.Rectangle;
+import javafx.scene.control.Menu;
+import javafx.scene.control.MenuBar;
+import javafx.scene.control.MenuButton;
+import javafx.scene.control.MenuItem;
+import javafx.scene.control.SplitMenuButton;
+import org.jemmy.action.GetAction;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.Wrap;
+import org.jemmy.fx.ByStyleClass;
+import org.jemmy.fx.Root;
+import org.jemmy.fx.SceneWrap;
+import org.jemmy.interfaces.Parent;
+import org.jemmy.lookup.LookupCriteria;
+
+@ControlType({MenuItem.class})
+@ControlInterfaces(value = {Parent.class},
+        encapsulates = {MenuItem.class}, name={"asMenuParent"})
+
+public class MenuItemWrap<ITEM extends MenuItem> extends Wrap<ITEM> {
+
+    protected Wrap menuWrap;
+
+    /**
+     *
+     * @param env
+     * @param item
+     * @param parentMenuWrap
+     */
+    public MenuItemWrap(ITEM item, Wrap parentMenuWrap) {
+        super(parentMenuWrap.getEnvironment(), item);
+        this.menuWrap = parentMenuWrap;
+    }
+
+    @Override
+    public Rectangle getScreenBounds() {
+        return getPlaceholder().getScreenBounds();
+    }
+
+    private Wrap<Node> getPlaceholder() {
+        if (MenuBar.class.isAssignableFrom(menuWrap.getControl().getClass())) {
+            return ((Parent)menuWrap.as(Parent.class, Node.class)).lookup(Node.class, new LookupCriteria<Node>() {
+                public boolean check(Node node) {
+                    if (node.getProperties().get(MenuItem.class) == getControl()) {
+                        return true;
+                    }
+                    if (MenuButton.class.isAssignableFrom(node.getClass()) && ((MenuButton) node).getItems().containsAll(((Menu)getControl()).getItems())) {
+                        return true;
+                    }
+                    return false;
+                }
+            }).wrap();
+            } else {
+            if (MenuButton.class.isAssignableFrom(menuWrap.getControl().getClass())) {
+                if (new GetAction<Boolean>() {
+                    @Override
+                    public void run(Object... parameters) {
+                        setResult(!((MenuButton)menuWrap.getControl()).isShowing());
+                    }
+                }.dispatch(getEnvironment())) {
+                if (SplitMenuButton.class.isAssignableFrom(menuWrap.getControl().getClass())) {
+                    Parent parent = (Parent) menuWrap.as(Parent.class, Node.class);
+                    parent.lookup(Node.class, new ByStyleClass<Node>("arrow-button")).wrap().mouse().click();
+                } else {
+                    menuWrap.mouse().click();
+                }
+            }
+        }
+
+        Wrap<? extends Scene> popup_scene_wrap = Root.ROOT.lookup(new LookupCriteria<Scene>() {
+            public boolean check(Scene scene) {
+                if (!(scene.getWindow() instanceof ContextMenu)) {
+                    return false;
+                }
+                Wrap<Scene> scene_wrap = new SceneWrap(getEnvironment(), scene);
+                Parent<Node> parent = scene_wrap.as(Parent.class, Node.class);
+                return parent.lookup(Node.class, new LookupCriteria<Node>() {
+                    public boolean check(Node node) {
+                        if (node.getProperties().get(Menu.class) == getControl().getParentMenu()) {
+                            return true;
+                        }
+                        return false;
+                    }
+                }).size() > 0;
+            }
+        }).wrap();
+
+        return popup_scene_wrap.as(Parent.class, Node.class).lookup(Node.class, new LookupCriteria<Node>() {
+                public boolean check(Node node) {
+                    if (node.getProperties().get(MenuItem.class) == getControl()) {
+                        return true;
+                    }
+                    return false;
+                }
+            }).wrap();
+    }
+                }
+
+    public static class MenuByText implements LookupCriteria<MenuItem> {
+
+        String str = null;
+
+        public MenuByText(String str) {
+            this.str = str;
+        }
+
+        @Override
+        public boolean check(MenuItem item) {
+            return item.getText() != null && item.getText().contentEquals(str);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/MenuTreeSelectorImpl.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,83 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+
+package org.jemmy.fx.control;
+
+import javafx.scene.control.Menu;
+import javafx.scene.control.MenuItem;
+import org.jemmy.control.Wrap;
+import org.jemmy.interfaces.Parent;
+import org.jemmy.interfaces.TreeSelector;
+import org.jemmy.lookup.LookupCriteria;
+
+class MenuTreeSelectorImpl implements TreeSelector {
+    protected Parent<Menu> parent;
+
+    public MenuTreeSelectorImpl(Parent<Menu> parent) {
+        this.parent = parent;
+    }
+
+    public Wrap select(LookupCriteria... criteria) {
+        if (criteria.length == 0) {
+            throw new IllegalStateException("The criteria list is supposed to be not empty");
+        }
+        Wrap<? extends MenuItem> res = parent.lookup(criteria[0]).wrap();
+        if (criteria.length > 1) {
+            res = showMenu(res, decreaseCriteria(criteria));
+        }
+        res.mouse().move();
+        return res;
+    }
+
+    static Wrap<? extends MenuItem> showMenu(Wrap<? extends MenuItem> parent, LookupCriteria<MenuItem>... criteria) {
+        if (criteria.length == 0) {
+            throw new IllegalStateException("Length is supposed to be greater than 0 at this moment");
+        }
+        parent.mouse().click();
+        Parent<MenuItem> container = parent.as(Parent.class, MenuItem.class);
+        Wrap<? extends MenuItem> next = container.lookup(criteria[0]).wrap();
+        if (criteria.length == 1) {
+            return next;
+        } else {
+            if (!(next.getControl() instanceof Menu)) {
+                throw new IllegalStateException("Should be menu: " + next.getControl().toString());
+            }
+            return showMenu((Wrap<? extends Menu>) next, decreaseCriteria(criteria));
+        }
+    }
+
+    static <T> LookupCriteria<T>[] decreaseCriteria(LookupCriteria<T>[] longer) {
+        LookupCriteria[] res = new LookupCriteria[longer.length - 1];
+        for (int i = 1; i < longer.length; i++) {
+            res[i - 1] = longer[i];
+        }
+        return res;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/MenuWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,101 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import java.util.List;
+import javafx.scene.control.Menu;
+import javafx.scene.control.MenuItem;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.Wrap;
+import org.jemmy.input.StringMenuOwner;
+import org.jemmy.interfaces.ControlInterface;
+import org.jemmy.interfaces.MenuOwner;
+import org.jemmy.interfaces.Parent;
+import org.jemmy.interfaces.TypeControlInterface;
+
+@ControlType({Menu.class})
+@ControlInterfaces(value = {Parent.class, StringMenuOwner.class},
+        encapsulates = {MenuItem.class, MenuItem.class}, name={"asMenuParent"})
+
+public class MenuWrap<ITEM extends Menu> extends MenuItemWrap<ITEM> {
+
+    private StringMenuOwnerImpl menuOwner = new StringMenuOwnerImpl(this, this.as(Parent.class, Menu.class));
+
+    /**
+     *
+     * @param env
+     * @param scene
+     * @param nd
+     */
+    @SuppressWarnings("unchecked")
+    public MenuWrap(ITEM item, Wrap parentMenuWrap) {
+        super(item, parentMenuWrap);
+    }
+
+    @Override
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> boolean is(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (MenuItem.class.isAssignableFrom(type)) {
+            if (Parent.class.equals(interfaceClass)) {
+                return true;
+            }
+            if (MenuOwner.class.isAssignableFrom(interfaceClass)) {
+                return true;
+            }
+        }
+        return super.is(interfaceClass, type);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass) {
+        // Default Parent is Parent<Node> which is super
+        return super.as(interfaceClass);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (MenuItem.class.isAssignableFrom(type)) {
+            if (Parent.class.equals(interfaceClass)) {
+                return (INTERFACE) new AbstractMenuItemsParent(this, type) {
+                    @Override
+                    protected List getControls() {
+                        return getControl().getItems();
+                    }
+                };
+            }
+            if (MenuOwner.class.isAssignableFrom(interfaceClass)) {
+                return (INTERFACE) menuOwner;
+            }
+        }
+        return super.as(interfaceClass, type);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ScrollBarWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,244 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+
+import javafx.geometry.Orientation;
+import javafx.scene.Scene;
+import javafx.scene.control.ScrollBar;
+import org.jemmy.action.GetAction;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.MethodProperties;
+import org.jemmy.control.Property;
+import org.jemmy.env.Environment;
+import org.jemmy.fx.NodeParent;
+import org.jemmy.fx.Root;
+import org.jemmy.input.AbstractScroll;
+import org.jemmy.interfaces.Caret;
+import org.jemmy.interfaces.ControlInterface;
+import org.jemmy.interfaces.Scroll;
+import org.jemmy.interfaces.Scroller;
+import org.jemmy.interfaces.Shiftable;
+import org.jemmy.interfaces.Shifter;
+import org.jemmy.lookup.LookupCriteria;
+
+
+/**
+ * The wrapper is ported from the project JemmyFX, original class
+ * is   org.jemmy.fx.control.ScrollBarWrap
+ *
+ * @param <T>
+ * @author Shura
+ */
+@ControlType({ScrollBar.class})
+@ControlInterfaces({Scroll.class})
+@MethodProperties({"getOrientation"})
+public class ScrollBarWrap<T extends ScrollBar> extends ControlWrap<T> implements Scroll, Shiftable {
+
+    AbstractScroll theScroll;
+
+    /**
+     *
+     * @param scene
+     * @param nd
+     */
+    public ScrollBarWrap(Environment env, T node) {
+        super(env, node);
+        theScroll = new AbstractScroll() {
+
+            @Override
+            public double position() {
+                return new GetAction<Double>() {
+
+                    @Override
+                    public void run(Object... parameters) {
+                        setResult((double) getControl().getValue());
+                    }
+
+                    @Override
+                    public String toString() {
+                        return "Getting position of " + getControl();
+                    }
+                }.dispatch(getEnvironment());
+            }
+
+            @Override
+            public Caret caret() {
+                return scroller();
+            }
+
+            @Override
+            public double maximum() {
+                return new GetAction<Double>() {
+
+                    @Override
+                    public void run(Object... parameters) {
+                        setResult((double) getControl().getMax());
+                    }
+
+                    @Override
+                    public String toString() {
+                        return "Getting  maximum of " + getControl();
+                    }
+                }.dispatch(getEnvironment());
+            }
+
+            @Override
+            public double minimum() {
+                return new GetAction<Double>() {
+
+                    @Override
+                    public void run(Object... parameters) {
+                        setResult((double) getControl().getMin());
+                    }
+
+                    @Override
+                    public String toString() {
+                        return "Getting  minimum of " + getControl();
+                    }
+                }.dispatch(getEnvironment());
+            }
+
+            @Override
+            public double value() {
+                return position();
+            }
+
+            @Override
+            public Scroller scroller() {
+                return Root.ROOT.getThemeFactory().caret(ScrollBarWrap.this, this);
+            }
+        };
+    }
+
+    public static ScrollBarWrap<ScrollBar> find(NodeParent parent, LookupCriteria<ScrollBar> criteria) {
+        return new ScrollBarWrap<ScrollBar>(parent.getEnvironment(), parent.getParent().lookup(ScrollBar.class, criteria).get());
+    }
+
+    public static ScrollBarWrap<ScrollBar> find(NodeParent parent, final boolean vertical) {
+        return find(parent, new ByOrientationScrollBar(vertical));
+    }
+
+    /**
+     * @return
+     */
+    @Property(VERTICAL_PROP_NAME)
+    public boolean vertical() {
+        return new GetAction<Boolean>() {
+
+            @Override
+            public void run(Object... parameters) {
+                setResult(getControl().getOrientation() == Orientation.VERTICAL);
+            }
+
+            @Override
+            public String toString() {
+                return "Checking if vertical of " + getControl();
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    @Override
+    @Property(MAXIMUM_PROP_NAME)
+    public double maximum() {
+        return theScroll.maximum();
+    }
+
+    @Override
+    @Property(MINIMUM_PROP_NAME)
+    public double minimum() {
+        return theScroll.minimum();
+    }
+
+    @Override
+    @Property(VALUE_PROP_NAME)
+    public double position() {
+        return theScroll.position();
+    }
+
+    @Deprecated
+    @Override
+    public double value() {
+        return position();
+    }
+
+    @Override
+    @Deprecated
+    public Scroller scroller() {
+        return theScroll.scroller();
+    }
+
+    @Override
+    public Caret caret() {
+        return scroller();
+    }
+
+    public Shifter shifter() {
+        return Root.ROOT.getThemeFactory().track(this, theScroll);
+    }
+
+    @Override
+    public void to(double position) {
+        theScroll.to(position);
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> boolean is(Class<INTERFACE> interfaceClass) {
+        if(interfaceClass.isAssignableFrom(AbstractScroll.class)) {
+            return true;
+        }
+        return super.is(interfaceClass);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass) {
+        if(interfaceClass.isAssignableFrom(AbstractScroll.class)) {
+            return (INTERFACE) theScroll;
+        }
+        return super.as(interfaceClass);
+    }
+
+    public static class ByOrientationScrollBar implements LookupCriteria<ScrollBar> {
+
+        private final boolean vertical;
+
+        public ByOrientationScrollBar(boolean vertical) {
+            this.vertical = vertical;
+        }
+
+        @Override
+        public boolean check(ScrollBar control) {
+            return (control.getOrientation() == Orientation.VERTICAL) == vertical;
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/SelectableItemsParent.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,49 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+
+import java.util.List;
+import org.jemmy.control.Wrap;
+import org.jemmy.control.Wrapper;
+import org.jemmy.interfaces.Selectable;
+
+
+public class SelectableItemsParent<ITEM extends Object> extends AbstractItemsParent<ITEM> {
+
+    public SelectableItemsParent(Wrap wrap, Wrapper wrapper, Class<ITEM> itemClass) {
+        super(wrap, wrapper, itemClass);
+    }
+
+    @Override
+    protected List<ITEM> getControls() {
+        return ((Selectable)wrap.as(Selectable.class, itemClass)).getStates();
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/SeparatorWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,46 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the Common Development
+ * and Distribution License (the "License"). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header Notice in each
+ * file.
+ *
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library. The Initial Developer of the
+ * Original Software is Alexandre Iline. All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.control.Separator;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.MethodProperties;
+import org.jemmy.env.Environment;
+
+/**
+ *
+ * @param <T>
+ * @author Shura
+ */
+@ControlType({Separator.class})
+@MethodProperties({"getOrientation"})
+public class SeparatorWrap<T extends Separator> extends ControlWrap<T> {
+
+    public SeparatorWrap(Environment env, T node) {
+        super(env, node);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/SliderWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,206 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. DO NOT
+ * ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+package org.jemmy.fx.control;
+
+import javafx.geometry.Orientation;
+import javafx.scene.control.Slider;
+import org.jemmy.action.GetAction;
+import org.jemmy.fx.NodeParent;
+import org.jemmy.fx.Root;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.MethodProperties;
+import org.jemmy.control.Property;
+import org.jemmy.env.Environment;
+import org.jemmy.input.AbstractScroll;
+import org.jemmy.interfaces.Caret;
+import org.jemmy.interfaces.ControlInterface;
+import org.jemmy.interfaces.Scroll;
+import org.jemmy.interfaces.Scroller;
+import org.jemmy.interfaces.Shiftable;
+import org.jemmy.interfaces.Shifter;
+import org.jemmy.lookup.LookupCriteria;
+
+/**
+ * The wrapper is ported from the project JemmyFX, original class is
+ * org.jemmy.fx.control.SliderOperator
+ *
+ * @param <T> - wrapped class based on the Slider
+ * @author shura
+ */
+@ControlType(Slider.class)
+@ControlInterfaces({Scroll.class})
+@MethodProperties({"getOrientation"})
+public class SliderWrap<T extends Slider> extends ControlWrap<T> implements Scroll, Shiftable {
+
+    private AbstractScroll theScroll;
+
+    /**
+     *
+     * @param scene
+     * @param nd
+     */
+    public SliderWrap(Environment env, T node) {
+        super(env, node);
+        theScroll = new AbstractScroll() {
+
+            @Override
+            public double position() {
+                return new GetAction<Double>() {
+
+                    @Override
+                    public void run(Object... parameters) {
+                        setResult((double) getControl().getValue());
+                    }
+
+                    @Override
+                    public String toString() {
+                        return "Getting position of " + getControl();
+                    }
+                }.dispatch(getEnvironment());
+            }
+
+            @Override
+            public double maximum() {
+                return new GetAction<Double>() {
+
+                    @Override
+                    public void run(Object... parameters) {
+                        setResult((double) getControl().getMax());
+                    }
+
+                    @Override
+                    public String toString() {
+                        return "Getting  maximum of " + getControl();
+                    }
+                }.dispatch(getEnvironment());
+            }
+
+            @Override
+            public double minimum() {
+                return new GetAction<Double>() {
+
+                    @Override
+                    public void run(Object... parameters) {
+                        setResult((double) getControl().getMin());
+                    }
+
+                    @Override
+                    public String toString() {
+                        return "Getting minimum of " + getControl();
+                    }
+                }.dispatch(getEnvironment());
+            }
+
+            @Override
+            public double value() {
+                return SliderWrap.this.value();
+            }
+
+            @Override
+            public Caret caret() {
+                return scroller();
+            }
+
+            @Override
+            public Scroller scroller() {
+                return Root.ROOT.getThemeFactory().caret(SliderWrap.this, this);
+            }
+        };
+    }
+
+    public static SliderWrap<Slider> find(NodeParent parent, LookupCriteria<Slider> criteria) {
+        return new SliderWrap<Slider>(parent.getEnvironment(), parent.getParent().lookup(Slider.class, criteria).get());
+    }
+
+    public static SliderWrap<Slider> find(NodeParent parent, final boolean vertical) {
+        return find(parent, new LookupCriteria<Slider>() {
+
+            @Override
+            public boolean check(Slider control) {
+                return (control.getOrientation() == Orientation.VERTICAL) == vertical;
+            }
+        });
+    }
+
+    /**
+     * @return
+     */
+    @Property(VERTICAL_PROP_NAME)
+    public boolean vertical() {
+        return new GetAction<Boolean>() {
+
+            @Override
+            public void run(Object... parameters) {
+                setResult(getControl().getOrientation() == Orientation.VERTICAL);
+            }
+
+            @Override
+            public String toString() {
+                return "Checking if vertical of " + getControl();
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    @Override
+    @Property(MAXIMUM_PROP_NAME)
+    public double maximum() {
+        return theScroll.maximum();
+    }
+
+    @Override
+    @Property(MINIMUM_PROP_NAME)
+    public double minimum() {
+        return theScroll.minimum();
+    }
+
+    @Property(VALUE_PROP_NAME)
+    @Override
+    public double position() {
+        return theScroll.position();
+    }
+
+    @Override
+    public void to(double position) {
+        theScroll.to(position);
+    }
+
+    @Deprecated
+    @Override
+    public double value() {
+        return position();
+    }
+
+    @Override
+    public Caret caret() {
+        return theScroll.caret();
+    }
+
+    @Override
+    public Scroller scroller() {
+        return theScroll.scroller();
+    }
+
+    public Shifter shifter() {
+        return Root.ROOT.getThemeFactory().track(this, theScroll);
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> boolean is(Class<INTERFACE> interfaceClass) {
+        if (interfaceClass.isAssignableFrom(AbstractScroll.class)) {
+            return true;
+        }
+        return super.is(interfaceClass);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass) {
+        if (interfaceClass.isAssignableFrom(AbstractScroll.class)) {
+            return (INTERFACE) theScroll;
+        }
+        return super.as(interfaceClass);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/SplitPaneWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,53 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import javafx.geometry.Orientation;
+import javafx.scene.control.SplitPane;
+import org.jemmy.action.GetAction;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.MethodProperties;
+import org.jemmy.control.Property;
+import org.jemmy.env.Environment;
+
+/**
+ *
+ * @param <T>
+ * @author Shura
+ */
+@ControlType({SplitPane.class})
+@MethodProperties({"getOrientation"})
+public class SplitPaneWrap<T extends SplitPane> extends ControlWrap<T> {
+
+    public SplitPaneWrap(Environment env, T node) {
+        super(env, node);
+    }
+  
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/StringMenuOwnerImpl.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,49 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.control.Menu;
+import javafx.scene.control.MenuItem;
+import org.jemmy.control.Wrap;
+import org.jemmy.input.StringMenuOwner;
+import org.jemmy.interfaces.Parent;
+import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.resources.StringComparePolicy;
+
+/**
+ *
+ * @author shura
+ */
+class StringMenuOwnerImpl extends StringMenuOwner<MenuItem> {
+
+    Parent<Menu> parent;
+    public StringMenuOwnerImpl(Wrap<?> wrap, Parent<Menu> parent) {
+        super(wrap);
+        this.parent = parent;
+    }
+
+    @Override
+    protected LookupCriteria<MenuItem> createCriteria(String string, StringComparePolicy compare_policy) {
+        return new ByTextMenuItem(string, compare_policy);
+    }
+
+    public Class<MenuItem> getType() {
+        return MenuItem.class;
+    }
+
+    public org.jemmy.interfaces.Menu menu() {
+        return new MenuImpl(parent);
+    }
+
+    class MenuImpl extends MenuTreeSelectorImpl implements org.jemmy.interfaces.Menu {
+        public MenuImpl(Parent<Menu> parent) {
+            super(parent);
+        }
+
+        public void push(LookupCriteria... criteria) {
+            select(criteria).mouse().click();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TabPaneWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,228 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import java.util.ArrayList;
+import java.util.List;
+import javafx.collections.ObservableList;
+import javafx.scene.Scene;
+import javafx.scene.control.Tab;
+import javafx.scene.control.TabPane;
+import org.jemmy.JemmyException;
+import org.jemmy.Point;
+import org.jemmy.action.GetAction;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.Property;
+import org.jemmy.fx.NodeWrap;
+import org.jemmy.control.MethodProperties;
+import org.jemmy.env.Environment;
+import org.jemmy.fx.FXClickFocus;
+import org.jemmy.input.AbstractScroll;
+import org.jemmy.interfaces.ControlInterface;
+import org.jemmy.interfaces.Focus;
+import org.jemmy.interfaces.Keyboard.KeyboardButtons;
+import org.jemmy.interfaces.Parent;
+import org.jemmy.interfaces.Selectable;
+import org.jemmy.interfaces.Selector;
+import org.jemmy.interfaces.TypeControlInterface;
+import org.jemmy.timing.State;
+
+@ControlType({TabPane.class})
+@ControlInterfaces( value = {Selectable.class,Parent.class}, 
+                    encapsulates = {Tab.class,Tab.class}, 
+                    name= {"asSelectable", "asTabParent"})
+public class TabPaneWrap<CONTROL extends TabPane> extends NodeWrap<CONTROL> {
+
+    public static final String SELECTED_INDEX_PROP = "selectedIndex";
+    public static final String SELECTED_ITEM_PROP = "selectedItem";
+    public static final String ITEMS_PROP = "tabs";
+    private Selectable<Tab> objectSelectable = new TabPaneSelectable();
+
+    /**
+     *
+     * @param env
+     * @param scene
+     * @param nd
+     */
+    @SuppressWarnings("unchecked")
+    public TabPaneWrap(Environment env, CONTROL nd) {
+        super(env, nd);
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> boolean is(Class<INTERFACE> interfaceClass) {
+        // Default Parent is Parent<Node> which is super
+        if (Selectable.class.equals(interfaceClass)) {
+            return true;
+        }
+        if (interfaceClass.isAssignableFrom(AbstractScroll.class)) {
+            return true;
+        }
+        return super.is(interfaceClass);
+    }
+
+    @Override
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> boolean is(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (Parent.class.equals(interfaceClass)
+                && Tab.class.isAssignableFrom(type)) {
+            return true;
+        }
+        if (Selectable.class.equals(interfaceClass)) {
+            return true;
+        }
+        return super.is(interfaceClass, type);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass) {
+        if (Selectable.class.equals(interfaceClass)) {
+            return (INTERFACE) objectSelectable;
+        }
+        return super.as(interfaceClass);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (Parent.class.equals(interfaceClass)
+                && Tab.class.isAssignableFrom(type)) {
+            return (INTERFACE) new TabParent(this, type);
+        }
+        if (Selectable.class.equals(interfaceClass)) {
+            return (INTERFACE) new TabPaneSelectable();
+        }
+        return super.as(interfaceClass, type);
+    }
+
+    @Override
+    public Focus focuser() {        
+        return new Focus() {
+/*TODO We can't simulate user input in order to switch tabs because there is no way to get real node corresponding to Tab.
+ * http://javafx-jira.kenai.com/browse/RT-18230
+ * So focus is requested and tabs are switched by keyboard*/
+            public void focus() {
+                new GetAction<Void>(){
+
+                    @Override
+                    public void run(Object... parameters) throws Exception {
+                        getControl().requestFocus();
+                    }
+                }.dispatch(getEnvironment());
+            }
+        };        
+    }
+
+    private class TabPaneSelectable implements Selectable<Tab>, Selector<Tab> {
+
+        @Override
+        public List<Tab> getStates() {
+            return new GetAction<ArrayList<Tab>>() {
+
+                @Override
+                public void run(Object... parameters) {
+                    setResult(new ArrayList<Tab>(getItems()));
+                }
+
+                @Override
+                public String toString() {
+                    return "Fetching all data items from " + TabPaneSelectable.this;
+                }
+            }.dispatch(getEnvironment());
+        }
+
+        @Override
+        @Property(Selectable.STATE_PROP_NAME)
+        public Tab getState() {
+            return getSelectedItem();
+        }
+
+        public Selector<Tab> selector() {
+            return this;
+        }
+
+        public Class getType() {
+            return Tab.class;
+        }
+
+        public void select(final Tab state) {
+
+            int targetIndex = getItems().indexOf(state);
+            if (targetIndex < 0) {
+                throw new JemmyException("This TabPane does not contain the requested tab", getControl());
+            }
+            int selectedIndex;
+            while ((selectedIndex = getSelectedIndex()) != targetIndex) {
+                keyboard().pushKey((selectedIndex < targetIndex) ? KeyboardButtons.RIGHT
+                        : KeyboardButtons.LEFT);
+            }
+            waitState(new State<Tab>() {
+
+                public Tab reached() {
+                    return getSelectedItem();
+                }
+            }, state);
+        }
+    }
+
+    @Property(SELECTED_INDEX_PROP)
+    public int getSelectedIndex() {
+        return new GetAction<Integer>() {
+
+            @Override
+            public void run(Object... os) throws Exception {
+                setResult(getControl().getSelectionModel().getSelectedIndex());
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    @Property(SELECTED_ITEM_PROP)
+    public Tab getSelectedItem() {
+        return new GetAction<Tab>() {
+
+            @Override
+            public void run(Object... os) throws Exception {
+                setResult(getControl().getSelectionModel().getSelectedItem());
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    @Property(ITEMS_PROP)
+    public ObservableList<Tab> getItems() {
+        return new GetAction<ObservableList<Tab>>() {
+
+            @Override
+            public void run(Object... os) throws Exception {
+                setResult(getControl().getTabs());
+            }
+        }.dispatch(getEnvironment());
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TabParent.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,132 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import java.util.ArrayList;
+import java.util.List;
+import javafx.scene.Scene;
+import javafx.scene.control.Tab;
+import javafx.scene.control.TabPane;
+import org.jemmy.action.GetAction;
+import org.jemmy.control.Wrap;
+import org.jemmy.control.Wrapper;
+import org.jemmy.interfaces.CellOwner;
+import org.jemmy.interfaces.Keyboard.KeyboardModifier;
+import org.jemmy.interfaces.Keyboard.KeyboardModifiers;
+import org.jemmy.interfaces.Mouse.MouseButtons;
+import org.jemmy.interfaces.Showable;
+import org.jemmy.lookup.*;
+
+public class TabParent<ITEM extends Tab> extends AbstractParent<ITEM>
+        implements CellOwner<ITEM>, ControlList {
+
+    public static final String SELECTED_ITEM_PROP_NAME = "selectedItem";
+    protected Wrapper wrapper;
+    protected Class<ITEM> itemClass;
+    protected Scene scene;
+    TabPaneWrap<? extends TabPane> wrap;
+
+    public TabParent(TabPaneWrap<? extends TabPane> tabPaneOp, Class<ITEM> itemClass) {
+        this.wrap = tabPaneOp;
+        this.wrapper = new ItemWrapper<ITEM>(tabPaneOp);
+        this.itemClass = itemClass;
+    }
+
+    public Wrapper getWrapper() {
+        return wrapper;
+    }
+
+    @Override
+    public <ST extends ITEM> Lookup<ST> lookup(Class<ST> controlClass, LookupCriteria<ST> criteria) {
+        return new PlainLookup<ST>(wrap.getEnvironment(),
+                this, wrapper, controlClass, criteria);
+    }
+
+    @Override
+    public Lookup<ITEM> lookup(LookupCriteria<ITEM> criteria) {
+        return this.lookup(itemClass, criteria);
+    }
+
+    @Override
+    public Class<ITEM> getType() {
+        return itemClass;
+    }
+
+    public List<Wrap<? extends ITEM>> select(LookupCriteria<ITEM>... criteria) {
+        List<Wrap<? extends ITEM>> res = new ArrayList<Wrap<? extends ITEM>>();
+        KeyboardModifier[] mods = new KeyboardModifier[0];
+        for (LookupCriteria<ITEM> cr : criteria) {
+            Lookup<ITEM> lu = lookup(cr);
+            for (int j = 0; j < lu.size(); j++) {
+                Wrap<? extends ITEM> w = lu.wrap(j);
+                w.as(Showable.class).shower().show();
+                w.mouse().click(1, w.getClickPoint(), MouseButtons.BUTTON1,
+                        mods);
+                mods = new KeyboardModifier[]{KeyboardModifiers.CTRL_DOWN_MASK};
+                res.add(w);
+            }
+        }
+        return res;
+    }
+
+    protected static class ItemWrapper<ITEM extends Tab> implements Wrapper {
+
+        TabPaneWrap<? extends TabPane> tabPaneOp;
+
+        public ItemWrapper(TabPaneWrap<? extends TabPane> tabPaneOp) {
+            this.tabPaneOp = tabPaneOp;
+        }
+
+        @Override
+        public <T> Wrap<? extends T> wrap(Class<T> controlClass, T control) {
+            if (controlClass.isAssignableFrom(Tab.class)) {
+                return (Wrap<? extends T>) new TabWrap(tabPaneOp, (ITEM) control);
+            }
+            return null;
+        }
+
+    }
+
+    @Override
+    public List<ITEM> getControls() {
+        return new GetAction<List<ITEM>>() {
+
+            @Override
+            public void run(Object... parameters) throws Exception {
+                List<ITEM> res = new ArrayList<ITEM>();
+                for (Object item : wrap.getControl().getTabs()) {
+                    res.add((ITEM) item);
+                }
+                setResult(res);
+            }
+        }.dispatch(wrap.getEnvironment());
+    }
+
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TabWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,174 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the Common Development
+ * and Distribution License (the "License"). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header Notice in each
+ * file.
+ *
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library. The Initial Developer of the
+ * Original Software is Alexandre Iline. All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.Node;
+import javafx.scene.control.Tab;
+import javafx.scene.control.TabPane;
+import org.jemmy.Rectangle;
+import org.jemmy.action.GetAction;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.Property;
+import org.jemmy.control.Wrap;
+import org.jemmy.dock.ObjectLookup;
+import org.jemmy.fx.NodeParentImpl;
+import org.jemmy.interfaces.*;
+import org.jemmy.interfaces.CellOwner.Cell;
+import org.jemmy.lookup.ByStringLookup;
+import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.resources.StringComparePolicy;
+
+@ControlType({Tab.class})
+@ControlInterfaces(value = {Parent.class, Cell.class, Selectable.class},
+encapsulates = {Node.class})
+public class TabWrap<CONTROL extends Tab> extends Wrap<CONTROL>
+        implements Close, Closer, Cell<Tab> {
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (Parent.class.equals(interfaceClass)
+                && Node.class.isAssignableFrom(type)) {
+            return (INTERFACE) new NodeParentImpl((javafx.scene.Parent) getContent(), this.getEnvironment());
+        }
+        return super.as(interfaceClass, type);
+    }
+
+    @ObjectLookup("id")
+    public static <B extends Tab> LookupCriteria<B> idLookup(Class<B> tp, String id) {
+        return new ByIDTab<B>(id);
+    }
+
+    @ObjectLookup("text")
+    public static <B extends Tab> LookupCriteria<B> textLookup(Class<B> tp, String id, StringComparePolicy policy) {
+        return new ByTextTab<B>(id, policy);
+    }
+    private TabPaneWrap<? extends TabPane> pane;
+
+    /**
+     *
+     * @param env
+     * @param scene
+     * @param nd
+     */
+    @SuppressWarnings("unchecked")
+    public TabWrap(TabPaneWrap<? extends TabPane> pane, CONTROL tab) {
+        super(pane.getEnvironment(), tab);
+        this.pane = pane;
+    }
+
+    public void edit(Tab newValue) {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    public Class<Tab> getType() {
+        return Tab.class;
+    }
+
+    public void select() {
+        pane.as(Selectable.class, Tab.class).selector().select(getControl());
+//        Parent pane_as_parent = pane.as(Parent.class, Node.class);
+//        Wrap<Node> tab_pane_header = pane_as_parent.lookup(Node.class, new ByStyleClass("tab-header-area")).wrap();
+//        Parent<Node> header_as_parent = tab_pane_header.as(Parent.class, Node.class);
+//        header_as_parent.lookup(Node.class, new ByStyleClass("tab")).wrap().mouse().click(1, new Point(0, -1));
+    }
+
+    @Override
+    public Rectangle getScreenBounds() {
+        throw new UnsupportedOperationException("not supported");
+    }
+
+    public void close() {
+        select();
+        pane.as(Parent.class, Node.class).lookup(Node.class, new LookupCriteria<Node>() {
+
+            public boolean check(Node node) {
+                return node.getStyleClass().contains("tab-close-button") && node.isVisible();
+            }
+        }).wrap().mouse().click();
+    }
+
+    public Close closer() {
+        return this;
+    }
+
+    @Property("getContent")
+    public Node getContent() {
+        return new GetAction<Node>() {
+
+            @Override
+            public void run(Object... parameters) throws Exception {
+                setResult(getControl().getContent());
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    /**
+     *
+     * @author andrey
+     */
+    public static class ByTooltipTab<T extends Tab> extends ByStringLookup<T> {
+
+        public ByTooltipTab(String text) {
+            super(text, StringComparePolicy.EXACT);
+        }
+
+        @Override
+        public String getText(T tab) {
+            return tab.getTooltip().getText();
+        }
+    }
+
+    public static class ByIDTab<T extends Tab> extends ByStringLookup<T> {
+
+        public ByIDTab(String text) {
+            super(text, StringComparePolicy.EXACT);
+        }
+
+        @Override
+        public String getText(T control) {
+            return control.getId();
+        }
+    }
+
+    public static class ByTextTab<T extends Tab> extends ByStringLookup<T> {
+
+        public ByTextTab(String text, StringComparePolicy policy) {
+            super(text, policy);
+        }
+
+        public ByTextTab(String text) {
+            super(text);
+        }
+
+        @Override
+        public String getText(T control) {
+            return control.getText();
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TableCellItemParent.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,100 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the Common Development
+ * and Distribution License (the "License"). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header Notice in each
+ * file.
+ *
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library. The Initial Developer of the
+ * Original Software is Alexandre Iline. All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import java.util.List;
+import javafx.scene.control.TableColumn;
+import javafx.scene.control.TableView;
+import org.jemmy.Point;
+import org.jemmy.control.Wrap;
+import org.jemmy.lookup.LookupCriteria;
+
+/**
+ *
+ * @param <ITEM>
+ * @author Shura, KAM
+ */
+public class TableCellItemParent<ITEM> extends ItemParent<ITEM, ITEM, Point>
+        implements org.jemmy.interfaces.Table<ITEM> {
+
+    TableViewWrap<? extends TableView> tableViewOp;
+
+    public TableCellItemParent(TableViewWrap<? extends TableView> tableViewOp, Class<ITEM> itemClass) {
+        super(tableViewOp, itemClass);
+        this.tableViewOp = tableViewOp;
+    }
+
+    @Override
+    protected void doRefresh() {
+        for (int r = 0; r < tableViewOp.getItems().size(); r++) {
+            List<TableColumn> columns = (List<TableColumn>)tableViewOp.getColumns();
+            for(int c = 0; c < columns.size(); c++) {
+                ITEM item = (ITEM) columns.get(c).getCellData(tableViewOp.getRow(r));
+                getFound().add(item);
+                getAux().add(new Point(c, r));
+            }
+        }
+    }
+
+    @Override
+    protected ITEM getValue(ITEM item) {
+        return item;
+    }
+
+    @Override
+    protected <DT extends ITEM> Wrap<? extends DT> wrap(Class<DT> type, ITEM item, Point aux) {
+                return new TableCellItemWrap<DT>(tableViewOp, 
+                        tableViewOp.getRow(aux.getY()), 
+                        tableViewOp.getColumn(aux.getX()), (DT)item, getEditor());
+    }
+
+    public List<Wrap<? extends ITEM>> select(Point... point) {
+        LookupCriteria<ITEM>[] criteria = new LookupCriteria[point.length];
+        for (int i = 0; i < point.length; i++) {
+            criteria[i] = new ByPoint<ITEM>(point[i]);
+        }
+        return super.select(criteria);
+    }
+
+
+    public static class ByPoint<ITEM> implements AuxLookupCriteria<ITEM, Point> {
+        Point point;
+
+        public ByPoint(Point point) {
+            this.point = point;
+        }
+
+        public boolean checkAux(Point aux) {
+            return aux.getX() == point.getX() &&
+                    aux.getY() == point.getY();
+        }
+
+        public boolean check(ITEM control) {
+            return true;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TableCellItemWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,223 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+
+package org.jemmy.fx.control;
+
+import java.util.List;
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import javafx.scene.control.ScrollBar;
+import javafx.scene.control.TableCell;
+import javafx.scene.control.TableColumn;
+import javafx.scene.control.TableView;
+import org.jemmy.Rectangle;
+import org.jemmy.action.GetAction;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.Wrap;
+import org.jemmy.dock.DockInfo;
+import org.jemmy.fx.NodeWrap;
+import org.jemmy.fx.WindowElement;
+import org.jemmy.interfaces.Caret.Direction;
+import org.jemmy.interfaces.EditableCellOwner.EditableCell;
+import org.jemmy.interfaces.EditableCellOwner.CellEditor;
+import org.jemmy.interfaces.*;
+import org.jemmy.lookup.LookupCriteria;
+
+
+/**
+ * This represents a content of a single tree cell, as opposed to table items
+ * which is a row.
+ *
+ * @param <ITEM>
+ * @author KAM, shura
+ */
+
+@ControlType(Object.class)
+@ControlInterfaces(value={EditableCell.class, Showable.class}, name={"asCell"})
+@DockInfo(name="org.jemmy.fx.control.TableCellItemDock")
+public class TableCellItemWrap<ITEM extends Object> extends ItemWrap<ITEM> implements Showable {
+
+    private TableViewWrap<? extends TableView> tableViewWrap;
+    private Object row;
+    private TableColumn column;
+    
+    /**
+     *
+     * @param env
+     * @param cellItem
+     * @param listViewWrap
+     */
+    public TableCellItemWrap(TableViewWrap<? extends TableView> listViewWrap, 
+            Object row, TableColumn column, ITEM cellItem, CellEditor<? super ITEM> editor) {
+        super(cellItem, listViewWrap, editor);
+        this.tableViewWrap = listViewWrap;
+        this.row = row;
+        this.column = column;
+    }
+
+    /**
+     * This method finds listCell for the selected item. Should be invoked only
+     * using FX.deferAction()
+     * That can be needed for cases like obtaining screenBounds for corresponding ListCell.
+     */
+    @Override
+    protected Wrap<? extends TableCell> cellWrap() {
+        return tableViewWrap.as(Parent.class, Node.class).lookup(TableCell.class,
+          new TableListItemByObjectLookup<ITEM>(getControl())).wrap(0);
+    }
+
+    @Override
+    public Rectangle getScreenBounds() {
+        return cellWrap().getScreenBounds();
+    }
+
+    @Override
+    public Show shower() {
+        return this;
+    }
+
+    @Override
+    public void show() {
+        final List<ITEM> items = tableViewWrap.getItems();
+
+        final long desiredIndex = items.indexOf(row);
+
+//        Caret c = tableViewWrap.as(Scroll.class).caret();
+        CaretOwner scroller = (CaretOwner) tableViewWrap.as(Parent.class, Node.class).
+                lookup(ScrollBar.class).as(CaretOwner.class);
+        Caret c = scroller.caret();
+
+        Direction direction = new Direction() {
+
+            /**
+             * @return < 0 to scroll toward decreasing value, > 0 - vice versa
+             * 0 to stop scrolling
+             * NOTE - see implementation KnobDragScrollerImpl.to(Direction) which is used in ScrollBarWrap
+             *        better to return constant values (-1 || 0 || +1) to get smooth dragging
+             */
+            @Override
+            public int to() {
+                final int[] minmax = new int[]{Integer.MAX_VALUE, -1};
+                final List items = tableViewWrap.getItems();
+                tableViewWrap.as(Parent.class, Node.class).lookup(TableCell.class,
+                        new LookupCriteria<TableCell>() {
+
+                            public boolean check(TableCell control) {
+                                if (NodeWrap.isInside(tableViewWrap.getControl(), control, getEnvironment())) {
+                                    int index = items.indexOf(control.getItem());
+                                    if (index >= 0) {
+                                        if (index < minmax[0]) {
+                                            minmax[0] = index;
+                                        } else if (index > minmax[1]) {
+                                            minmax[1] = index;
+                                        }
+                                    }
+                                }
+                                return true;
+                            }
+                        }).size();
+                int index = items.indexOf(getControl());
+                if (index < minmax[0]) {
+                    return -1;
+                } else if (index > minmax[1]) {
+                    return 1;
+                } else {
+                    return 0;
+                }
+            }
+
+            @Override
+            public String toString() {
+                return "'" + getControl() + "' state at index " + desiredIndex;
+            }
+        };
+        c.to(direction);
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> boolean is(Class<INTERFACE> interfaceClass) {
+        if(WindowElement.class.equals(interfaceClass)) {
+            return true;
+        }
+        return super.is(interfaceClass);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> boolean is(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if(WindowElement.class.equals(interfaceClass) && Scene.class.equals(type)) {
+            return true;
+        }
+        return super.is(interfaceClass, type);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass) {
+        if(WindowElement.class.equals(interfaceClass)) {
+            return (INTERFACE) tableViewWrap.as(interfaceClass);
+        }
+        return super.as(interfaceClass);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if(WindowElement.class.equals(interfaceClass) && Scene.class.equals(type)) {
+            return (INTERFACE) tableViewWrap.as(interfaceClass, type);
+        }
+        return super.as(interfaceClass, type);
+    }
+
+    public static class TableListItemByObjectLookup<ITEM> implements LookupCriteria<TableCell> {
+
+        private final ITEM item;
+
+        public TableListItemByObjectLookup(ITEM item) {
+            this.item = item;
+        }
+
+        @Override
+        public boolean check(TableCell control) {
+            if (control.isVisible() && control.getOpacity() == 1.0) {
+                if ((control.getItem() != null) && control.getItem().equals(item)) {
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        @Override
+        public String toString() {
+            return "Looking for a visible listCell with the value '" + item + "'";
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TableCellWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,53 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+
+package org.jemmy.fx.control;
+
+import javafx.scene.control.TableCell;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.MethodProperties;
+import org.jemmy.env.Environment;
+import org.jemmy.fx.NodeWrap;
+
+
+/**
+ * Wrapper for item classes held in TableCell children of TableView.
+ *
+ * @param <TableCell>
+ * @author KAM
+ */
+@ControlType(TableCell.class)
+@MethodProperties("getItem")
+public class TableCellWrap<T extends TableCell> extends NodeWrap<TableCell> {
+
+    public TableCellWrap(Environment env, T node) {
+        super(env, node);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TableViewWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,317 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import java.util.ArrayList;
+import javafx.collections.ObservableList;
+import javafx.geometry.Orientation;
+import javafx.scene.Node;
+import javafx.scene.control.*;
+import org.jemmy.JemmyException;
+import org.jemmy.Point;
+import org.jemmy.Rectangle;
+import org.jemmy.action.GetAction;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.Property;
+import org.jemmy.control.Wrap;
+import org.jemmy.env.Environment;
+import org.jemmy.fx.FXClickFocus;
+import org.jemmy.fx.NodeWrap;
+import org.jemmy.input.AbstractScroll;
+import org.jemmy.interfaces.*;
+import org.jemmy.lookup.Lookup;
+import org.jemmy.lookup.LookupCriteria;
+
+/**
+ * Wrapper for TableView control. 
+ * Everywhere coordinates are of form {column, row}
+ * @param <CONTROL>
+ * @author Shura
+ */
+@ControlType({TableView.class})
+@ControlInterfaces(value = {Table.class}, encapsulates = {Object.class})
+public class TableViewWrap<CONTROL extends TableView> extends NodeWrap<CONTROL>
+        implements Focusable {
+
+    public static final String SELECTION_PROP_NAME = "selection";
+    private AbstractScroll hScroll, vScroll;
+
+    public TableViewWrap(Environment env, CONTROL nd) {
+        super(env, nd);
+    }
+
+    @Property("itemCount")
+    public int getSize() {
+        return new GetAction<Integer>() {
+
+            @Override
+            public void run(Object... parameters) throws Exception {
+                setResult(getControl().getItems().size());
+            }
+        }.dispatch(getEnvironment());
+    }
+    
+    @Property("items")
+    public ObservableList getItems() {
+        return new GetAction<ObservableList>() {
+
+            @Override
+            public void run(Object... parameters) throws Exception {
+                setResult(getControl().getItems());
+            }
+        }.dispatch(getEnvironment());
+    }
+    
+    @Property("selection")
+    public java.util.List<Point> selection() {
+        return new GetAction<java.util.List<Point>>() {
+
+            @Override
+            public void run(Object... parameters) throws Exception {
+                java.util.List<Point> res = new ArrayList<Point>();
+                for(TablePosition tp : (java.util.List<TablePosition>)getControl().getSelectionModel().getSelectedCells()) {
+                    res.add(new Point(tp.getColumn(), tp.getRow()));
+                }
+                setResult(res);
+            }
+        }.dispatch(getEnvironment());
+    }
+    
+    Object getRow(final int index) {
+        return new GetAction() {
+
+            @Override
+            public void run(Object... parameters) throws Exception {
+                setResult(getControl().getItems().get(index));
+            }
+        }.dispatch(getEnvironment());
+    }
+    
+    TableColumn getColumn(final int index) {
+        return new GetAction<TableColumn>() {
+
+            @Override
+            public void run(Object... parameters) throws Exception {
+                setResult((TableColumn)getControl().getColumns().get(index));
+            }
+        }.dispatch(getEnvironment());
+    }
+    
+    @Property("getColumns")
+    public java.util.List<TableColumn> getColumns() {
+        return new GetAction<java.util.List<TableColumn>>() {
+
+            @Override
+            public void run(Object... parameters) throws Exception {
+                setResult((java.util.List<TableColumn>)getControl().getColumns());
+            }
+        }.dispatch(getEnvironment());
+    }
+    
+    /**
+     * {@inheritDoc }
+     */
+    @Override
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> boolean is(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (Parent.class.equals(interfaceClass)
+                && TableCell.class.equals(type)) {
+            return true;
+        }
+        if (Table.class.equals(interfaceClass)
+                && Object.class.equals(type)) {
+            return true;
+        }
+        return super.is(interfaceClass, type);
+    }
+
+    /**
+     * {@inheritDoc }
+     */
+    @Override
+    @SuppressWarnings("unchecked")
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (CellOwner.class.isAssignableFrom(interfaceClass)) {
+            return (INTERFACE) new TableCellItemParent(this, type);
+        }
+        return super.as(interfaceClass, type);
+    }
+
+    /**
+     * Initialize wraps for ScrollBars if they're not yet initialized
+     */
+    private void checkScrolls() {
+        if (vScroll == null) {
+            vScroll = getScroll(true);
+        }
+        if (hScroll == null) {
+            hScroll = getScroll(false);
+        }
+    }
+
+    /**
+     * @return wrap of parent container that contains TableCells
+     */
+    private Wrap<? extends javafx.scene.Parent> getClippedContainerWrap() {
+        return ((Parent<Node>) as(Parent.class, Node.class)).lookup(javafx.scene.Parent.class, new LookupCriteria<javafx.scene.Parent>() {
+
+            public boolean check(javafx.scene.Parent control) {
+                return control.getClass().getName().endsWith("VirtualFlow$ClippedContainer");
+            }
+        }).wrap();
+    }
+
+    /**
+     * Obtains wrap for scrollbar
+     * @param vertical
+     * @return 
+     */
+    private AbstractScroll getScroll(final boolean vertical) {
+        Lookup<ScrollBar> lookup = as(Parent.class, Node.class).lookup(ScrollBar.class,
+                new LookupCriteria<ScrollBar>() {
+
+                    @Override
+                    public boolean check(ScrollBar control) {
+                        return (control.getOrientation() == Orientation.VERTICAL) == vertical;
+                    }
+                });
+        int count = lookup.size();
+        if (count == 0) {
+            return null;
+        } else if (count == 1) {
+            return lookup.as(AbstractScroll.class);
+        } else {
+            throw new JemmyException("There are more than 1 " + (vertical ? "vertical" : "horizontal")
+                    + " ScrollBars in this TableView");
+        }
+    }
+
+    /**
+     * {@inheritDoc }
+     */
+    private Wrap<? extends TableCell> scrollTo(int index) {
+
+        checkScrolls();
+
+        final int column = 0;
+        final int row = index;
+
+        if (vScroll != null) {
+            vScroll.caret().to(new Caret.Direction() {
+
+                public int to() {
+                    int[] shown = shown();
+                    if (shown[1] > row) {
+                        return -1;
+                    }
+                    if (shown[3] < row) {
+                        return 1;
+                    }
+                    return 0;
+                }
+            });
+        }
+        if (hScroll != null) {
+            hScroll.caret().to(new Caret.Direction() {
+
+                public int to() {
+                    int[] shown = shown();
+                    if (shown[0] > column) {
+                        return -1;
+                    }
+                    if (shown[2] < column) {
+                        return 1;
+                    }
+                    return 0;
+                }
+            });
+        }
+        return null;
+        //as(Parent.class, Node.class).lookup(TableCell.class, ) 
+    }
+
+    /**
+     * Identifies which elements are shown in the TableView currently.
+     * @return {minColumn, minRow, maxColumn, maxRow} of cells that are fully 
+     * visible in the list.
+     */
+    private int[] shown() {
+        final Rectangle viewArea = getScreenBounds(getEnvironment(), getClippedContainerWrap().getControl());
+
+        int[] res = new GetAction<int[]>() {
+
+            @Override
+            @SuppressWarnings("unchecked")
+            public void run(Object... parameters) {
+                final int[] res = new int[]{Integer.MAX_VALUE, Integer.MAX_VALUE, -1, -1};
+
+                as(Parent.class, TableCell.class).lookup(new LookupCriteria<TableCell>() {
+
+                    @Override
+                    public boolean check(TableCell control) {
+                        if (control.isVisible() && control.getOpacity() == 1.0) {
+                            Rectangle bounds = getScreenBounds(getEnvironment(), control);
+                            int column = getColumnIndex(control);
+                            int row = getRowIndex(control);
+                            if (viewArea.contains(bounds)) {
+
+                                res[0] = Math.min(res[0], column);
+                                res[1] = Math.min(res[1], row);
+                                res[2] = Math.max(res[2], column);
+                                res[3] = Math.max(res[3], row);
+                            }
+                        }
+                        return false;
+                    }
+                }).size();
+
+                setResult(res);
+            }
+        }.dispatch(getEnvironment());
+
+        return res;
+    }
+
+    private static int getRowIndex(TableCell tableCell) {
+        return tableCell.getTableRow().getIndex();
+    }
+
+    private static int getColumnIndex(TableCell tableCell) {
+        return tableCell.getTableView().getVisibleLeafIndex(tableCell.getTableColumn());
+    }
+
+    @Override
+    public Focus focuser() {
+        final Rectangle bounds = getScreenBounds();
+        return new FXClickFocus(this, new Point(
+                Math.max(bounds.getWidth() / 2, bounds.getWidth() - 3),
+                Math.max(bounds.getHeight() / 2, bounds.getHeight() - 3)));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TextControlWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,84 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.Scene;
+import javafx.scene.control.Labeled;
+import org.jemmy.fx.ByText;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.Wrap;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.Property;
+import org.jemmy.dock.ObjectLookup;
+import org.jemmy.env.Environment;
+import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.resources.StringComparePolicy;
+
+/**
+ *
+ * @param <T>
+ * @author Shura
+ */
+@ControlType({Labeled.class})
+@ControlInterfaces({org.jemmy.interfaces.Text.class})
+public class TextControlWrap<T extends javafx.scene.control.Control> extends ControlWrap<T> implements org.jemmy.interfaces.Text {
+
+    @ObjectLookup("text and comparison policy")
+    public static <B extends Labeled> LookupCriteria<B> textLookup(Class<B> tp, String text, StringComparePolicy policy) {
+        return new ByText<B>(text, policy);
+    }
+    /**
+     *
+     */
+    public static final String SELECTED_PROP_NAME = "selected";
+    
+    /**
+     *
+     * @param scene
+     * @param nd
+     */
+    public TextControlWrap(Environment env, T node) {
+        super(env, node);
+    }
+
+    @Override
+    @Property(Wrap.TEXT_PROP_NAME)
+    public String text() {
+        return ByText.getNodeText(getControl());
+    }
+
+    @Override
+    public void type(String arg0) {
+    }
+
+    @Override
+    public void clear() {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TextFieldCellEditor.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,50 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.Node;
+import javafx.scene.control.TextField;
+import org.jemmy.control.Wrap;
+import org.jemmy.env.Timeout;
+import org.jemmy.fx.Root;
+import org.jemmy.interfaces.EditableCellOwner.CellEditor;
+import org.jemmy.interfaces.Keyboard.KeyboardButtons;
+import org.jemmy.interfaces.Parent;
+import org.jemmy.interfaces.Showable;
+import org.jemmy.interfaces.Text;
+
+/**
+ *
+ * @author shura
+ */
+public class TextFieldCellEditor<ITEM> implements CellEditor<ITEM> {
+    
+    public static final Timeout BETWEEN_CLICKS_TIMEOUT = new Timeout("sleep.between.click", 1000);
+    
+    static {
+        Root.ROOT.getEnvironment().setTimeout(BETWEEN_CLICKS_TIMEOUT);
+    }
+
+    public void edit(Wrap<? extends ITEM> item, ITEM newValue) {
+        if(!item.is(Parent.class, Node.class)) {
+            throw new IllegalStateException("Only " + ItemWrap.class + " supported. Got " + 
+                    item.getClass().getName());
+        }
+        item.as(Showable.class).shower().show();
+        Parent<Node> parent = item.as(Parent.class, Node.class);
+        initializeEditing(item);
+        Wrap<? extends TextField> field = parent.lookup(TextField.class).wrap();
+        field.as(Text.class).clear();
+        field.as(Text.class).type(newValue.toString());
+        field.keyboard().pushKey(KeyboardButtons.ENTER);
+    }
+    
+    protected void initializeEditing(Wrap<?> cell) {
+        cell.mouse().click();
+        cell.getEnvironment().getTimeout(BETWEEN_CLICKS_TIMEOUT).sleep();
+        cell.mouse().click();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TextInputControlWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,276 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+
+package org.jemmy.fx.control;
+
+import javafx.scene.Scene;
+import javafx.scene.control.TextInputControl;
+import org.jemmy.action.GetAction;
+import org.jemmy.fx.ByText;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.Property;
+import org.jemmy.dock.ObjectLookup;
+import org.jemmy.env.Environment;
+import org.jemmy.input.ClickFocus;
+import org.jemmy.input.SelectionText;
+import org.jemmy.interfaces.ControlInterface;
+import org.jemmy.interfaces.Focus;
+import org.jemmy.interfaces.Focusable;
+import org.jemmy.interfaces.IntervalSelectable;
+import org.jemmy.interfaces.IntervalSelector;
+import org.jemmy.interfaces.Keyboard.KeyboardButtons;
+import org.jemmy.interfaces.Text;
+import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.resources.StringComparePolicy;
+
+@ControlType(TextInputControl.class)
+@ControlInterfaces({SelectionText.class})
+public class TextInputControlWrap<T extends TextInputControl> extends ControlWrap<T> implements Text, IntervalSelectable, Focusable {
+
+    @ObjectLookup("text and comparison policy")
+    public static <B extends TextInputControl> LookupCriteria<B> textLookup(Class<B> tp, String id, StringComparePolicy policy) {
+        return new ByText<B>(id, policy);
+    }
+
+    public static final String IS_FOCUSED_PROP_NAME = "isFocused";
+    SelectionText inputter;
+    TextInputFocus focus = null;
+
+    /**
+     *
+     * @param scene
+     * @param nd
+     */
+    public TextInputControlWrap(Environment env, T node) {
+        super(env, node);
+        inputter = new SelectionText(this) {
+
+            @Override
+            public String text() {
+                return TextInputControlWrap.this.text();
+            }
+
+            @Override
+            public double position() {
+                return TextInputControlWrap.this.dot();
+            }
+
+            @Override
+            public double anchor() {
+                return TextInputControlWrap.this.mark();
+            }
+        };
+        //huh?
+        //TBD why there's not get$multiline() ?
+        if(text().contains("\n")) {
+            inputter.addNavKeys(KeyboardButtons.UP, KeyboardButtons.DOWN);
+        }
+    }
+
+    /**
+     *
+     * @return
+     */
+    @Property(TEXT_PROP_NAME)
+    @Override
+    public String text() {
+        return new GetAction<String>() {
+
+            @Override
+            public void run(Object... parameters) {
+                setResult(getControl().getText());
+            }
+
+            @Override
+            public String toString() {
+                return "Getting text of " + getControl();
+            }
+
+        }.dispatch(getEnvironment());
+    }
+
+    /**
+     *
+     * @return
+     */
+    @Property(POSITION_PROP_NAME)
+    public int dot() {
+        return new GetAction<Integer>() {
+
+            @Override
+            public void run(Object... parameters) {
+                setResult(getControl().getSelection().getEnd());
+            }
+
+            @Override
+            public String toString() {
+                return "Getting position of " + getControl();
+            }
+
+        }.dispatch(getEnvironment());
+    }
+
+    /**
+     *
+     * @return
+     */
+    public int mark() {
+        return new GetAction<Integer>() {
+
+            @Override
+            public void run(Object... parameters) {
+                setResult(getControl().getSelection().getStart());
+            }
+
+            @Override
+            public String toString() {
+                return "Getting selection position of " + getControl();
+            }
+
+        }.dispatch(getEnvironment());
+    }
+
+    /**
+     *
+     * @param arg0
+     */
+    @Override
+    public void type(String arg0) {
+        inputter.type(arg0);
+    }
+
+    /**
+     *
+     */
+    @Override
+    public void clear() {
+        inputter.clear();
+    }
+
+    @Override
+    public double anchor() {
+        return inputter.anchor();
+    }
+
+    @Override
+    public IntervalSelector caret() {
+        return inputter.caret();
+    }
+
+    @Override
+    public double position() {
+        return inputter.position();
+    }
+
+    @Override
+    public void to(double position) {
+        inputter.to(position);
+    }
+
+    /**
+     * An instance of SelectionText which is actually used to perform input
+     * @return
+     */
+    protected SelectionText input() {
+        return inputter;
+    }
+
+    /**
+     * Selects interval.
+     * @param start
+     * @param end
+     */
+    public void select(int start, int end) {
+        caret().to(start);
+        caret().selectTo(end);
+    }
+
+    /**
+     * Selects <code>index</code>'th occurance of the regex.
+     * @param regex
+     * @param index
+     */
+    public void select(String regex, int index) {
+        inputter.select(regex, index);
+    }
+
+    /**
+     * Selects first occurance of the regex.
+     * @param regex
+     */
+    public void select(String regex) {
+        inputter.select(regex);
+    }
+
+    /**
+     * Retuns the selection portion of the text.
+     * @return
+     */
+    public String selection() {
+        return inputter.selection();
+    }
+
+    public Focus focuser() {
+        if(focus == null) {
+            focus = new TextInputFocus();
+        }
+        return focus;
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> boolean is(Class<INTERFACE> interfaceClass) {
+        if(Text.class.isAssignableFrom(interfaceClass) || interfaceClass.isAssignableFrom(SelectionText.class)) return true;
+        return super.is(interfaceClass);
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass) {
+        if(Text.class.isAssignableFrom(interfaceClass) || interfaceClass.isAssignableFrom(SelectionText.class))
+            return (INTERFACE) inputter;
+        return super.as(interfaceClass);
+    }
+
+    private class TextInputFocus extends ClickFocus {
+
+        public TextInputFocus() {
+            super(TextInputControlWrap.this);
+        }
+
+        @Override
+        public void focus() {
+            if(!getProperty(Boolean.class, IS_FOCUSED_PROP_NAME)) {
+                super.focus();
+            }
+            waitProperty(IS_FOCUSED_PROP_NAME, true);
+        }
+
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ThemeDriverFactory.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,81 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.control.Control;
+import javafx.scene.control.ScrollBar;
+import javafx.scene.control.Slider;
+import org.jemmy.control.Wrap;
+import org.jemmy.fx.control.caspian.CaspianDriverFactory;
+import org.jemmy.interfaces.Scroll;
+import org.jemmy.interfaces.Scroller;
+import org.jemmy.interfaces.Shifter;
+import org.jemmy.interfaces.TreeItem;
+
+/**
+ * Defines how FX controls are operated. This implementation defines "generic"
+ * behavior which comes from JemmyCore. Theme-specific implementations are
+ * to be provided for every theme.
+ * 
+ * Ported from the project JemmyFX, original class 
+ * is   org.jemmy.fx.control.DriverFactory
+ * 
+ * @see CaspianDriverFactory
+ * @author shura
+ */
+public abstract class ThemeDriverFactory {
+
+    final static String NOT_SUPPORTED = "Not supported in the ThemeDriverFactory";
+    /**
+     * NOTE Probably param Environment env should be passed to the factory.
+     * @return theme-specific implementation of the ThemeDriverFactory. Only 
+     * CaspianDriverFactor is provided to the moment.
+     */
+    public static ThemeDriverFactory newInstance() {
+        return new CaspianDriverFactory(); 
+    }
+    /**
+     * Returns scroller for Slider and ScrollBar. Default implementation is yet disabled.
+     * @see Slider
+     * @see ScrollBar
+     * @see SliderOperator
+     * @see ScrollBarOperator
+     * @see Scroll
+     * @param wrap - the operator instance
+     * @param scroll - Scroll instance. Any method of it could be used but the
+     * caret() method.
+     * @return
+     */
+    public abstract Scroller caret(final Wrap<? extends Control> wrap, final Scroll scroll);
+
+    public abstract Shifter track(final Wrap<? extends Control> wrap, final Scroll scroll);
+    
+    public abstract <T> TreeItem treeItem(Wrap<T> itemWrap);
+ }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ToggleButtonWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,155 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+
+package org.jemmy.fx.control;
+
+import java.util.LinkedList;
+import java.util.List;
+import javafx.scene.Scene;
+import javafx.scene.control.ToggleButton;
+import org.jemmy.action.GetAction;
+import org.jemmy.fx.ByText;
+import org.jemmy.fx.NodeParent;
+import org.jemmy.fx.Root;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.Property;
+import org.jemmy.control.SelectorImpl;
+import org.jemmy.env.Environment;
+import org.jemmy.interfaces.ControlInterface;
+import org.jemmy.interfaces.Selectable;
+import org.jemmy.interfaces.Selector;
+import org.jemmy.interfaces.TypeControlInterface;
+import org.jemmy.lookup.Any;
+import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.resources.StringComparePolicy;
+
+/**
+ *
+ * @param <T>
+ * @author shura
+ */
+@ControlType({ToggleButton.class})
+@ControlInterfaces(value={Selectable.class}, encapsulates={Boolean.class})
+public class ToggleButtonWrap<T extends ToggleButton> extends TextControlWrap<T> implements Selectable<Boolean> {
+    
+    List<Boolean> stateList = new LinkedList<Boolean>();
+    Selector<Boolean> selector = new SelectorImpl<ToggleButton, Boolean>(this, this);
+
+    /**
+     *
+     * @param scene
+     * @param node
+     */
+    public ToggleButtonWrap(Environment env, T node) {
+        super(env, node);
+        stateList.add(false);
+        stateList.add(true);
+    }
+
+    public static ToggleButtonWrap<ToggleButton> find(NodeParent parent, LookupCriteria<ToggleButton> criteria) {
+        return new ToggleButtonWrap<ToggleButton>(parent.getEnvironment(),
+                parent.getParent().lookup(ToggleButton.class, criteria).get());
+    }
+
+    public static ToggleButtonWrap<ToggleButton> find(NodeParent parent, String text) {
+        return find(parent, new ByText<ToggleButton>(text, parent.getEnvironment().
+                getProperty(Root.LOOKUP_STRING_COMPARISON, StringComparePolicy.EXACT)));
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> boolean is(Class<INTERFACE> interfaceClass) {
+        if(Selectable.class.equals(interfaceClass)) {
+            return true;
+        }
+        return super.is(interfaceClass);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> boolean is(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if(Selectable.class.equals(interfaceClass) && Boolean.class.equals(type)) {
+            return true;
+        }
+        return super.is(interfaceClass, type);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass) {
+        if(Selectable.class.equals(interfaceClass)) {
+            return (INTERFACE) this;
+        }
+        return super.as(interfaceClass);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if(Selectable.class.equals(interfaceClass) && Boolean.class.equals(type)) {
+            return (INTERFACE) this;
+        }
+        return super.as(interfaceClass, type);
+    }
+
+    @Override
+    public List<Boolean> getStates() {
+        return stateList;
+    }
+
+    @Override
+    public Selector<Boolean> selector() {
+        return selector;
+    }
+
+    @Override
+    public Class<Boolean> getType() {
+        return Boolean.class;
+    }
+
+    @Property(SELECTED_PROP_NAME)
+    @Override
+    public Boolean getState() {
+        return new GetAction<Boolean>() {
+
+            @Override
+            public void run(Object... parameters) {
+                setResult(getControl().isSelected());
+            }
+
+            @Override
+            public String toString() {
+                return null;
+            }
+
+        }.dispatch(getEnvironment());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/ToolBarWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,289 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import java.util.ArrayList;
+import java.util.List;
+import javafx.collections.ObservableList;
+import javafx.geometry.Orientation;
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import javafx.scene.control.ToolBar;
+import org.jemmy.JemmyException;
+import org.jemmy.Point;
+import org.jemmy.action.GetAction;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.MethodProperties;
+import org.jemmy.control.Property;
+import org.jemmy.fx.NodeWrap;
+import org.jemmy.fx.SceneWrap;
+import org.jemmy.control.Wrap;
+import org.jemmy.env.Environment;
+import org.jemmy.interfaces.ControlInterface;
+import org.jemmy.interfaces.Focus;
+import org.jemmy.interfaces.Parent;
+import org.jemmy.interfaces.Selectable;
+import org.jemmy.interfaces.Selector;
+import org.jemmy.interfaces.TypeControlInterface;
+import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.timing.State;
+import org.jemmy.timing.Waiter;
+
+@ControlType({ToolBar.class})
+@ControlInterfaces(value={Selectable.class}, encapsulates=Node.class)
+public class ToolBarWrap<CONTROL extends ToolBar> extends NodeWrap<CONTROL> {
+    public static final String VERTICAL_PROP_NAME = "vertical";
+
+    private Selectable<Node> objectSelectable = new ToolBarSelectable();
+
+    private Focus focus = new Focus() {
+        public void focus() {
+            if (!isFocused()) {
+                mouse().click(1, new Point(1, 1));
+            }
+            waitState(focusedState, true);
+        }
+    };
+
+    private State<Boolean> focusedState = new State<Boolean>() {
+        public Boolean reached() {
+            return isFocused();
+        }
+    };
+
+    /**
+     *
+     * @param env
+     * @param scene
+     * @param nd
+     */
+    @SuppressWarnings("unchecked")
+    public ToolBarWrap(Environment env, CONTROL nd) {
+        super(env, nd);
+    }
+
+    public Node getSelectedItem() {
+        return new GetAction<Node>() {
+
+            @Override
+            public void run(Object... parameters) {
+                for (Node item : getToolBar().getItems()) {
+                    if (item.isFocused()) {
+                        setResult(item);
+                    }
+                }
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    public Integer getSelectedItemIndex() {
+        return new GetAction<Integer>() {
+
+            @Override
+            public void run(Object... parameters) {
+                ObservableList<Node> list = getToolBar().getItems();
+                for (int i = 0; i < list.size(); i++) {
+                    if (list.get(i).isFocused()) {
+                        setResult(i);
+                    }
+                }
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    @Property(ToolBarWrap.VERTICAL_PROP_NAME)
+    public boolean vertical() {
+        return new GetAction<Boolean>() {
+            @Override
+            public void run(Object... parameters) {
+                setResult(getControl().getOrientation() == Orientation.VERTICAL);
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> boolean is(Class<INTERFACE> interfaceClass) {
+        // Default Parent is Parent<Node> which is super
+        if (Selectable.class.equals(interfaceClass)) {
+            return true;
+        }
+        return super.is(interfaceClass);
+    }
+
+    @Override
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> boolean is(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (Parent.class.equals(interfaceClass)
+                && !Node.class.equals(type)) {
+            return true;
+        }
+        if (Selectable.class.equals(interfaceClass)) {
+            return true;
+        }
+        return super.is(interfaceClass, type);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass) {
+        // Default Parent is Parent<Node> which is super
+        if (Selectable.class.equals(interfaceClass)) {
+            return (INTERFACE) objectSelectable;
+        }
+        return super.as(interfaceClass);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>>
+           INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (Selectable.class.equals(interfaceClass)) {
+            return (INTERFACE) new ToolBarSelectable();
+        }
+        return super.as(interfaceClass, type);
+    }
+
+    @Override
+    public Focus focuser() {
+        return focus;
+    }
+
+    private class ToolBarSelectable implements Selectable<Node>, Selector<Node> {
+
+        @Override
+        public List<Node> getStates() {
+            return new GetAction<ArrayList<Node>>() {
+                @Override
+                public void run(Object... parameters) {
+                    setResult(new ArrayList<Node>(getToolBar().getItems()));
+                }
+                @Override
+                public String toString() {
+                    return "Fetching all data items from " + ToolBarSelectable.this;
+                }
+            }.dispatch(getEnvironment());
+        }
+
+        @Override
+        @Property(Selectable.STATE_PROP_NAME)
+        public Node getState() {
+            return getSelectedItem();
+        }
+
+        public Selector<Node> selector() {
+            return this;
+        }
+
+        public Class getType() {
+            return Node.class;
+        }
+
+        public void select(final Node state) {
+            final Scene selected_scene = new GetAction<Scene>() {
+                    @Override
+                    public void run(Object... parameters) {
+                        setResult(state.getScene());
+                    }
+                }.dispatch(getEnvironment());
+            if (selected_scene != scene) {
+                Boolean visible = false;
+                if (selected_scene != null) {
+                    visible = new GetAction<Boolean>() {
+                        @Override
+                        public void run(Object... parameters) {
+                            setResult(selected_scene.getWindow().isShowing());
+                        }
+                    }.dispatch(getEnvironment());
+                }
+                if (!visible) {
+                    Wrap<Node> expandMenu = as(Parent.class, Node.class).lookup(new LookupCriteria<Node>() {
+                        @Override
+                        public boolean check(Node control) {
+                            return control.getClass().getName().contentEquals("com.sun.javafx.scene.control.skin.ToolBarSkin$ToolBarOverflowMenu");
+                        }
+                    }).wrap(0);
+                    expandMenu.mouse().click();
+                }
+                Scene new_selected_scene = new GetAction<Scene>() {
+                    @Override
+                    public void run(Object... parameters) {
+                        setResult(state.getScene());
+                    }
+                }.dispatch(getEnvironment());
+                if (new_selected_scene == null) {
+                    throw new JemmyException("The menu bar can not be expanded", getControl());
+                }
+                Wrap<? extends Scene> popup_scene_wrap = new SceneWrap(getEnvironment(), new_selected_scene);
+                Wrap<Node> item = popup_scene_wrap.as(Parent.class, Node.class).lookup(new LookupCriteria<Node>() {
+                    @Override
+                    public boolean check(Node control) {
+                        return control.equals(state);
+                    }
+                }).wrap(0);
+                item.mouse().click();
+            } else {
+                Boolean found = new GetAction<Boolean>() {
+                    @Override
+                    public void run(Object... parameters) {
+                        for (Node item : getToolBar().getItems()) {
+                            if (item.equals(state)) {
+                                setResult(true);
+                                return;
+                            }
+                        }
+                        setResult(false);
+                    }
+                }.dispatch(getEnvironment());
+
+                if (!found) {
+                    throw new JemmyException("The menu bar does not contain an item", getControl());
+                }
+
+                new NodeWrap(getEnvironment(), state).mouse().click();
+            }
+
+            new Waiter(WAIT_STATE_TIMEOUT).waitValue(state, new State<Node>() {
+                @Override
+                public Node reached() {
+                    return getSelectedItem();
+                }
+                @Override
+                public String toString() {
+                    return "Checking that selected item [" + getSelectedItem()
+                            + "] is " + state;
+                }
+            });
+        }
+    }
+
+    public CONTROL getToolBar() {
+        return getControl();
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TreeImpl.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,90 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.control.TreeItem;
+import javafx.scene.control.TreeView;
+import org.jemmy.fx.Root;
+import org.jemmy.control.Wrap;
+import org.jemmy.interfaces.Tree;
+import org.jemmy.interfaces.TreeSelector;
+import org.jemmy.lookup.Lookup;
+import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.timing.State;
+
+/**
+ *
+ * @author shura
+ */
+class TreeImpl<T> implements Tree<T> {
+
+    Class<T> itemType;
+    TreeViewWrap owner;
+    TreeItem root;
+    TreeItemParent parent;
+
+    public TreeImpl(Class<T> itemType, TreeViewWrap<? extends TreeView> outer, TreeItem root, 
+            TreeItemParent parent) {
+        this.owner = outer;
+        this.itemType = itemType;
+        this.root = root;
+        this.parent = parent;
+    }
+
+    public TreeSelector<T> selector() {
+        return new TreeSelectorImpl();
+    }
+
+    public Class<T> getType() {
+        return itemType;
+    }
+
+    private class TreeSelectorImpl<T> implements TreeSelector<T> {
+
+        private TreeItem<T> select(final TreeItem<T> root, final LookupCriteria<T>... criteria) {
+            if (criteria.length >= 1) {
+                final LookupCriteria<T> c = criteria[0];
+                return owner.getEnvironment().getWaiter(Lookup.WAIT_CONTROL_TIMEOUT).
+                        ensureState(new State<TreeItem<T>>() {
+
+                    public TreeItem<T> reached() {
+                        for (TreeItem<T> ti : root.getChildren()) {
+                            if (c.check(ti.getValue())) {
+                                System.out.println("Found " + c.toString());
+                                if (criteria.length > 1) {
+                                    if (!ti.isExpanded()) {
+                                        Root.ROOT.getThemeFactory().treeItem(
+                                                new TreeNodeWrap(ti,
+                                                        owner, parent.getEditor())).expand();
+                                    }
+                                    return select(ti, FXStringMenuOwner.decreaseCriteria(criteria));
+                                } else {
+                                    return ti;
+                                }
+                            }
+                        }
+                        //well, none found
+                        return null;
+                    }
+                });
+            } else {
+                throw new IllegalStateException("Non-empty criteria list is expected");
+            }
+        }
+
+        @Override
+        public Wrap select(LookupCriteria<T>... criteria) {
+            if (owner.getTreeView().isShowRoot()
+                && criteria.length > 0
+                && !root.isExpanded()) {
+                Root.ROOT.getThemeFactory().treeItem(new TreeNodeWrap(root, owner, parent.getEditor())).expand();
+            }
+            Wrap res = new TreeItemWrap(itemType, select(root, criteria), owner, 
+                    parent.getEditor());
+            res.mouse().click();
+            return res;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TreeItemParent.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,48 @@
+/*
+ * To change this template, choose Tools | Templates and open the template in
+ * the editor.
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.control.TreeItem;
+import javafx.scene.control.TreeView;
+import org.jemmy.control.Wrap;
+
+/**
+ *
+ * @author shura
+ */
+public class TreeItemParent<T> extends ItemParent<TreeItem, T, Object> {
+
+    TreeViewWrap<? extends TreeView> treeViewWrap;
+
+    public TreeItemParent(TreeViewWrap<? extends TreeView> treeViewWrap, Class<T> lookupClass) {
+        super(treeViewWrap, lookupClass);
+        this.treeViewWrap = treeViewWrap;
+    }
+
+    @Override
+    protected void doRefresh() {
+        refresh(treeViewWrap.getRoot());
+    }
+
+    private void refresh(TreeItem<? extends T> parent) {
+        getFound().add((TreeItem<T>) parent);
+        getAux().add(null);
+        if (parent.isExpanded()) {
+            for (TreeItem<? extends T> si : parent.getChildren()) {
+                refresh(si);
+            }
+        }
+    }
+
+    @Override
+    protected T getValue(TreeItem item) {
+        return (T) item.getValue();
+    }
+
+    @Override
+    public <DT extends T> Wrap<? extends DT> wrap(Class<DT> type, TreeItem item, Object aux) {
+        return new TreeItemWrap<DT>(type, item, treeViewWrap, getEditor());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TreeItemWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,169 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.Node;
+import javafx.scene.control.TreeCell;
+import javafx.scene.control.TreeItem;
+import javafx.scene.control.TreeView;
+import org.jemmy.Rectangle;
+import org.jemmy.action.GetAction;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.Property;
+import org.jemmy.control.Wrap;
+import org.jemmy.dock.DockInfo;
+import org.jemmy.fx.NodeWrap;
+import org.jemmy.fx.Root;
+import org.jemmy.interfaces.Caret.Direction;
+import org.jemmy.interfaces.EditableCellOwner.EditableCell;
+import org.jemmy.interfaces.EditableCellOwner.CellEditor;
+import org.jemmy.interfaces.*;
+import org.jemmy.lookup.LookupCriteria;
+
+/**
+ * This wraps an object within the tree
+ * @author barbashov, shura
+ * @param <DATA> 
+ */
+@ControlType(Object.class)
+@ControlInterfaces({org.jemmy.interfaces.TreeItem.class, EditableCell.class})
+@DockInfo(name = "org.jemmy.fx.control.TreeItemDock")
+public class TreeItemWrap<DATA> extends ItemWrap<DATA> implements EditableCell<DATA> {
+
+    private Class<DATA> dataClass;
+    private TreeNodeWrap<TreeItem> theWrap;
+    /**
+     *
+     * @param env
+     * @param item
+     * @param TreeViewWrap
+     */
+    TreeItemWrap(Class<DATA> dataClass, TreeItem<DATA> item,
+            TreeViewWrap<? extends TreeView> treeViewWrap,
+            CellEditor<? super DATA> editor) {
+        super(item.getValue(), treeViewWrap, editor);
+        this.dataClass = dataClass;
+        theWrap = new TreeNodeWrap(item, treeViewWrap, editor);
+    }
+
+    public TreeItem getItem() {
+        return theWrap.getControl();
+    }
+
+    public Class<DATA> getDataClass() {
+        return dataClass;
+    }
+
+    public TreeViewWrap<? extends TreeView> tree() {
+        return theWrap.getViewWrap();
+    }
+
+    @Override
+    public Rectangle getScreenBounds() {
+        return theWrap.getScreenBounds();
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> boolean is(Class<INTERFACE> interfaceClass) {
+        if (org.jemmy.interfaces.TreeItem.class.equals(interfaceClass)) {
+            return true;
+        }
+        return super.is(interfaceClass);
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass) {
+        if (org.jemmy.interfaces.TreeItem.class.equals(interfaceClass)) {
+            return (INTERFACE) Root.ROOT.getThemeFactory().treeItem(theWrap);
+        }
+        return super.as(interfaceClass);
+    }
+
+    @Override
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> boolean is(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (org.jemmy.interfaces.TreeItem.class.equals(interfaceClass)) {
+            return true;
+        }
+        if (Parent.class.equals(interfaceClass) && Node.class.equals(type)) {
+            return true;
+        }
+        return super.is(interfaceClass, type);
+    }
+
+    @Override
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (org.jemmy.interfaces.TreeItem.class.equals(interfaceClass)) {
+            return (INTERFACE) Root.ROOT.getThemeFactory().treeItem(theWrap);
+        }
+        if (Parent.class.equals(interfaceClass) && Node.class.equals(type)) {
+            return theWrap.as(interfaceClass, type);
+        }
+        return super.as(interfaceClass, type);
+    }
+
+    public final Wrap<? extends Node> getNode() {
+        return theWrap.getNode();
+    }
+
+    @Override
+    public Show shower() {
+        return theWrap.shower();
+    }
+
+    @Property(TreeNodeWrap.EXPANDED_PROP_NAME)
+    public boolean isExpanded() {
+        return theWrap.isExpanded();
+    }
+
+    @Property(TreeNodeWrap.LEAF_PROP_NAME)
+    public boolean isLeaf() {
+        return theWrap.isLeaf();
+    }
+
+    @Override
+    public void edit(DATA newValue) {
+        editor.edit(this, newValue);
+    }
+
+    @Override
+    public Class<DATA> getType() {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    protected Wrap<? extends Node> cellWrap() {
+        return getNode();
+    }
+
+    public void show() {
+        theWrap.show();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TreeNodeParent.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,48 @@
+/*
+ * To change this template, choose Tools | Templates and open the template in
+ * the editor.
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.control.TreeItem;
+import javafx.scene.control.TreeView;
+import org.jemmy.control.Wrap;
+
+/**
+ *
+ * @author shura
+ */
+public class TreeNodeParent<T> extends ItemParent<TreeItem, TreeItem, Object> {
+
+    TreeViewWrap<? extends TreeView> treeViewWrap;
+
+    public TreeNodeParent(TreeViewWrap<? extends TreeView> treeViewWrap) {
+        super(treeViewWrap, TreeItem.class);
+        this.treeViewWrap = treeViewWrap;
+    }
+
+    @Override
+    protected void doRefresh() {
+        refresh(treeViewWrap.getRoot());
+    }
+
+    private void refresh(TreeItem<? extends T> parent) {
+        getFound().add((TreeItem<T>) parent);
+        getAux().add(null);
+        if (parent.isExpanded()) {
+            for (TreeItem<? extends T> si : parent.getChildren()) {
+                refresh(si);
+            }
+        }
+    }
+
+    @Override
+    protected TreeItem getValue(TreeItem item) {
+        return item;
+    }
+
+    @Override
+    public <DT extends TreeItem> Wrap<? extends DT> wrap(Class<DT> type, TreeItem item, Object aux) {
+        return new TreeNodeWrap(item, treeViewWrap, getEditor());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/TreeNodeWrap.java	Fri Feb 03 18:46:04 2012 +0400
@@ -0,0 +1,236 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at LICENSE.html or
+ * http://www.sun.com/cddl.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this License Header
+ * Notice in each file.
+ *
+ * If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s): Alexandre (Shura) Iline. (shurymury@gmail.com)
+ *
+ * The Original Software is the Jemmy library.
+ * The Initial Developer of the Original Software is Alexandre Iline.
+ * All Rights Reserved.
+ *
+ */
+package org.jemmy.fx.control;
+
+import javafx.scene.Node;
+import javafx.scene.control.TreeCell;
+import javafx.scene.control.TreeView;
+import org.jemmy.Rectangle;
+import org.jemmy.action.GetAction;
+import org.jemmy.control.ControlInterfaces;
+import org.jemmy.control.ControlType;
+import org.jemmy.control.Property;
+import org.jemmy.control.Wrap;
+import org.jemmy.dock.DockInfo;
+import org.jemmy.fx.NodeWrap;
+import org.jemmy.fx.Root;
+import org.jemmy.interfaces.Caret.Direction;
+import org.jemmy.interfaces.*;
+import org.jemmy.interfaces.EditableCellOwner.CellEditor;
+import org.jemmy.interfaces.EditableCellOwner.EditableCell;
+import org.jemmy.lookup.LookupCriteria;
+
+/**
+ * This wraps an object within the tree
+ * @author barbashov, shura
+ * @param <DATA> 
+ */
+@ControlType(Object.class)
+@ControlInterfaces({org.jemmy.interfaces.TreeItem.class})
+@DockInfo(name = "org.jemmy.fx.control.TreeNodeDock")
+public class TreeNodeWrap<T extends javafx.scene.control.TreeItem> extends Wrap<T> 
+    implements Showable, Show, EditableCell<Object> {
+
+    public static final String EXPANDED_PROP_NAME = "expanded";
+    public static final String LEAF_PROP_NAME = "leaf";
+
+    private TreeViewWrap<? extends TreeView> treeViewWrap;
+    private CellEditor<Object> editor;
+
+    public TreeNodeWrap(T item,
+            TreeViewWrap<? extends TreeView> treeViewWrap,
+            CellEditor<Object> editor) {
+        super(treeViewWrap.getEnvironment(), item);
+        this.treeViewWrap = treeViewWrap;
+        this.editor = editor;
+    }
+    
+    TreeViewWrap<? extends TreeView> getViewWrap() {
+        return treeViewWrap;
+    }
+
+    public TreeViewWrap<? extends TreeView> tree() {
+        return treeViewWrap;
+    }
+
+    @Override
+    public Rectangle getScreenBounds() {
+        return new GetAction<Rectangle>() {
+
+            @Override
+            public void run(Object... parameters) {
+                TreeCell treeCell = treeViewWrap.getTreeCell(getControl());
+                if (treeCell != null) {
+                    setResult(NodeWrap.getScreenBounds(getEnvironment(), treeCell));
+                }
+            }
+        }.dispatch(getEnvironment());
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> boolean is(Class<INTERFACE> interfaceClass) {
+        if (org.jemmy.interfaces.TreeItem.class.equals(interfaceClass)) {
+            return true;
+        }
+        return super.is(interfaceClass);
+    }
+
+    @Override
+    public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass) {
+        if (org.jemmy.interfaces.TreeItem.class.equals(interfaceClass)) {
+            return (INTERFACE) Root.ROOT.getThemeFactory().treeItem(this);
+        }
+        return super.as(interfaceClass);
+    }
+
+    @Override
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> boolean is(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (org.jemmy.interfaces.TreeItem.class.equals(interfaceClass)) {
+            return true;
+        }
+        if (Parent.class.equals(interfaceClass) && Node.class.equals(type)) {
+            return true;
+        }
+        return super.is(interfaceClass, type);
+    }
+
+    @Override
+    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type) {
+        if (org.jemmy.interfaces.TreeItem.class.equals(interfaceClass)) {
+            return (INTERFACE) Root.ROOT.getThemeFactory().treeItem(this);
+        }
+        if (Parent.class.equals(interfaceClass) && Node.class.equals(type)) {
+            return getNode().as(interfaceClass, type);
+        }
+        return super.as(interfaceClass, type);
+    }
+
+    public final Wrap<? extends Node> getNode() {
+        return treeViewWrap.as(Parent.class, Node.class).
+                lookup(TreeCell.class, new LookupCriteria<TreeCell>() {
+
+            public boolean check(TreeCell cntrl) {
+                return cntrl.getItem() != null && cntrl.getTreeItem().equals(getControl());
+            }
+
+            @Override
+            public String toString() {
+                return "Node for an item " + getControl().toString();
+            }
+        }).wrap();
+    }
+
+    @Override
+    public Show shower() {
+        return this;
+    }
+
+    @Override
+    public void show() {
+        System.out.println("Showing " + getControl().getValue());
+        treeViewWrap.as(Scroll.class).caret().to(new Direction() {
+
+            public int to() {
+                final int[] minmax = new int[]{treeViewWrap.getStates().size(), -1};
+                treeViewWrap.as(Parent.class, Node.class).lookup(TreeCell.class,
+                        new LookupCriteria<TreeCell>() {
+
+                            public boolean check(TreeCell control) {
+                                if (NodeWrap.isInside(treeViewWrap.getControl(), control, getEnvironment())) {
+                                    int index = treeViewWrap.getRow(control.getTreeItem());
+                                    if (index >= 0) {
+                                        if (index < minmax[0]) {
+                                            minmax[0] = index;
+                                        } else if (index > minmax[1]) {
+                                            minmax[1] = index;
+                                        }
+                                    }
+                                }
+                                return true;
+                            }
+                        }).size();
+                int index = treeViewWrap.getRow(getControl());
+                if (index < minmax[0]) {
+                    return -1;
+                } else if (index > minmax[1]) {
+                    return 1;
+                } else {
+                    return 0;
+                }
+            }
+        });
+    }
+
+    protected boolean isReallyVisible(Node node) {
+        Node parent = node;
+        while (parent != null) {
+            if (parent.isVisible() == false) {
+                return false;
+            }
+            parent = parent.getParent();
+        }
+        return true;
+    }
+
+    @Property(EXPANDED_PROP_NAME)