changeset 6791:3438cbe3ac87 8u20-b10

Automated merge with ssh://jfxsrc.us.oracle.com//sandbox/javafx/8u/8u-1402/jfx/rt
author kcr
date Tue, 15 Apr 2014 13:22:04 -0700
parents 1d0dbb25b964 f8f8ab5638cf
children a3560e26f17c cae00dae76d5 e1a8dbd8353a
files .hgtags
diffstat 80 files changed, 1588 insertions(+), 604 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Apr 11 06:41:11 2014 -0700
+++ b/.hgtags	Tue Apr 15 13:22:04 2014 -0700
@@ -143,3 +143,4 @@
 32bf1d506829f6cf080c1b26208e08e76e553292 8u5-b12
 619edda5595cc54b5dd1f40131abe123ba180b04 8u5-b13
 d7e80f499365af8cca1ec29443fc9adb5aad598f 8u20-b08
+4e6e6ad7ad1dc350d9590ba8c0f9ab90aa6c73e0 8u20-b09
--- a/apps/experiments/WebTerminal/src/webterminal/WebTerminal.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/apps/experiments/WebTerminal/src/webterminal/WebTerminal.java	Tue Apr 15 13:22:04 2014 -0700
@@ -128,6 +128,19 @@
         wrapOnLongLines = value;
     }
 
+    /** Default string to use to mark an automatic break for over-long lines.
+     * It is 'arrow pointing downwards then curving leftwards' followed by
+     * 'zero width space'.  This visually looks OK, plus is easy to
+     * recognize as it wouldn't appear in real text.
+     */
+    public static final String DEFAULT_WRAP_STRING ="\u2936\u200B";
+    /** String to use to mark an automatic break for over-long lines.
+     * TODO: On windows resize remove wrapString, and re-wrap.
+     * TODO: On copy/selection, remove wrapString.
+     */
+    String wrapString = DEFAULT_WRAP_STRING;
+    String wrapStringNewline = DEFAULT_WRAP_STRING + '\n';
+
     public void resetCursorCache() {
         currentCursorColumn = -1;
         currentCursorLine = -1;
@@ -1252,9 +1265,7 @@
                     if (nextColumn > wrapWidth) {
                         if (wrapOnLongLines) {
                             insertSimpleOutput(str, prevEnd, i, kind, curColumn);
-                            //currentCursorColumn = column;
-                            //insertWrapBreak();
-                            cursorLineStart(1);
+                            insertWrapBreak();
                             prevEnd = i;
                         }
                         //line++;
@@ -1302,18 +1313,23 @@
             outputBefore = errElement.getNextSibling();
         }
         else {
-            org.w3c.dom.Node previous = outputBefore != null ? outputBefore.getPreviousSibling()
-                : outputContainer.getLastChild();
-            if (previous instanceof Text)
-                ((Text) previous).appendData(str);
-            else {
-                Text text = documentNode.createTextNode(str);
-                insertNode(text);
-            }
+            insertRawOutput(str);
         }
         currentCursorColumn = endColumn;
     }
 
+    void insertRawOutput(String str) {
+        org.w3c.dom.Node previous
+            = outputBefore != null ? outputBefore.getPreviousSibling()
+            : outputContainer.getLastChild();
+        if (previous instanceof Text)
+            ((Text) previous).appendData(str);
+        else {
+            Text text = documentNode.createTextNode(str);
+            insertNode(text);
+        }
+    }
+
     /** Insert a node at (before) current position.
      * Caller needs to update cursor cache or call resetCursorCache. */
     public void insertNode (org.w3c.dom.Node node) {
@@ -1384,7 +1400,15 @@
 
     /** Insert a line break because of wrapping an over-long line. */
     protected void insertWrapBreak() {
-        insertBreak();
+        if (false) {
+            cursorLineStart(1);
+        } else {
+            int oldLine = currentCursorLine;
+            insertRawOutput(wrapStringNewline);
+            if (oldLine >= 0)
+                currentCursorLine = oldLine + 1;
+            currentCursorColumn = 0;
+        }
     }
 
     public void handleEvent(org.w3c.dom.events.Event event) {
--- a/apps/toys/Hello/src/main/java/a11y/HelloText.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/apps/toys/Hello/src/main/java/a11y/HelloText.java	Tue Apr 15 13:22:04 2014 -0700
@@ -26,6 +26,7 @@
 
 import javafx.application.Application;
 import javafx.scene.Scene;
+import javafx.scene.control.TextArea;
 import javafx.scene.control.TextField;
 import javafx.scene.layout.VBox;
 import javafx.scene.paint.Color;
@@ -48,9 +49,9 @@
 
 
         TextField tf = new TextField("Hello Accessiblity");
+        TextArea ta = new TextArea("TextArea can many lines.\nLine1.\nLine2 is longer.\nLine 3 is not.");
 
-
-        Scene scene = new Scene(new VBox(text, tf, new Text("Text 2"), new TextField("text field 2")), 300, 300);
+        Scene scene = new Scene(new VBox(text, tf, ta), 300, 300);
 //        scene.addEventFilter(KeyEvent.KEY_PRESSED, new EventHandler<KeyEvent>() {
 //            @Override
 //            public void handle(KeyEvent event) {
--- a/build.gradle	Fri Apr 11 06:41:11 2014 -0700
+++ b/build.gradle	Tue Apr 15 13:22:04 2014 -0700
@@ -1904,6 +1904,10 @@
 
         doFirst {
             copy {
+                from "$projectDir/src/test/resources/hello/java-logo2.gif"
+                into project.file("$projectDir/build/tmp/tests/appResources")
+            }
+            copy {
                 from "$projectDir/../../LICENSE"
                 into project.file("$projectDir/build/tmp/tests/appResources")
             }
--- a/buildSrc/armv7hft.gradle	Fri Apr 11 06:41:11 2014 -0700
+++ b/buildSrc/armv7hft.gradle	Tue Apr 15 13:22:04 2014 -0700
@@ -218,6 +218,9 @@
 directfb.prism.order=sw
 directfb.com.sun.javafx.isEmbedded=true
 directfb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+directfb.com.sun.javafx.gestures.zoom=true
+directfb.com.sun.javafx.gestures.rotate=true
+directfb.com.sun.javafx.gestures.scroll=true
 eglfb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 eglfb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
 eglfb.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
@@ -234,6 +237,9 @@
 eglfb.com.sun.javafx.isEmbedded=true
 eglfb.doNativeComposite=true
 eglfb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+eglfb.com.sun.javafx.gestures.zoom=true
+eglfb.com.sun.javafx.gestures.rotate=true
+eglfb.com.sun.javafx.gestures.scroll=true
 eglfb.prism.glDepthSize=0
 fb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 fb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
@@ -244,6 +250,9 @@
 fb.com.sun.javafx.isEmbedded=true
 fb.glass.restrictWindowToScreen=true
 fb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+fb.com.sun.javafx.gestures.zoom=true
+fb.com.sun.javafx.gestures.rotate=true
+fb.com.sun.javafx.gestures.scroll=true
 monocle.glass.platform=Monocle
 monocle.prism.order=es2,sw
 monocle.prism.eglfb=true
@@ -256,6 +265,9 @@
 monocle.com.sun.javafx.isEmbedded=true
 monocle.doNativeComposite=true
 monocle.com.sun.javafx.scene.control.skin.FXVK.cache=true
+monocle.com.sun.javafx.gestures.zoom=true
+monocle.com.sun.javafx.gestures.rotate=true
+monocle.com.sun.javafx.gestures.scroll=true
 monocle.prism.glDepthSize=0
 eglx11.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 eglx11.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
@@ -272,6 +284,9 @@
 eglx11.embedded=eglx11
 eglx11.com.sun.javafx.isEmbedded=true
 eglx11.com.sun.javafx.scene.control.skin.FXVK.cache=true
+eglx11.com.sun.javafx.gestures.zoom=true
+eglx11.com.sun.javafx.gestures.rotate=true
+eglx11.com.sun.javafx.gestures.scroll=true
 eglx11.prism.glDepthSize=0
 gtk.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 gtk.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
@@ -279,7 +294,10 @@
 gtk.glass.platform=gtk
 gtk.prism.order=sw
 gtk.com.sun.javafx.isEmbedded=true
-gtk.com.sun.javafx.scene.control.skin.FXVK.cache=true"""
+gtk.com.sun.javafx.scene.control.skin.FXVK.cache=true
+gtk.com.sun.javafx.gestures.zoom=true
+gtk.com.sun.javafx.gestures.rotate=true
+gtk.com.sun.javafx.gestures.scroll=true"""
 
 def pangoCCFlags = [extraCFlags, "-D_ENABLE_PANGO"];
 def pangoLinkFlags = [extraLFlags];
--- a/buildSrc/armv7sft.gradle	Fri Apr 11 06:41:11 2014 -0700
+++ b/buildSrc/armv7sft.gradle	Tue Apr 15 13:22:04 2014 -0700
@@ -225,6 +225,9 @@
 directfb.prism.order=sw
 directfb.com.sun.javafx.isEmbedded=true
 directfb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+directfb.com.sun.javafx.gestures.zoom=true
+directfb.com.sun.javafx.gestures.rotate=true
+directfb.com.sun.javafx.gestures.scroll=true
 eglfb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 eglfb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
 eglfb.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
@@ -242,6 +245,9 @@
 eglfb.embedded=eglfb
 eglfb.com.sun.javafx.isEmbedded=true
 eglfb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+eglfb.com.sun.javafx.gestures.zoom=true
+eglfb.com.sun.javafx.gestures.rotate=true
+eglfb.com.sun.javafx.gestures.scroll=true
 eglfb.prism.glDepthSize=0
 fb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 fb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
@@ -252,6 +258,9 @@
 fb.com.sun.javafx.isEmbedded=true
 fb.glass.restrictWindowToScreen=true
 fb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+fb.com.sun.javafx.gestures.zoom=true
+fb.com.sun.javafx.gestures.rotate=true
+fb.com.sun.javafx.gestures.scroll=true
 monocle.glass.platform=Monocle
 monocle.prism.order=es2,sw
 monocle.prism.eglfb=true
@@ -264,6 +273,9 @@
 monocle.com.sun.javafx.isEmbedded=true
 monocle.doNativeComposite=true
 monocle.com.sun.javafx.scene.control.skin.FXVK.cache=true
+monocle.com.sun.javafx.gestures.zoom=true
+monocle.com.sun.javafx.gestures.rotate=true
+monocle.com.sun.javafx.gestures.scroll=true
 monocle.prism.glDepthSize=0
 eglx11.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 eglx11.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
@@ -280,6 +292,9 @@
 eglx11.embedded=eglx11
 eglx11.com.sun.javafx.isEmbedded=true
 eglx11.com.sun.javafx.scene.control.skin.FXVK.cache=true
+eglx11.com.sun.javafx.gestures.zoom=true
+eglx11.com.sun.javafx.gestures.rotate=true
+eglx11.com.sun.javafx.gestures.scroll=true
 eglx11.prism.glDepthSize=0
 gtk.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 gtk.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
@@ -287,7 +302,10 @@
 gtk.glass.platform=gtk
 gtk.prism.order=sw
 gtk.com.sun.javafx.isEmbedded=true
-gtk.com.sun.javafx.scene.control.skin.FXVK.cache=true"""
+gtk.com.sun.javafx.scene.control.skin.FXVK.cache=true
+gtk.com.sun.javafx.gestures.zoom=true
+gtk.com.sun.javafx.gestures.rotate=true
+gtk.com.sun.javafx.gestures.scroll=true"""
 
 def pangoCCFlags = [extraCFlags, "-D_ENABLE_PANGO"];
 def pangoLinkFlags = [extraLFlags];
--- a/buildSrc/x86egl.gradle	Fri Apr 11 06:41:11 2014 -0700
+++ b/buildSrc/x86egl.gradle	Tue Apr 15 13:22:04 2014 -0700
@@ -190,6 +190,9 @@
 directfb.prism.order=sw
 directfb.com.sun.javafx.isEmbedded=true
 directfb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+directfb.com.sun.javafx.gestures.zoom=true
+directfb.com.sun.javafx.gestures.rotate=true
+directfb.com.sun.javafx.gestures.scroll=true
 eglfb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 eglfb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
 eglfb.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
@@ -204,6 +207,9 @@
 eglfb.com.sun.javafx.isEmbedded=true
 eglfb.doNativeComposite=true
 eglfb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+eglfb.com.sun.javafx.gestures.zoom=true
+eglfb.com.sun.javafx.gestures.rotate=true
+eglfb.com.sun.javafx.gestures.scroll=true
 fb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 fb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
 fb.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
@@ -213,6 +219,9 @@
 fb.com.sun.javafx.isEmbedded=true
 fb.glass.restrictWindowToScreen=true
 fb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+fb.com.sun.javafx.gestures.zoom=true
+fb.com.sun.javafx.gestures.rotate=true
+fb.com.sun.javafx.gestures.scroll=true
 monocle.glass.platform=Monocle
 monocle.prism.order=es2,sw
 monocle.prism.eglfb=true
@@ -225,6 +234,9 @@
 monocle.com.sun.javafx.isEmbedded=true
 monocle.doNativeComposite=true
 monocle.com.sun.javafx.scene.control.skin.FXVK.cache=true
+monocle.com.sun.javafx.gestures.zoom=true
+monocle.com.sun.javafx.gestures.rotate=true
+monocle.com.sun.javafx.gestures.scroll=true
 monocle.prism.glDepthSize=0
 eglx11.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 eglx11.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
@@ -239,13 +251,19 @@
 eglx11.embedded=eglx11
 eglx11.com.sun.javafx.isEmbedded=true
 eglx11.com.sun.javafx.scene.control.skin.FXVK.cache=true
+eglx11.com.sun.javafx.gestures.zoom=true
+eglx11.com.sun.javafx.gestures.rotate=true
+eglx11.com.sun.javafx.gestures.scroll=true
 gtk.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 gtk.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
 gtk.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 gtk.glass.platform=gtk
 gtk.prism.order=sw
 gtk.com.sun.javafx.isEmbedded=true
-gtk.com.sun.javafx.scene.control.skin.FXVK.cache=true"""
+gtk.com.sun.javafx.scene.control.skin.FXVK.cache=true
+gtk.com.sun.javafx.gestures.zoom=true
+gtk.com.sun.javafx.gestures.rotate=true
+gtk.com.sun.javafx.gestures.scroll=true"""
 
 def pangoCCFlags = ["-D_ENABLE_PANGO"];
 def pangoLinkFlags = [];
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TableViewBehaviorBase.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TableViewBehaviorBase.java	Tue Apr 15 13:22:04 2014 -0700
@@ -444,7 +444,10 @@
             getControl().requestFocus();
         }
     }
-    
+
+    protected boolean isRTL() {
+        return (getControl().getEffectiveNodeOrientation() == NodeOrientation.RIGHT_TO_LEFT);
+    }
     
     
     /**************************************************************************
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TreeTableViewBehavior.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TreeTableViewBehavior.java	Tue Apr 15 13:22:04 2014 -0700
@@ -201,7 +201,11 @@
      */
     private void rightArrowPressed() {
         if (getControl().getSelectionModel().isCellSelectionEnabled()) {
-            selectRightCell();
+            if (isRTL()) {
+                selectLeftCell();
+            } else {
+                selectRightCell();
+            }
         } else {
             expandRow();
         }
@@ -209,7 +213,11 @@
     
     private void leftArrowPressed() {
         if (getControl().getSelectionModel().isCellSelectionEnabled()) {
-            selectLeftCell();
+            if (isRTL()) {
+                selectRightCell();
+            } else {
+                selectLeftCell();
+            }
         } else {
             collapseRow();
         }
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java	Tue Apr 15 13:22:04 2014 -0700
@@ -538,6 +538,14 @@
     
     private ListView<T> createListView() {
         final ListView<T> _listView = new ListView<T>() {
+
+            {
+                // disable selecting the first item on focus gain - this is
+                // not what is expected in the ComboBox control (unlike the
+                // ListView control, which does this).
+                getProperties().put("selectOnFocusGain", false);
+            }
+
             @Override protected double computeMinHeight(double width) {
                 return 30;
             }
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/CustomColorDialog.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/CustomColorDialog.java	Tue Apr 15 13:22:04 2014 -0700
@@ -78,6 +78,7 @@
         dialog.setTitle(getString("customColorDialogTitle"));
         dialog.initModality(Modality.APPLICATION_MODAL);
         dialog.initStyle(StageStyle.UTILITY);
+        dialog.setResizable(false);
         colorRectPane = new ColorRectPane();
         controlsPane = new ControlsPane();
         setHgrow(controlsPane, Priority.ALWAYS);
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Tue Apr 15 13:22:04 2014 -0700
@@ -102,7 +102,7 @@
     private Label label;
 
     // sort order
-    private int sortPos = -1;
+    int sortPos = -1;
     private Region arrow;
     private Label sortOrderLabel;
     private HBox sortOrderDots;
@@ -185,6 +185,7 @@
     
     private ListChangeListener<TableColumnBase<?,?>> visibleLeafColumnsListener = c -> {
         updateColumnIndex();
+        updateSortPosition();
     };
     
     private ListChangeListener<String> styleClassListener = c -> {
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TextAreaSkin.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TextAreaSkin.java	Tue Apr 15 13:22:04 2014 -0700
@@ -51,6 +51,7 @@
 import javafx.geometry.VerticalDirection;
 import javafx.scene.Group;
 import javafx.scene.Node;
+import javafx.scene.accessibility.Attribute;
 import javafx.scene.control.IndexRange;
 import javafx.scene.control.ScrollPane;
 import javafx.scene.control.TextArea;
@@ -1374,4 +1375,16 @@
     public Bounds getCaretBounds() {
         return getSkinnable().sceneToLocal(caretPath.localToScene(caretPath.getBoundsInLocal()));
     }
+
+    @Override
+    protected Object accGetAttribute(Attribute attribute, Object... parameters) {
+        switch (attribute) {
+            case LINE_FOR_OFFSET:
+            case LINE_START:
+            case LINE_END:
+                Text text = getTextNode();
+                return text.accGetAttribute(attribute, parameters);
+            default: return super.accGetAttribute(attribute, parameters);
+        }
+    }
 }
--- a/modules/controls/src/main/java/javafx/scene/chart/Axis.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/chart/Axis.java	Tue Apr 15 13:22:04 2014 -0700
@@ -629,7 +629,7 @@
     @Override protected void layoutChildren() {
         final double width = getWidth();
         final double height = getHeight();
-        final double tickMarkLength = (getTickLength() > 0) ? getTickLength() : 0;
+        final double tickMarkLength = (isTickMarkVisible() && getTickLength() > 0) ? getTickLength() : 0;
         final boolean isFirstPass = oldLength == 0;
         // auto range if it is not valid
         final Side side = getEffectiveSide();
--- a/modules/controls/src/main/java/javafx/scene/chart/Chart.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/chart/Chart.java	Tue Apr 15 13:22:04 2014 -0700
@@ -29,6 +29,7 @@
 import java.util.Collections;
 import java.util.List;
 
+import com.sun.javafx.scene.control.skin.Utils;
 import javafx.animation.Animation;
 import javafx.animation.KeyFrame;
 import javafx.beans.property.BooleanProperty;
@@ -355,7 +356,7 @@
             if (shouldShowLegend) {
                 if (getLegendSide() == Side.TOP) {
                     final double legendHeight = snapSize(legend.prefHeight(width-left-right));
-                    final double legendWidth = snapSize(legend.prefWidth(legendHeight));
+                    final double legendWidth = Utils.boundedSize(snapSize(legend.prefWidth(legendHeight)), 0, width - left - right);
                     legend.resizeRelocate(left + (((width - left - right)-legendWidth)/2), top, legendWidth, legendHeight);
                     if ((height - bottom - top - legendHeight) < MIN_HEIGHT_TO_LEAVE_FOR_CHART_CONTENT) {
                         shouldShowLegend = false;
@@ -364,7 +365,7 @@
                     }
                 } else if (getLegendSide() == Side.BOTTOM) {
                     final double legendHeight = snapSize(legend.prefHeight(width-left-right));
-                    final double legendWidth = snapSize(legend.prefWidth(legendHeight));
+                    final double legendWidth = Utils.boundedSize(snapSize(legend.prefWidth(legendHeight)), 0, width - left - right);
                     legend.resizeRelocate(left + (((width - left - right)-legendWidth)/2), height-bottom-legendHeight, legendWidth, legendHeight);
                     if ((height - bottom - top - legendHeight) < MIN_HEIGHT_TO_LEAVE_FOR_CHART_CONTENT) {
                         shouldShowLegend = false;
@@ -373,7 +374,7 @@
                     }
                 } else if (getLegendSide() == Side.LEFT) {
                     final double legendWidth = snapSize(legend.prefWidth(height-top-bottom));
-                    final double legendHeight = snapSize(legend.prefHeight(legendWidth));
+                    final double legendHeight = Utils.boundedSize(snapSize(legend.prefHeight(legendWidth)), 0, height - top - bottom);
                     legend.resizeRelocate(left,top +(((height-top-bottom)-legendHeight)/2),legendWidth,legendHeight);
                     if ((width - left - right - legendWidth) < MIN_WIDTH_TO_LEAVE_FOR_CHART_CONTENT) {
                         shouldShowLegend = false;
@@ -382,7 +383,7 @@
                     }
                 } else if (getLegendSide() == Side.RIGHT) {
                     final double legendWidth = snapSize(legend.prefWidth(height-top-bottom));
-                    final double legendHeight = snapSize(legend.prefHeight(legendWidth));
+                    final double legendHeight = Utils.boundedSize(snapSize(legend.prefHeight(legendWidth)), 0, height - top - bottom);
                     legend.resizeRelocate(width-right-legendWidth,top +(((height-top-bottom)-legendHeight)/2),legendWidth,legendHeight);
                     if ((width - left - right - legendWidth) < MIN_WIDTH_TO_LEAVE_FOR_CHART_CONTENT) {
                         shouldShowLegend = false;
--- a/modules/controls/src/main/java/javafx/scene/control/ListView.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/ListView.java	Tue Apr 15 13:22:04 2014 -0700
@@ -46,6 +46,7 @@
 import javafx.collections.FXCollections;
 import javafx.collections.ListChangeListener;
 import javafx.collections.ListChangeListener.Change;
+import javafx.collections.MapChangeListener;
 import javafx.collections.ObservableList;
 import javafx.css.StyleableDoubleProperty;
 import javafx.event.Event;
@@ -322,7 +323,24 @@
         // ...edit commit handler
         setOnEditCommit(DEFAULT_EDIT_COMMIT_HANDLER);
 
+        // Fix for RT-35679
         focusedProperty().addListener(focusedListener);
+
+        // Fix for RT-36651, which was introduced by RT-35679 (above) and resolved
+        // by having special-case code to remove the listener when requested.
+        // This is done by ComboBoxListViewSkin, so that selection is not done
+        // when a ComboBox is shown.
+        getProperties().addListener((MapChangeListener<Object, Object>) change -> {
+            if (change.wasAdded() && "selectOnFocusGain".equals(change.getKey())) {
+                Boolean selectOnFocusGain = (Boolean) change.getValueAdded();
+                if (selectOnFocusGain == null) return;
+                if (selectOnFocusGain) {
+                    focusedProperty().addListener(focusedListener);
+                } else {
+                    focusedProperty().removeListener(focusedListener);
+                }
+            }
+        });
     }
     
     
--- a/modules/controls/src/main/java/javafx/scene/control/TextArea.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/TextArea.java	Tue Apr 15 13:22:04 2014 -0700
@@ -704,6 +704,9 @@
     @Override public Object accGetAttribute(Attribute attribute, Object... parameters) {
         switch (attribute) {
             case ROLE: return Role.TEXT_AREA;
+            case LINE_FOR_OFFSET: //Skin
+            case LINE_START: //Skin
+            case LINE_END:  //Skin
             default: return super.accGetAttribute(attribute, parameters);
         }
     }
--- a/modules/controls/src/main/java/javafx/scene/control/TextInputControl.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/TextInputControl.java	Tue Apr 15 13:22:04 2014 -0700
@@ -1226,6 +1226,8 @@
             }
             case SELECTION_START: return getSelection().getStart();
             case SELECTION_END: return getSelection().getEnd();
+            case CARET_OFFSET: return getCaretPosition();
+            case FONT: return getFont();
             default: return super.accGetAttribute(attribute, parameters);
         }
     }
--- a/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/modena.css	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/modena.css	Tue Apr 15 13:22:04 2014 -0700
@@ -2388,6 +2388,12 @@
     -fx-text-fill: -fx-selection-bar-text;
     -fx-padding: 0.166667em;
 }
+.table-view .column-header .context-menu,
+.tree-table-view .column-header .context-menu,
+.table-view > .column-header-background > .show-hide-columns-button .context-menu,
+.tree-table-view > .column-header-background > .show-hide-columns-button .context-menu {
+    -fx-font-weight: null;
+}
 .table-view .filler,
 .tree-table-view .filler,
 .table-view:constrained-resize .filler,
--- a/modules/controls/src/test/java/com/sun/javafx/scene/control/skin/TableColumnHeaderRetriever.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/controls/src/test/java/com/sun/javafx/scene/control/skin/TableColumnHeaderRetriever.java	Tue Apr 15 13:22:04 2014 -0700
@@ -39,4 +39,8 @@
         TableColumnHeader colHeader = VirtualFlowTestUtils.getTableColumnHeader(col.getTableView(), col);
         colHeader.moveColumn(col, newPos);
     }
+
+    public static int getSortPos(TableColumnHeader header) {
+        return header.sortPos;
+    }
 }
--- a/modules/controls/src/test/java/com/sun/javafx/scene/control/test/Person.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/controls/src/test/java/com/sun/javafx/scene/control/test/Person.java	Tue Apr 15 13:22:04 2014 -0700
@@ -24,17 +24,19 @@
  */
 package com.sun.javafx.scene.control.test;
 
+import javafx.beans.property.BooleanProperty;
 import javafx.beans.property.ReadOnlyIntegerProperty;
 import javafx.beans.property.ReadOnlyIntegerWrapper;
+import javafx.beans.property.SimpleBooleanProperty;
 import javafx.beans.property.SimpleIntegerProperty;
 import javafx.beans.property.SimpleStringProperty;
 import javafx.beans.property.StringProperty;
 
 public class Person {
+    private final SimpleBooleanProperty invited;
     private final SimpleStringProperty firstName;
     private final SimpleStringProperty lastName;
     private final SimpleStringProperty email;
-//    private final SimpleIntegerProperty age;
     private final ReadOnlyIntegerWrapper age;
     
     public Person(String fName, int age) {
@@ -50,6 +52,15 @@
         this.lastName = new SimpleStringProperty(lName);
         this.email = new SimpleStringProperty(email);
         this.age = new ReadOnlyIntegerWrapper(age);
+        this.invited = null;
+    }
+
+    public Person(String fName, String lName, String email, boolean invited) {
+        this.firstName = new SimpleStringProperty(fName);
+        this.lastName = new SimpleStringProperty(lName);
+        this.email = new SimpleStringProperty(email);
+        this.age = null;
+        this.invited = new SimpleBooleanProperty(invited);
     }
 
     public String getFirstName() {
@@ -91,6 +102,9 @@
     public final int getAge() {return age.get();}
     public ReadOnlyIntegerProperty ageProperty() {return age.getReadOnlyProperty();}
 
+    public final boolean isInvited() { return invited.get(); }
+    public BooleanProperty invitedProperty() { return invited; }
+
     @Override public String toString() {
         return getFirstName() + " " + getLastName();
     }
--- a/modules/controls/src/test/java/javafx/scene/control/ComboBoxTest.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/controls/src/test/java/javafx/scene/control/ComboBoxTest.java	Tue Apr 15 13:22:04 2014 -0700
@@ -1552,4 +1552,25 @@
         
         sl.dispose();
     }
+
+    @Test public void test_rt36651() {
+        final ComboBox<String> cb = new ComboBox<>(FXCollections.observableArrayList("a", "b", "c"));
+        cb.setEditable(true);
+        StageLoader sl = new StageLoader(cb);
+
+        assertNull(cb.getValue());
+        assertEquals(-1, cb.getSelectionModel().getSelectedIndex());
+        assertNull(cb.getSelectionModel().getSelectedItem());
+
+        sl.getStage().requestFocus();
+        cb.show();
+        Toolkit.getToolkit().firePulse();
+
+        // selection should not change just by showing the popup
+        assertNull(cb.getValue());
+        assertEquals(-1, cb.getSelectionModel().getSelectedIndex());
+        assertNull(cb.getSelectionModel().getSelectedItem());
+
+        sl.dispose();
+    }
 }
--- a/modules/controls/src/test/java/javafx/scene/control/TableViewTest.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/controls/src/test/java/javafx/scene/control/TableViewTest.java	Tue Apr 15 13:22:04 2014 -0700
@@ -3014,4 +3014,143 @@
 
         sl.dispose();
     }
+
+    @Test public void test_rt_36656_removeFromSortOrder() {
+        test_rt_36656(true, false, false);
+    }
+
+    @Test public void test_rt_36656_removeFromColumns() {
+        test_rt_36656(false, true, false);
+    }
+
+    @Test public void test_rt_36656_setInvisible() {
+        test_rt_36656(false, false, true);
+    }
+
+    private void test_rt_36656(boolean removeFromSortOrder, boolean removeFromColumns, boolean setInvisible) {
+        final ObservableList<Person> data =
+                FXCollections.observableArrayList(
+                        new Person("Jacob", "Smith", "jacob.smith@example.com"),
+                        new Person("Isabella", "Johnson", "isabella.johnson@example.com"),
+                        new Person("Ethan", "Williams", "ethan.williams@example.com"),
+                        new Person("Emma", "Jones", "emma.jones@example.com"),
+                        new Person("Michael", "Brown", "michael.brown@example.com"));
+
+        TableView<Person> table = new TableView<Person>();
+        table.setItems(data);
+
+        TableColumn firstNameCol = new TableColumn("First Name");
+        firstNameCol.setMinWidth(100);
+        firstNameCol.setCellValueFactory(new PropertyValueFactory<Person, String>("firstName"));
+
+        TableColumn lastNameCol = new TableColumn("Last Name");
+        lastNameCol.setMinWidth(100);
+        lastNameCol.setCellValueFactory(new PropertyValueFactory<Person, String>("lastName"));
+
+        TableColumn emailCol = new TableColumn("Email");
+        emailCol.setMinWidth(200);
+        emailCol.setCellValueFactory(new PropertyValueFactory<Person, String>("email"));
+
+        table.getColumns().addAll(firstNameCol, lastNameCol, emailCol);
+
+        new StageLoader(table);
+
+        TableColumnHeader firstNameColHeader = VirtualFlowTestUtils.getTableColumnHeader(table, firstNameCol);
+        TableColumnHeader lastNameColHeader = VirtualFlowTestUtils.getTableColumnHeader(table, lastNameCol);
+        TableColumnHeader emailColHeader = VirtualFlowTestUtils.getTableColumnHeader(table, emailCol);
+
+        // test initial state
+        assertEquals(-1, TableColumnHeaderRetriever.getSortPos(firstNameColHeader));
+        assertEquals(-1, TableColumnHeaderRetriever.getSortPos(lastNameColHeader));
+        assertEquals(-1, TableColumnHeaderRetriever.getSortPos(emailColHeader));
+
+        // set an order including all columns
+        table.getSortOrder().addAll(firstNameCol, lastNameCol, emailCol);
+        assertEquals(0, TableColumnHeaderRetriever.getSortPos(firstNameColHeader));
+        assertEquals(1, TableColumnHeaderRetriever.getSortPos(lastNameColHeader));
+        assertEquals(2, TableColumnHeaderRetriever.getSortPos(emailColHeader));
+
+        if (removeFromSortOrder) {
+            // Remove lastNameCol from the table sortOrder list, so this column
+            // is no longer part of the sort comparator
+            table.getSortOrder().remove(lastNameCol);
+        } else if (removeFromColumns) {
+            // Remove lastNameCol from the table entirely.
+            table.getColumns().remove(lastNameCol);
+        } else if (setInvisible) {
+            // Hide the lastNameColumn.
+            lastNameCol.setVisible(false);
+        }
+
+        // Regardless of action taken above, expect lastNameCol sortPos to be -1
+        // and emailCol sortPos to shift from 2 to 1.
+        assertEquals(0, TableColumnHeaderRetriever.getSortPos(firstNameColHeader));
+        assertEquals(-1, TableColumnHeaderRetriever.getSortPos(lastNameColHeader));
+        assertEquals(1, TableColumnHeaderRetriever.getSortPos(emailColHeader));
+    }
+
+    @Ignore("Test written before fix was available.")
+    @Test public void test_rt_36670() {
+        final ObservableList<Person> data = FXCollections.observableArrayList(
+                new Person("Jacob", "Smith", "jacob.smith@example.com", true),
+                new Person("Isabella", "Johnson", "isabella.johnson@example.com", false),
+                new Person("Ethan", "Williams", "ethan.williams@example.com", true),
+                new Person("Emma", "Jones", "emma.jones@example.com", true),
+                new Person("Michael", "Brown", "michael.brown@example.com", false));
+
+        TableColumn invitedCol = new TableColumn<>();
+        invitedCol.setText("Invited");
+        invitedCol.setMinWidth(70);
+        invitedCol.setCellValueFactory(new PropertyValueFactory("invited"));
+        invitedCol.setCellFactory(CheckBoxTableCell.forTableColumn(invitedCol));
+
+        TableColumn firstNameCol = new TableColumn();
+        firstNameCol.setText("First");
+        firstNameCol.setCellValueFactory(new PropertyValueFactory("firstName"));
+
+        TableView tableView = new TableView(data);
+        tableView.getColumns().addAll(invitedCol, firstNameCol);
+
+        StageLoader sl = new StageLoader(tableView);
+
+        // get the checkboxes
+        CheckBox row0CheckBox = (CheckBox) VirtualFlowTestUtils.getCell(tableView, 0, 0).getGraphic();
+        CheckBox row1CheckBox = (CheckBox) VirtualFlowTestUtils.getCell(tableView, 1, 0).getGraphic();
+        CheckBox row2CheckBox = (CheckBox) VirtualFlowTestUtils.getCell(tableView, 2, 0).getGraphic();
+        CheckBox row3CheckBox = (CheckBox) VirtualFlowTestUtils.getCell(tableView, 3, 0).getGraphic();
+        CheckBox row4CheckBox = (CheckBox) VirtualFlowTestUtils.getCell(tableView, 4, 0).getGraphic();
+
+        // check initial state of all checkboxes
+        assertTrue(row0CheckBox.isSelected());
+        assertFalse(row1CheckBox.isSelected());
+        assertTrue(row2CheckBox.isSelected());
+        assertTrue(row3CheckBox.isSelected());
+        assertFalse(row4CheckBox.isSelected());
+
+        // sort the table based on the invited column
+        tableView.getSortOrder().add(invitedCol);
+        Toolkit.getToolkit().firePulse();
+
+        // The sort order has changed, with unselected items at the top and
+        // selected items beneath them.
+        assertFalse(row0CheckBox.isSelected());
+        assertFalse(row1CheckBox.isSelected());
+        assertTrue(row2CheckBox.isSelected());
+        assertTrue(row3CheckBox.isSelected());
+        assertTrue(row4CheckBox.isSelected());
+
+        // now, select the 'Michael' row, which is row 1
+        row1CheckBox.setSelected(true);
+        Toolkit.getToolkit().firePulse();
+
+        // only the Michael row should have changed state - but the bug
+        // identified in RT-36670 shows that row 0 is also selected
+        assertFalse(row0CheckBox.isSelected());
+        assertTrue(row1CheckBox.isSelected());
+        assertTrue(row2CheckBox.isSelected());
+        assertTrue(row3CheckBox.isSelected());
+        assertTrue(row4CheckBox.isSelected());
+
+        sl.dispose();
+    }
 }
--- a/modules/fxpackager/src/main/java/com/oracle/bundlers/StandardBundlerParam.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/java/com/oracle/bundlers/StandardBundlerParam.java	Tue Apr 15 13:22:04 2014 -0700
@@ -443,11 +443,6 @@
             );
 
     public static void extractParamsFromAppResources(Map<String, ? super Object> params) {
-        RelativeFileSet appResources = APP_RESOURCES.fetchFrom(params);
-
-        if (appResources == null) {
-            return;
-        }
         boolean hasMainClass = params.containsKey(MAIN_CLASS.getID());
         boolean hasMainJar = params.containsKey(MAIN_JAR.getID());
         boolean hasMainJarClassPath = params.containsKey(MAIN_JAR_CLASSPATH.getID());
@@ -455,12 +450,34 @@
         if (hasMainClass && hasMainJar && hasMainJarClassPath) {
             return;
         }
+        Iterable<String> files;
+        File srcdir;
+
+        if (hasMainJar) {
+            RelativeFileSet rfs = MAIN_JAR.fetchFrom(params);
+            files = rfs.getIncludedFiles();
+            srcdir = rfs.getBaseDirectory();
+        } else if (hasMainJarClassPath) {
+            files = Arrays.asList(MAIN_JAR_CLASSPATH.fetchFrom(params).split(File.pathSeparator));
+            srcdir = null;
+        } else {
+            RelativeFileSet rfs = APP_RESOURCES.fetchFrom(params);
+            if (rfs == null) {
+                return;
+            }
+            files = rfs.getIncludedFiles();
+            srcdir = rfs.getBaseDirectory();
+        }
+
+
         String declaredMainClass = (String) params.get(MAIN_CLASS.getID());
 
-        File srcdir = appResources.getBaseDirectory();
         // presume the set iterates in-order
-        for (String fname : appResources.getIncludedFiles()) {
+        for (String fname : files) {
             try {
+                // only sniff jars
+                if (!fname.toLowerCase().endsWith(".jar")) continue;
+
                 File file = new File(srcdir, fname);
                 JarFile jf = new JarFile(file);
                 Manifest m = jf.getManifest();
@@ -495,7 +512,10 @@
                         }
                     }
                     if (!hasMainJar) {
-                        params.put(MAIN_JAR.getID(), new RelativeFileSet(appResources.getBaseDirectory(), new LinkedHashSet<>(Arrays.asList(file))));
+                        if (srcdir == null) {
+                            srcdir = file.getParentFile();
+                        }
+                        params.put(MAIN_JAR.getID(), new RelativeFileSet(srcdir, new LinkedHashSet<>(Arrays.asList(file))));
                     }
                     if (!hasMainJarClassPath) {
                         String cp = attrs.getValue(Attributes.Name.CLASS_PATH);
--- a/modules/fxpackager/src/main/java/com/oracle/bundlers/mac/MacAppStoreBundler.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/java/com/oracle/bundlers/mac/MacAppStoreBundler.java	Tue Apr 15 13:22:04 2014 -0700
@@ -305,10 +305,21 @@
             //we are not interested in return code, only possible exception
             APP_BUNDLER.fetchFrom(params).doValidate(params);
 
-            // more stringent app store validations
+            // make sure we have settings for signatures
+            if (MAC_APP_STORE_APP_SIGNING_KEY.fetchFrom(params) == null) {
+                throw new ConfigException(
+                        I18N.getString("error.no-app-signing-key"),
+                        I18N.getString("error.no-app-signing-key.advice"));
+            }
+            if (MAC_APP_STORE_PKG_SIGNING_KEY.fetchFrom(params) == null) {
+                throw new ConfigException(
+                        I18N.getString("error.no-pkg-signing-key"),
+                        I18N.getString("error.no-pkg-signing-key.advice"));
+            }
+
+            // things we could check...
             // check the icons, make sure it has hidpi icons
             // check the category, make sure it fits in the list apple has provided
-            // make sure we have settings for signatures
             // validate bundle identifier is reverse dns
             //  check for \a+\.\a+\..
 
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/ant/Application.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/ant/Application.java	Tue Apr 15 13:22:04 2014 -0700
@@ -59,7 +59,7 @@
     String id = null;
     boolean embeddedIntoSwing = false;
     String version = null;
-    boolean daemon = false;
+    Boolean daemon = null;
 
     public void setVersion(String v) {
         version = v;
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/Log.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/Log.java	Tue Apr 15 13:22:04 2014 -0700
@@ -114,4 +114,8 @@
     public static boolean isDebug() {
         return debug;
     }
+
+    public static void setDebug(boolean debug) {
+        Log.debug = debug;
+    }
 }
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/PackagerLib.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/PackagerLib.java	Tue Apr 15 13:22:04 2014 -0700
@@ -475,6 +475,8 @@
             if (bp != null) {
                 generateNativeBundles(deployParams.outdir, bp.getBundleParamsAsMap(), deployParams.getBundleType().toString(), deployParams.getTargetFormat());
             }
+        } catch (PackagerException ex) {
+            throw ex;
         } catch (Exception ex) {
             throw new PackagerException(ex, "ERR_DeployFailed", ex.getMessage());
         }
@@ -482,7 +484,7 @@
         this.deployParams = null;
     }
 
-    private void generateNativeBundles(File outdir, Map<String, ? super Object> params, String bundleType, String bundleFormat) {
+    private void generateNativeBundles(File outdir, Map<String, ? super Object> params, String bundleType, String bundleFormat) throws PackagerException {
         outdir = new File(outdir, "bundles");
 
         if (params.containsKey(RUNTIME.getID())) {
@@ -506,12 +508,16 @@
             Map<String, ? super Object> localParams = new HashMap<>(params);
             try {
                 if (bundler.validate(localParams)) {
-                    bundler.execute(localParams, outdir);
+                    File result = bundler.execute(localParams, outdir);
+                    if (result == null) {
+                        throw new PackagerException("MSG_BundlerFailed", bundler.getID(), bundler.getName());
+                    }
                 }
                 
             } catch (UnsupportedPlatformException e) {
                 Log.debug(MessageFormat.format(bundle.getString("MSG_BundlerPlatformException"), bundler.getName()));
             } catch (ConfigException e) {
+                Log.debug(e);
                 if (e.getAdvice() != null) {
                     Log.info(MessageFormat.format(bundle.getString("MSG_BundlerConfigException"), bundler.getName(), e.getMessage(), e.getAdvice()));
                 } else {
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/LinuxAppBundler.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/LinuxAppBundler.java	Tue Apr 15 13:22:04 2014 -0700
@@ -53,6 +53,21 @@
             BUNDLER_PREFIX + "linux" + File.separator;
     private static final String EXECUTABLE_NAME = "JavaAppLauncher";
 
+    public static final BundlerParamInfo<File> ICON_PNG = new StandardBundlerParam<>(
+            I18N.getString("param.icon-png.name"),
+            I18N.getString("param.icon-png.description"),
+            "icon.png",
+            File.class,
+            params -> {
+                File f = ICON.fetchFrom(params);
+                if (f != null && !f.getName().toLowerCase().endsWith(".png")) {
+                    Log.info(MessageFormat.format(I18N.getString("message.icon-not-png"), f));
+                    return null;
+                }
+                return f;
+            },
+            (s, p) -> new File(s));
+
     public static final BundlerParamInfo<URL> RAW_EXECUTABLE_URL = new StandardBundlerParam<>(
             I18N.getString("param.raw-executable-url.name"),
             I18N.getString("param.raw-executable-url.description"),
@@ -312,7 +327,6 @@
                 PREFERENCES_ID,
                 RAW_EXECUTABLE_URL,
                 LINUX_RUNTIME,
-                USE_FX_PACKAGING,
                 USER_JVM_OPTIONS,
                 VERSION
         );
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/LinuxDebBundler.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/LinuxDebBundler.java	Tue Apr 15 13:22:04 2014 -0700
@@ -220,7 +220,7 @@
                     }
                 }
             } else {
-                Log.info("message.debs-like-licenses");
+                Log.info(I18N.getString("message.debs-like-licenses"));
             }
 
             return true;
@@ -480,7 +480,7 @@
 
         //prepare installer icon
         File iconTarget = getConfig_IconFile(params);
-        File icon = ICON.fetchFrom(params);
+        File icon = LinuxAppBundler.ICON_PNG.fetchFrom(params);
         if (icon == null || !icon.exists()) {
             fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX + iconTarget.getName(),
                     I18N.getString("resource.menu-icon"),
@@ -612,7 +612,7 @@
                 DESCRIPTION,
                 EMAIL,
                 FULL_PACKAGE_NAME,
-                ICON,
+                LinuxAppBundler.ICON_PNG,
                 DEB_IMAGE_DIR,
                 IMAGES_ROOT,
                 LICENSE_FILE,
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/LinuxRPMBundler.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/LinuxRPMBundler.java	Tue Apr 15 13:22:04 2014 -0700
@@ -314,7 +314,7 @@
 
         //prepare installer icon
         File iconTarget = getConfig_IconFile(params);
-        File icon = ICON.fetchFrom(params);
+        File icon = LinuxAppBundler.ICON_PNG.fetchFrom(params);
         if (icon == null || !icon.exists()) {
             fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX + iconTarget.getName(),
                     I18N.getString("resource.menu-icon"),
@@ -443,7 +443,7 @@
                 CONFIG_ROOT,
                 CATEGORY,
                 DESCRIPTION,
-                ICON,
+                LinuxAppBundler.ICON_PNG,
                 RPM_IMAGE_DIR,
                 IMAGES_ROOT,
                 LICENSE_FILE,
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/MacAppBundler.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/MacAppBundler.java	Tue Apr 15 13:22:04 2014 -0700
@@ -234,6 +234,20 @@
             },
             (s, p) -> s);
 
+    public static final BundlerParamInfo<File> ICON_ICNS = new StandardBundlerParam<>(
+            I18N.getString("param.icon-icns.name"),
+            I18N.getString("param.icon-icns.description"),
+            "icon.icns",
+            File.class,
+            params -> {
+                File f = ICON.fetchFrom(params);
+                if (f != null && !f.getName().toLowerCase().endsWith(".icns")) {
+                    Log.info(MessageFormat.format(I18N.getString("message.icon-not-icns"), f));
+                    return null;
+                }
+                return f;
+            },
+            (s, p) -> new File(s));
 
     public static RelativeFileSet extractMacRuntime(String base, Map<String, ? super Object> params) {
         if (base.endsWith("/Home")) {
@@ -381,6 +395,7 @@
                 MacBaseInstallerBundler.signAppBundle(p, rootDirectory, signingIdentity, IDENTIFIER.fetchFrom(p) + ".");
             }
         } catch (IOException ex) {
+            Log.info(ex.toString());
             Log.verbose(ex);
             return null;
         } finally {
@@ -442,7 +457,7 @@
     }
 
     private void prepareIcon(Map<String, ? super Object> params) throws IOException {
-        File icon = ICON.fetchFrom(params);
+        File icon = ICON_ICNS.fetchFrom(params);
         if (icon == null || !icon.exists()) {
             fetchResource(MAC_BUNDLER_PREFIX+ APP_NAME.fetchFrom(params) +".icns",
                     "icon",
@@ -616,7 +631,6 @@
                 PREFERENCES_ID,
                 RAW_EXECUTABLE_URL,
                 MAC_RUNTIME,
-                USE_FX_PACKAGING,
                 USER_JVM_OPTIONS,
                 VERSION,
                 ICON,
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/MacDMGBundler.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/MacDMGBundler.java	Tue Apr 15 13:22:04 2014 -0700
@@ -215,7 +215,7 @@
                 VERBOSE.fetchFrom(params));
 
         File iconTarget = getConfig_VolumeIcon(params);
-        if (ICON.fetchFrom(params) == null || !ICON.fetchFrom(params).exists()) {
+        if (MacAppBundler.ICON_ICNS.fetchFrom(params) == null || !MacAppBundler.ICON_ICNS.fetchFrom(params).exists()) {
             fetchResource(com.sun.javafx.tools.packager.bundlers.MacAppBundler.MAC_BUNDLER_PREFIX + iconTarget.getName(),
                     "volume icon",
                     TEMPLATE_BUNDLE_ICON,
@@ -224,7 +224,7 @@
         } else {
             fetchResource(com.sun.javafx.tools.packager.bundlers.MacAppBundler.MAC_BUNDLER_PREFIX + iconTarget.getName(),
                     "volume icon",
-                    ICON.fetchFrom(params),
+                    MacAppBundler.ICON_ICNS.fetchFrom(params),
                     iconTarget,
                     VERBOSE.fetchFrom(params));
         }
@@ -481,7 +481,7 @@
                     if (!appResources.contains(license)) {
                         throw new ConfigException(
                                 I18N.getString("error.license-missing"),
-                                MessageFormat.format(com.sun.imageio.plugins.common.I18N.getString("error.license-missing.advice"),
+                                MessageFormat.format(I18N.getString("error.license-missing.advice"),
                                         license, appResources.getBaseDirectory().toString()));
                     }
                 }
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/WinAppBundler.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/WinAppBundler.java	Tue Apr 15 13:22:04 2014 -0700
@@ -136,6 +136,21 @@
             params -> Boolean.TRUE,
             (s, p) -> Boolean.valueOf(s));
 
+    public static final BundlerParamInfo<File> ICON_ICO = new StandardBundlerParam<>(
+            I18N.getString("param.icon-ico.name"),
+            I18N.getString("param.icon-ico.description"),
+            "icon.ico",
+            File.class,
+            params -> {
+                File f = ICON.fetchFrom(params);
+                if (f != null && !f.getName().toLowerCase().endsWith(".ico")) {
+                    Log.info(MessageFormat.format(I18N.getString("message.icon-not-ico"), f));
+                    return null;
+                }
+                return f;
+            },
+            (s, p) -> new File(s));
+
     public WinAppBundler() {
         super();
         baseResourceLoader = WinResources.class;
@@ -230,7 +245,7 @@
     private void prepareConfigFiles(Map<String, ? super Object> params) throws IOException {
         File iconTarget = getConfig_AppIcon(params);
 
-        File icon = ICON.fetchFrom(params);
+        File icon = ICON_ICO.fetchFrom(params);
         if (icon != null && icon.exists()) {
             fetchResource(WIN_BUNDLER_PREFIX + iconTarget.getName(),
                     I18N.getString("resource.application-icon"),
@@ -442,7 +457,7 @@
                 APP_RESOURCES,
                 BUILD_ROOT,
                 CONFIG_ROOT,
-                ICON,
+                ICON_ICO,
                 IDENTIFIER,
                 JVM_OPTIONS,
                 JVM_PROPERTIES,
@@ -452,7 +467,6 @@
                 PREFERENCES_ID,
                 RAW_EXECUTABLE_URL,
                 WIN_RUNTIME,
-                USE_FX_PACKAGING,
                 USER_JVM_OPTIONS,
                 VERSION
         );
--- a/modules/fxpackager/src/main/resources/com/oracle/bundlers/linux/LinuxAppBundler.properties	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/resources/com/oracle/bundlers/linux/LinuxAppBundler.properties	Tue Apr 15 13:22:04 2014 -0700
@@ -4,6 +4,9 @@
 param.raw-executable-url.name = Launcher URL
 param.raw-executable-url.description = Override the packager default launcher with a custom launcher.
 
+param.icon-png.name = .png Icon
+param.icon-png.description = Icon for the application, in PNG format.
+
 error.parameters-null=Parameters map is null.
 error.parameters-null.advice=Pass in a non-null parameters map.
 error.no-linux-resources=This copy of ant-javafx.jar does not support Linux.
@@ -13,3 +16,4 @@
 
 message.creating-bundle-location=Creating app bundle\: {0}
 message.jvm-user-arg-is-null=WARNING\: a jvmuserarg has a null name or value
+message.icon-not-png= The specified icon "{0}" is not a PNG file and will not be used.  The default icon will be used in it's place.
--- a/modules/fxpackager/src/main/resources/com/oracle/bundlers/linux/LinuxDebBundler.properties	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/resources/com/oracle/bundlers/linux/LinuxDebBundler.properties	Tue Apr 15 13:22:04 2014 -0700
@@ -49,10 +49,11 @@
 error.tool-not-found=Can not find {0}.
 error.tool-not-found.advice=\  Please install required packages.
 error.license-missing=Specified license file is missing.
-error.license-missing.advice=Make sure that {0} references a file in the app resources, and that it is relative to the basedir {1}.
+error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative to the basedir "{1}".
 
 message.test-for-tool=Test for [{0}]. Result\: {1}
 message.debug-working-directory=Kept working directory for debug\: {0}
 message.config-save-location=\  Config files are saved to {0}. Use them to customize package.
 message.outputting-to-location=Generating DEB for installer to\: {0}
 message.output-to-location=Package (.deb) saved to\: {0}
+message.debs-like-licenses=Debian packages should specify a license.  The absence of a license will cause some linux distributions to complain about the quality of the application.
--- a/modules/fxpackager/src/main/resources/com/oracle/bundlers/linux/LinuxRpmBundler.properties	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/resources/com/oracle/bundlers/linux/LinuxRpmBundler.properties	Tue Apr 15 13:22:04 2014 -0700
@@ -23,7 +23,7 @@
 error.cannot-find-rpmbuild=Can not find rpmbuild {0} or newer.
 error.cannot-find-rpmbuild.advice=\  Install packages needed to build RPM, version {0} or newer.
 error.license-missing=Specified license file is missing.
-error.license-missing.advice=Make sure that {0} references a file in the app resources, and that it is relative to the basedir {1}.
+error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative to the basedir "{1}".
 
 message.test-for-tool=Test for [{0}]. Result\: {1}
 message.one-shortcut-required=At least one type of shortcut is required. Enabling menu shortcut.
--- a/modules/fxpackager/src/main/resources/com/oracle/bundlers/mac/MacAppBundler.properties	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/resources/com/oracle/bundlers/mac/MacAppBundler.properties	Tue Apr 15 13:22:04 2014 -0700
@@ -4,6 +4,9 @@
 param.signing-key-developer-id-app.name=Apple Developer ID Application Signing Key
 param.signing-key-developer-id-app.description=The full name of the Apple Developer ID Application signing key.
 
+param.icon-icns.name= .icns Icon
+param.icon-icns.description= Icon for the application, in ICNS format.
+
 param.config-root.name=
 param.config-root.description=
 
@@ -18,3 +21,4 @@
 message.creating-app-bundle=Creating app bundle\: {0}
 message.null-classpath=Null app resources?
 message.preparing-info-plist=Preparing Info.plist\: {0}
+message.icon-not-icns= The specified icon "{0}" is not an ICNS file and will not be used.  The default icon will be used in it's place.
--- a/modules/fxpackager/src/main/resources/com/oracle/bundlers/mac/MacDMGBundler.properties	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/resources/com/oracle/bundlers/mac/MacDMGBundler.properties	Tue Apr 15 13:22:04 2014 -0700
@@ -3,4 +3,4 @@
 error.dmg-does-not-do-daemons=DMG bundler doesn't support services.
 error.dmg-does-not-do-daemons.advice=Make sure that the service hint is set to false.
 error.license-missing=Specified license file is missing.
-error.license-missing.advice=Make sure that {0} references a file in the app resources, and that it is relative to the basedir {1}.
+error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative to the basedir "{1}".
--- a/modules/fxpackager/src/main/resources/com/oracle/bundlers/mac/MacPKGBundler.properties	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/resources/com/oracle/bundlers/mac/MacPKGBundler.properties	Tue Apr 15 13:22:04 2014 -0700
@@ -16,7 +16,7 @@
 error.parameters-null=Parameters map is null.
 error.parameters-null.advice=Pass in a non-null parameters map.
 error.license-missing=Specified license file is missing.
-error.license-missing.advice=Make sure that {0} references a file in the app resources, and that it is relative to the basedir {1}.
+error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative to the basedir "{1}".
 
 message.building-pkg=Building PKG package for {0}
 message.preparing-scripts=Preparing package scripts
--- a/modules/fxpackager/src/main/resources/com/oracle/bundlers/windows/WinAppBundler.properties	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/resources/com/oracle/bundlers/windows/WinAppBundler.properties	Tue Apr 15 13:22:04 2014 -0700
@@ -10,6 +10,9 @@
 param.rebrand-executable.name = Rebrand Launcher
 param.rebrand-executable.description = Update the launcher with the application icon and update ownership information.
 
+param.icon-ico.name = .ico Icon
+param.icon-ico.description = Icon for the application, in ICO format.
+
 resource.application-icon=application icon
 
 error.parameters-null=Parameters map is null.
@@ -26,3 +29,4 @@
 message.config-save-location=\  Config files are saved to {0}. Use them to customize package.
 message.disable-bit-architecture-check=Disabled check for bit architecture mismatch.
 message.jvm-user-arg-is-null=WARNING\: a jvmuserarg has a null name or value
+message.icon-not-ico= The specified icon "{0}" is not an ICO file and will not be used.  The default icon will be used in it's place.
--- a/modules/fxpackager/src/main/resources/com/oracle/bundlers/windows/WinExeBundler.properties	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/resources/com/oracle/bundlers/windows/WinExeBundler.properties	Tue Apr 15 13:22:04 2014 -0700
@@ -31,7 +31,7 @@
 error.iscc-not-found=Can not find Inno Setup Compiler (iscc.exe).
 error.iscc-not-found.advice=\  Download Inno Setup 5 or later from http\://www.jrsoftware.org and add it to the PATH.
 error.license-missing=Specified license file is missing.
-error.license-missing.advice=Make sure that {0} references a file in the app resources, and that it is relative to the basedir {1}.
+error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative to the basedir "{1}".
 
 message.tool-wrong-version=Detected [{0}] version {1} but version {2} is required.
 message.debug-working-directory=Kept working directory for debug\: {0}
--- a/modules/fxpackager/src/main/resources/com/sun/javafx/tools/packager/Bundle.properties	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/main/resources/com/sun/javafx/tools/packager/Bundle.properties	Tue Apr 15 13:22:04 2014 -0700
@@ -201,8 +201,9 @@
 MSG_NoJREPackaged=Package is configured to ship without a JRE.
 MSG_UserProvidedJRE=Using base JDK at\: {0}
 MSG_UseSystemJRE=No base JDK. Package will use system JRE.
+MSG_BundlerFailed=Error: Bundler "{1}" ({0}) failed to produce a bundle.
 MSG_BundlerPlatformException=Bundler {0} skipped because the bundler does not support bundling on this platform.
-MSG_BundlerConfigException=Bundler {0} skipped because of a configuration problem\: {1}\
+MSG_BundlerConfigException=Bundler {0} skipped because of a configuration problem\: {1}  \n\
 Advice to fix\: {2}
 MSG_BundlerConfigExceptionNoAdvice=Bundler {0} skipped because of a configuration problem\: {1}
 MSG_BundlerRuntimeException=Bundler {0} failed because of {1}
--- a/modules/fxpackager/src/test/java/com/oracle/bundlers/linux/LinuxDebBundlerTest.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/test/java/com/oracle/bundlers/linux/LinuxDebBundlerTest.java	Tue Apr 15 13:22:04 2014 -0700
@@ -138,6 +138,7 @@
         bundleParams.put(LICENSE_FILE.getID(), Arrays.asList("LICENSE", "LICENSE2"));
         bundleParams.put(LICENSE_TYPE.getID(), "GPL2 + Classpath Exception");
         bundleParams.put(VERBOSE.getID(), true);
+        bundleParams.put(ICON.getID(), "java-logo2.gif"); // force no signing
 
         boolean valid = bundler.validate(bundleParams);
         assertTrue(valid);
--- a/modules/fxpackager/src/test/java/com/oracle/bundlers/linux/LinuxRpmBundlerTest.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/test/java/com/oracle/bundlers/linux/LinuxRpmBundlerTest.java	Tue Apr 15 13:22:04 2014 -0700
@@ -140,6 +140,7 @@
         bundleParams.put(LICENSE_FILE.getID(), Arrays.asList("LICENSE", "LICENSE2"));
         bundleParams.put(LICENSE_TYPE.getID(), "GPL2 + Classpath Exception");
         bundleParams.put(VERBOSE.getID(), true);
+        bundleParams.put(ICON.getID(), "java-logo2.gif"); // force no signing
 
         boolean valid = bundler.validate(bundleParams);
         assertTrue(valid);
--- a/modules/fxpackager/src/test/java/com/oracle/bundlers/mac/MacAppBundlerTest.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/test/java/com/oracle/bundlers/mac/MacAppBundlerTest.java	Tue Apr 15 13:22:04 2014 -0700
@@ -135,6 +135,7 @@
         bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
         bundleParams.put(VERBOSE.getID(), true);
         bundleParams.put(DEVELOPER_ID_APP_SIGNING_KEY.getID(), null); // force no signing
+        bundleParams.put(ICON.getID(), "java-logo2.gif"); // force no signing
 
         boolean valid = bundler.validate(bundleParams);
         assertTrue(valid);
--- a/modules/fxpackager/src/test/java/com/oracle/bundlers/windows/WinAppBundlerTest.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/test/java/com/oracle/bundlers/windows/WinAppBundlerTest.java	Tue Apr 15 13:22:04 2014 -0700
@@ -133,6 +133,7 @@
         bundleParams.put(MAIN_JAR_CLASSPATH.getID(), fakeMainJar.toString());
         bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
         bundleParams.put(VERBOSE.getID(), true);
+        bundleParams.put(ICON.getID(), "java-logo2.gif"); // force no signing
 
         boolean valid = bundler.validate(bundleParams);
         assertTrue(valid);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/test/resources/com/sun/javafx/tools/ant/BAservicehint.xml	Tue Apr 15 13:22:04 2014 -0700
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project xmlns:fx="javafx:com.sun.javafx.tools.ant" default="fx-deploy">
+    <target name="fx-deploy">
+        <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
+                 uri="javafx:com.sun.javafx.tools.ant"
+                 classpath="../../../../../../../libs/ant-javafx.jar"/>
+        <fx:deploy nativeBundles="deb"
+                   outdir="../../../../../../../tmp/tests/ant"
+                   outfile="test"
+                   verbose="true">
+            <fx:resources id="appRes">
+                <fx:fileset dir="../../../../../../../tmp/tests/appResources"
+                            includes="mainApp.jar"/>
+            </fx:resources>
+
+            <fx:platform/>
+            <fx:preferences/>
+            <fx:application/>
+            <fx:info/>
+            <fx:bundleArgument arg="runAtStartup" value="true"/>
+            <fx:bundleArgument arg="classpath" value="jars/testFxAppWithUtil.jar:jars/Util.jar"/>
+            <fx:bundleArgument arg="serviceHint" value="true"/>
+            <fx:bundleArgument arg="fxPackaging" value="true"/>
+            <fx:bundleArgument arg="mainJar" value="jars/testFxAppWithUtil.jar"/>
+            <fx:bundleArgument arg="startOnInstall" value="true"/>
+        </fx:deploy>
+    </target>
+</project>
--- a/modules/fxpackager/src/test/resources/com/sun/javafx/tools/ant/bundleargs.xml	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/fxpackager/src/test/resources/com/sun/javafx/tools/ant/bundleargs.xml	Tue Apr 15 13:22:04 2014 -0700
@@ -16,7 +16,7 @@
 
         <fx:deploy outdir="../../../../../../../tmp/tests/ant" nativeBundles="image">
 
-            <fx:application refId="rectangle"/>
+            <fx:application refId="packagerTest"/>
 
             <fx:resources refid="appRes"/>
 
Binary file modules/fxpackager/src/test/resources/hello/java-logo2.gif has changed
--- a/modules/graphics/src/main/java/com/sun/glass/ui/mac/MacAccessible.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/mac/MacAccessible.java	Tue Apr 15 13:22:04 2014 -0700
@@ -60,27 +60,27 @@
     private native static boolean _initEnum(String enumName);
     static {
         _initIDs();
-        if (!_initEnum("MacAttributes")) {
-            System.err.println("Fail linking MacAttributes");
+        if (!_initEnum("MacAttribute")) {
+            System.err.println("Fail linking MacAttribute");
         }
-        if (!_initEnum("MacActions")) {
-            System.err.println("Fail linking MacActions");
+        if (!_initEnum("MacAction")) {
+            System.err.println("Fail linking MacAction");
         }
-        if (!_initEnum("MacRoles")) {
-            System.err.println("Fail linking MacRoles");
+        if (!_initEnum("MacRole")) {
+            System.err.println("Fail linking MacRole");
         }
-        if (!_initEnum("MacSubroles")) {
-            System.err.println("Fail linking MacSubroles");
+        if (!_initEnum("MacSubrole")) {
+            System.err.println("Fail linking MacSubrole");
         }
-        if (!_initEnum("MacNotifications")) {
-            System.err.println("Fail linking MacNotifications");
+        if (!_initEnum("MacNotification")) {
+            System.err.println("Fail linking MacNotification");
         }
-        if (!_initEnum("MacOrientations")) {
-            System.err.println("Fail linking MacOrientations");
+        if (!_initEnum("MacOrientation")) {
+            System.err.println("Fail linking MacOrientation");
         }
     }
 
-    enum MacAttributes {
+    static enum MacAttribute {
         // Dynamic mapping to FX attribute, dynamic return type
         NSAccessibilityValueAttribute(null, null),
 
@@ -90,7 +90,7 @@
         NSAccessibilityEnabledAttribute(ENABLED, MacVariant::createNSNumberForBoolean),
         NSAccessibilityHelpAttribute(TOOLTIP, MacVariant::createNSString),
 
-        /* FOCUSED might not match the result of accessibilityFocusedUIElement() cause of FOCUS_ITEM */
+        // FOCUSED might not match the result of accessibilityFocusedUIElement() cause of FOCUS_ITEM 
         NSAccessibilityFocusedAttribute(FOCUSED, MacVariant::createNSNumberForBoolean),
         NSAccessibilityExpandedAttribute(EXPANDED, MacVariant::createNSNumberForBoolean),
         NSAccessibilityMaxValueAttribute(MAX_VALUE, MacVariant::createNSNumberForDouble),
@@ -126,7 +126,7 @@
         NSAccessibilitySelectedTextAttribute(SELECTION_START, MacVariant::createNSString),
         NSAccessibilitySelectedTextRangeAttribute(SELECTION_START, MacVariant::createNSValueForRange),
         NSAccessibilitySelectedTextRangesAttribute(null, null), //TODO Array of ranges
-        NSAccessibilityInsertionPointLineNumberAttribute(SELECTION_START, MacVariant::createNSNumberForInt),
+        NSAccessibilityInsertionPointLineNumberAttribute(CARET_OFFSET, MacVariant::createNSNumberForInt),
         NSAccessibilityVisibleCharacterRangeAttribute(TITLE, MacVariant::createNSValueForRange),
 
         // NSAccessibilityScrollAreaRole
@@ -156,33 +156,32 @@
         NSAccessibilityRowIndexRangeAttribute(ROW_INDEX, MacVariant::createNSValueForRange),
         NSAccessibilityColumnIndexRangeAttribute(COLUMN_INDEX, MacVariant::createNSValueForRange),
 
-        /* Parameterized Attributes */
-        NSAccessibilityLineForIndexParameterizedAttribute(SELECTION_START, MacVariant::createNSNumberForInt, MacVariant.NSNumber_Int),
+        // Parameterized Attributes
+        NSAccessibilityLineForIndexParameterizedAttribute(LINE_FOR_OFFSET, MacVariant::createNSNumberForInt, MacVariant.NSNumber_Int),
         NSAccessibilityStringForRangeParameterizedAttribute(TITLE, MacVariant::createNSString, MacVariant.NSValue_range),
-        NSAccessibilityRangeForLineParameterizedAttribute(TITLE, MacVariant::createNSValueForRange, MacVariant.NSNumber_Int),
+        NSAccessibilityRangeForLineParameterizedAttribute(LINE_START, MacVariant::createNSValueForRange, MacVariant.NSNumber_Int),
         NSAccessibilityAttributedStringForRangeParameterizedAttribute(TITLE, MacVariant::createNSAttributedString, MacVariant.NSValue_range),
         NSAccessibilityCellForColumnAndRowParameterizedAttribute(CELL_AT_ROW_COLUMN, MacVariant::createNSObject, MacVariant.NSArray_int),
-        ;
 
-        long ptr; /* Initialized natively - treat as final */
+        ;long ptr; /* Initialized natively - treat as final */
         Attribute jfxAttr;
         Function<Object, MacVariant> map; /* Maps the object returned by JavaFX to the appropriate MacVariant */
         int inputType; /* Defined only for parameterized attributes to convert the native input parameter (id) to MacVariant */
 
-        MacAttributes(Attribute jfxAttr, Function<Object, MacVariant> map, int inputType) {
+        MacAttribute(Attribute jfxAttr, Function<Object, MacVariant> map, int inputType) {
             this.jfxAttr = jfxAttr;
             this.map = map;
             this.inputType = inputType;
         }
 
-        MacAttributes(Attribute jfxAttr, Function<Object, MacVariant> map) {
+        MacAttribute(Attribute jfxAttr, Function<Object, MacVariant> map) {
             this.jfxAttr = jfxAttr;
             this.map = map;
         }
 
-        static MacAttributes getAttribute(long ptr) {
+        static MacAttribute getAttribute(long ptr) {
             if (ptr == 0) return null;
-            for (MacAttributes attr : values()) {
+            for (MacAttribute attr : values()) {
                 if (ptr == attr.ptr || isEqualToString(attr.ptr, ptr)) {
                     return attr;
                 }
@@ -195,305 +194,271 @@
      * The Attribute and Action for roles are defined in
      * https://developer.apple.com/library/mac/documentation/UserExperience/Reference/Accessibility_RoleAttribute_Ref/Introduction.html
      */
-    enum MacRoles {
+    static enum MacRole {
         NSAccessibilityUnknownRole(Role.NODE, null, null),
         NSAccessibilityGroupRole(Role.PARENT, null, null),
         NSAccessibilityButtonRole(new Role[] {Role.BUTTON, Role.INCREMENT_BUTTON, Role.DECREMENT_BUTTON, Role.HEADER, Role.SPLIT_MENU_BUTTON},
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityEnabledAttribute,
-                MacAttributes.NSAccessibilityTitleAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityEnabledAttribute,
+                MacAttribute.NSAccessibilityTitleAttribute,
             },
-            new MacActions[] {MacActions.NSAccessibilityPressAction},
+            new MacAction[] {MacAction.NSAccessibilityPressAction},
             null
         ),
         NSAccessibilityImageRole(Role.IMAGE, null, null),
         NSAccessibilityRadioButtonRole(new Role[] {Role.RADIO_BUTTON, Role.TAB_ITEM, Role.PAGE},
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityEnabledAttribute,
-                MacAttributes.NSAccessibilityTitleAttribute,
-                MacAttributes.NSAccessibilityValueAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityEnabledAttribute,
+                MacAttribute.NSAccessibilityTitleAttribute,
+                MacAttribute.NSAccessibilityValueAttribute,
             },
-            new MacActions[] {MacActions.NSAccessibilityPressAction},
+            new MacAction[] {MacAction.NSAccessibilityPressAction},
             null
         ),
         NSAccessibilityCheckBoxRole(new Role[] {Role.CHECKBOX, Role.TOGGLE_BUTTON},
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityEnabledAttribute,
-                MacAttributes.NSAccessibilityTitleAttribute,
-                MacAttributes.NSAccessibilityValueAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityEnabledAttribute,
+                MacAttribute.NSAccessibilityTitleAttribute,
+                MacAttribute.NSAccessibilityValueAttribute,
             },
-            new MacActions[] {MacActions.NSAccessibilityPressAction},
+            new MacAction[] {MacAction.NSAccessibilityPressAction},
             null
         ),
-
-        NSAccessibilityPopUpButtonRole(new Role[] {Role.COMBOBOX},
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityEnabledAttribute,
-                MacAttributes.NSAccessibilityValueAttribute,
+        /* ComboBox can be either a NSAccessibilityComboBoxRole or a NSAccessibilityPopUpButtonRole (Based on EDITABLE) */
+        NSAccessibilityComboBoxRole(Role.COMBOBOX,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityExpandedAttribute
             },
-            new MacActions[] {MacActions.NSAccessibilityPressAction},
-            null
+            new MacAction[] {MacAction.NSAccessibilityPressAction}
+        ),
+        NSAccessibilityPopUpButtonRole(Role.COMBOBOX,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityEnabledAttribute,
+                MacAttribute.NSAccessibilityValueAttribute,
+            },
+            new MacAction[] {MacAction.NSAccessibilityPressAction}
         ),
         NSAccessibilityTabGroupRole(new Role[] {Role.TAB_PANE, Role.PAGINATION},
-            new MacAttributes[] {
+            new MacAttribute[] {
 //              MacAttributes.NSAccessibilityContentsAttribute,
-                MacAttributes.NSAccessibilityTabsAttribute,
-                MacAttributes.NSAccessibilityValueAttribute,
+                MacAttribute.NSAccessibilityTabsAttribute,
+                MacAttribute.NSAccessibilityValueAttribute,
             },
             null,
             null
         ),
+        /* ProgressIndicator can be either a ProgressIndicatorRole or a BusyIndicatorRole (Based on INDETERMINATE) */
         NSAccessibilityProgressIndicatorRole(Role.PROGRESS_INDICATOR,
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityOrientationAttribute,
-                MacAttributes.NSAccessibilityValueAttribute,
-                MacAttributes.NSAccessibilityMaxValueAttribute,
-                MacAttributes.NSAccessibilityMinValueAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityOrientationAttribute,
+                MacAttribute.NSAccessibilityValueAttribute,
+                MacAttribute.NSAccessibilityMaxValueAttribute,
+                MacAttribute.NSAccessibilityMinValueAttribute,
+            },
+            null
+        ),
+        NSAccessibilityBusyIndicatorRole(Role.PROGRESS_INDICATOR,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityOrientationAttribute,
+                MacAttribute.NSAccessibilityValueAttribute,
             },
             null
         ),
         NSAccessibilityMenuBarRole(Role.MENU_BAR,
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilitySelectedChildrenAttribute,
-                MacAttributes.NSAccessibilityEnabledAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilitySelectedChildrenAttribute,
+                MacAttribute.NSAccessibilityEnabledAttribute,
             },
-            new MacActions[] {
-                MacActions.NSAccessibilityCancelAction,
+            new MacAction[] {
+                MacAction.NSAccessibilityCancelAction,
             }
         ),
         NSAccessibilityMenuRole(Role.CONTEXT_MENU,
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilitySelectedChildrenAttribute,
-                MacAttributes.NSAccessibilityEnabledAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilitySelectedChildrenAttribute,
+                MacAttribute.NSAccessibilityEnabledAttribute,
             },
-            new MacActions[] {
-                MacActions.NSAccessibilityPressAction,
-                MacActions.NSAccessibilityCancelAction,
+            new MacAction[] {
+                MacAction.NSAccessibilityPressAction,
+                MacAction.NSAccessibilityCancelAction,
             }
         ),
         NSAccessibilityMenuItemRole(Role.MENU_ITEM,
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityEnabledAttribute,
-                MacAttributes.NSAccessibilityTitleAttribute,
-                MacAttributes.NSAccessibilitySelectedAttribute,
-                MacAttributes.AXMenuItemCmdChar,
-                MacAttributes.AXMenuItemCmdVirtualKey,
-                MacAttributes.AXMenuItemCmdGlyph,
-                MacAttributes.AXMenuItemCmdModifiers,
-                MacAttributes.AXMenuItemMarkChar,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityEnabledAttribute,
+                MacAttribute.NSAccessibilityTitleAttribute,
+                MacAttribute.NSAccessibilitySelectedAttribute,
+                MacAttribute.AXMenuItemCmdChar,
+                MacAttribute.AXMenuItemCmdVirtualKey,
+                MacAttribute.AXMenuItemCmdGlyph,
+                MacAttribute.AXMenuItemCmdModifiers,
+                MacAttribute.AXMenuItemMarkChar,
             },
-            new MacActions[] {
-                MacActions.NSAccessibilityPressAction,
-                MacActions.NSAccessibilityCancelAction,
+            new MacAction[] {
+                MacAction.NSAccessibilityPressAction,
+                MacAction.NSAccessibilityCancelAction,
             }
         ),
         NSAccessibilityMenuButtonRole(Role.MENU_BUTTON,
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityEnabledAttribute,
-                MacAttributes.NSAccessibilityTitleAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityEnabledAttribute,
+                MacAttribute.NSAccessibilityTitleAttribute,
             },
-            new MacActions[] {
-                MacActions.NSAccessibilityPressAction,
+            new MacAction[] {
+                MacAction.NSAccessibilityPressAction,
             }
         ),
-        /* 
-         * ProgressIndicator can be either a ProgressIndicatorRole or a BusyIndicatorRole.
-         * Depending on the state of the indeterminate property.
-         * Only in NSAccessibilityRoleAttribute and NSAccessibilityRoleDescriptionAttribute
-         * the correct adjustments are made, on all other method BusyIndicatorRole reply 
-         * as a ProgressIndicatorRole.
-         */
-        NSAccessibilityBusyIndicatorRole(Role.PROGRESS_INDICATOR, null, null),
         NSAccessibilityStaticTextRole(new Role[] {Role.TEXT, Role.TREE_TABLE_CELL},
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityEnabledAttribute,
-                MacAttributes.NSAccessibilityValueAttribute,
-                MacAttributes.NSAccessibilityNumberOfCharactersAttribute,
-                MacAttributes.NSAccessibilitySelectedTextAttribute,
-                MacAttributes.NSAccessibilitySelectedTextRangeAttribute,
-                MacAttributes.NSAccessibilityInsertionPointLineNumberAttribute,
-                MacAttributes.NSAccessibilityVisibleCharacterRangeAttribute,
-            },
-            null,
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityLineForIndexParameterizedAttribute,
-                MacAttributes.NSAccessibilityRangeForLineParameterizedAttribute,
-                MacAttributes.NSAccessibilityAttributedStringForRangeParameterizedAttribute,
-                MacAttributes.NSAccessibilityStringForRangeParameterizedAttribute,
-            }
+            null, null, null
         ),
         NSAccessibilityTextFieldRole(new Role[] {Role.TEXT_FIELD, Role.PASSWORD_FIELD},
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityEnabledAttribute,
-                MacAttributes.NSAccessibilityValueAttribute,
-                MacAttributes.NSAccessibilityNumberOfCharactersAttribute,
-                MacAttributes.NSAccessibilitySelectedTextAttribute,
-                MacAttributes.NSAccessibilitySelectedTextRangeAttribute,
-                MacAttributes.NSAccessibilityInsertionPointLineNumberAttribute,
-                MacAttributes.NSAccessibilityVisibleCharacterRangeAttribute,
+            null, null, null
+        ),
+        NSAccessibilityTextAreaRole(Role.TEXT_AREA, null, null),
+        NSAccessibilitySliderRole(Role.SLIDER,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityEnabledAttribute,
+                MacAttribute.NSAccessibilityOrientationAttribute,
+                MacAttribute.NSAccessibilityValueAttribute,
+                MacAttribute.NSAccessibilityMaxValueAttribute,
+                MacAttribute.NSAccessibilityMinValueAttribute,
             },
-            null,
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityLineForIndexParameterizedAttribute,
-                MacAttributes.NSAccessibilityRangeForLineParameterizedAttribute,
-                MacAttributes.NSAccessibilityAttributedStringForRangeParameterizedAttribute,
-                MacAttributes.NSAccessibilityStringForRangeParameterizedAttribute,
-            }
-        ),
-        NSAccessibilityTextAreaRole(Role.TEXT_AREA,
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityValueAttribute,
-                MacAttributes.NSAccessibilityNumberOfCharactersAttribute,
-                MacAttributes.NSAccessibilitySelectedTextAttribute,
-                MacAttributes.NSAccessibilitySelectedTextRangeAttribute,
-            },
-            null
-        ),
-        NSAccessibilitySliderRole(Role.SLIDER,
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityEnabledAttribute,
-                MacAttributes.NSAccessibilityOrientationAttribute,
-                MacAttributes.NSAccessibilityValueAttribute,
-                MacAttributes.NSAccessibilityMaxValueAttribute,
-                MacAttributes.NSAccessibilityMinValueAttribute,
-            },
-            new MacActions[] {
-                MacActions.NSAccessibilityDecrementAction,
-                MacActions.NSAccessibilityIncrementAction,
+            new MacAction[] {
+                MacAction.NSAccessibilityDecrementAction,
+                MacAction.NSAccessibilityIncrementAction,
             }
         ),
         NSAccessibilityScrollAreaRole(Role.SCROLL_PANE,
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityContentsAttribute,
-                MacAttributes.NSAccessibilityHorizontalScrollBarAttribute,
-                MacAttributes.NSAccessibilityVerticalScrollBarAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityContentsAttribute,
+                MacAttribute.NSAccessibilityHorizontalScrollBarAttribute,
+                MacAttribute.NSAccessibilityVerticalScrollBarAttribute,
             },
             null
         ),
         NSAccessibilityScrollBarRole(Role.SCROLL_BAR,
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityValueAttribute,
-                MacAttributes.NSAccessibilityMinValueAttribute,
-                MacAttributes.NSAccessibilityMaxValueAttribute,
-                MacAttributes.NSAccessibilityEnabledAttribute,
-                MacAttributes.NSAccessibilityOrientationAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityValueAttribute,
+                MacAttribute.NSAccessibilityMinValueAttribute,
+                MacAttribute.NSAccessibilityMaxValueAttribute,
+                MacAttribute.NSAccessibilityEnabledAttribute,
+                MacAttribute.NSAccessibilityOrientationAttribute,
             },
             null
         ),
         NSAccessibilityValueIndicatorRole(Role.THUMB,
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityValueAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityValueAttribute,
             },
             null
         ),
         NSAccessibilityRowRole(new Role[] {Role.LIST_ITEM, Role.TABLE_ROW, Role.TREE_ITEM, Role.TREE_TABLE_ITEM},
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilitySubroleAttribute,
-                MacAttributes.NSAccessibilityIndexAttribute,
-                MacAttributes.NSAccessibilitySelectedAttribute,
-                MacAttributes.NSAccessibilityVisibleChildrenAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilitySubroleAttribute,
+                MacAttribute.NSAccessibilityIndexAttribute,
+                MacAttribute.NSAccessibilitySelectedAttribute,
+                MacAttribute.NSAccessibilityVisibleChildrenAttribute,
             },
             null, null
         ),
         NSAccessibilityTableRole(new Role[] {Role.LIST_VIEW, Role.TABLE_VIEW},
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityEnabledAttribute,
-                MacAttributes.NSAccessibilityColumnsAttribute,
-                MacAttributes.NSAccessibilityHeaderAttribute,
-                MacAttributes.NSAccessibilityRowsAttribute,
-                MacAttributes.NSAccessibilitySelectedRowsAttribute,
-                MacAttributes.NSAccessibilityRowCountAttribute,
-                MacAttributes.NSAccessibilityColumnCountAttribute,
-                MacAttributes.NSAccessibilitySelectedCellsAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityEnabledAttribute,
+                MacAttribute.NSAccessibilityColumnsAttribute,
+                MacAttribute.NSAccessibilityHeaderAttribute,
+                MacAttribute.NSAccessibilityRowsAttribute,
+                MacAttribute.NSAccessibilitySelectedRowsAttribute,
+                MacAttribute.NSAccessibilityRowCountAttribute,
+                MacAttribute.NSAccessibilityColumnCountAttribute,
+                MacAttribute.NSAccessibilitySelectedCellsAttribute,
             },
             null,
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityCellForColumnAndRowParameterizedAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityCellForColumnAndRowParameterizedAttribute,
             }
         ),
         NSAccessibilityColumnRole(Role.TABLE_COLUMN,
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityHeaderAttribute,
-                MacAttributes.NSAccessibilityIndexAttribute,
-                MacAttributes.NSAccessibilityRowsAttribute,
-                MacAttributes.NSAccessibilitySelectedAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityHeaderAttribute,
+                MacAttribute.NSAccessibilityIndexAttribute,
+                MacAttribute.NSAccessibilityRowsAttribute,
+                MacAttribute.NSAccessibilitySelectedAttribute,
             },
             null
         ),
         NSAccessibilityCellRole(new Role[] {Role.TABLE_CELL},
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityColumnIndexRangeAttribute,
-                MacAttributes.NSAccessibilityEnabledAttribute,
-                MacAttributes.NSAccessibilityRowIndexRangeAttribute,
-                MacAttributes.NSAccessibilitySelectedAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityColumnIndexRangeAttribute,
+                MacAttribute.NSAccessibilityEnabledAttribute,
+                MacAttribute.NSAccessibilityRowIndexRangeAttribute,
+                MacAttribute.NSAccessibilitySelectedAttribute,
             },
             null,
             null
         ),
         NSAccessibilityLinkRole(Role.HYPERLINK,
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityEnabledAttribute,
-                MacAttributes.AXVisited
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityEnabledAttribute,
+                MacAttribute.AXVisited
             },
             null
         ),
         NSAccessibilityOutlineRole(new Role[] {Role.TREE_VIEW, Role.TREE_TABLE_VIEW},
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityColumnsAttribute,
-                MacAttributes.NSAccessibilityEnabledAttribute,
-                MacAttributes.NSAccessibilityHeaderAttribute,
-                MacAttributes.NSAccessibilityRowsAttribute,
-                MacAttributes.NSAccessibilitySelectedRowsAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityColumnsAttribute,
+                MacAttribute.NSAccessibilityEnabledAttribute,
+                MacAttribute.NSAccessibilityHeaderAttribute,
+                MacAttribute.NSAccessibilityRowsAttribute,
+                MacAttribute.NSAccessibilitySelectedRowsAttribute,
             },
             null,
             null
         ),
         NSAccessibilityDisclosureTriangleRole(new Role[] {Role.DISCLOSURE_NODE, Role.TITLED_PANE},
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityEnabledAttribute,
-                MacAttributes.NSAccessibilityValueAttribute
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityEnabledAttribute,
+                MacAttribute.NSAccessibilityValueAttribute
             },
-            new MacActions[] {
-                MacActions.NSAccessibilityPressAction
+            new MacAction[] {
+                MacAction.NSAccessibilityPressAction
             },
             null
         ),
         NSAccessibilityToolbarRole(Role.TOOLBAR,
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityEnabledAttribute,
-                MacAttributes.NSAccessibilityOverflowButtonAttribute,
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityEnabledAttribute,
+                MacAttribute.NSAccessibilityOverflowButtonAttribute,
             },
             null
         ),
         AXDateTimeArea(Role.DATE_PICKER,
-                new MacAttributes[] {
-                    MacAttributes.NSAccessibilityEnabledAttribute,
-                    MacAttributes.NSAccessibilityValueAttribute,
-                    MacAttributes.AXDateTimeComponents,
-                },
-                null
-            ),
-        ;
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityEnabledAttribute,
+                MacAttribute.NSAccessibilityValueAttribute,
+                MacAttribute.AXDateTimeComponents,
+            },
+            null
+        ),
 
-        long ptr; /* Initialized natively - treat as final */
+        ;long ptr; /* Initialized natively - treat as final */
         Role[] jfxRoles;
-        List<MacAttributes> macAttributes;
-        List<MacAttributes> macParameterizedAttributes;
-        List<MacActions> macActions;
-        MacRoles(Role jfxRole, MacAttributes[] macAttributes, MacActions[] macActions) {
+        List<MacAttribute> macAttributes;
+        List<MacAttribute> macParameterizedAttributes;
+        List<MacAction> macActions;
+        MacRole(Role jfxRole, MacAttribute[] macAttributes, MacAction[] macActions) {
             this(new Role[] {jfxRole}, macAttributes, macActions, null);
         }
 
-        MacRoles(Role[] jfxRoles, MacAttributes[] macAttributes, MacActions[] macActions, MacAttributes[] macParameterizedAttributes) {
+        MacRole(Role[] jfxRoles, MacAttribute[] macAttributes, MacAction[] macActions, MacAttribute[] macParameterizedAttributes) {
             this.jfxRoles = jfxRoles;
             this.macAttributes = macAttributes != null ? Arrays.asList(macAttributes) : null;
             this.macActions = macActions != null ? Arrays.asList(macActions) : null;
             this.macParameterizedAttributes = macParameterizedAttributes != null ? Arrays.asList(macParameterizedAttributes) : null;
         }
 
-        static MacRoles getRole(Role targetRole) {
+        static MacRole getRole(Role targetRole) {
             if (targetRole == null) return null;
-            for (MacRoles macRole : values()) {
+            for (MacRole macRole : values()) {
                 for (Role jfxRole : macRole.jfxRoles) {
                     if (jfxRole == targetRole) {
                         return macRole;
@@ -504,46 +469,45 @@
         }
     }
 
-    enum MacSubroles {
+    static enum MacSubrole {
         NSAccessibilityTableRowSubrole(Role.LIST_ITEM, Role.TABLE_ROW),
         NSAccessibilitySortButtonSubrole(Role.HEADER),
         NSAccessibilitySecureTextFieldSubrole(Role.PASSWORD_FIELD),
         NSAccessibilityOutlineRowSubrole(new Role[] { Role.TREE_ITEM, Role.TREE_TABLE_ITEM },
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilityDisclosedByRowAttribute,
-                MacAttributes.NSAccessibilityDisclosedRowsAttribute,
-                MacAttributes.NSAccessibilityDisclosingAttribute,
-                MacAttributes.NSAccessibilityDisclosureLevelAttribute
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilityDisclosedByRowAttribute,
+                MacAttribute.NSAccessibilityDisclosedRowsAttribute,
+                MacAttribute.NSAccessibilityDisclosingAttribute,
+                MacAttribute.NSAccessibilityDisclosureLevelAttribute
             }
         ),
         NSAccessibilityDecrementArrowSubrole(new Role[] { Role.DECREMENT_BUTTON },
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilitySubroleAttribute
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilitySubroleAttribute
             }
         ),
         NSAccessibilityIncrementArrowSubrole(new Role[] { Role.INCREMENT_BUTTON },
-            new MacAttributes[] {
-                MacAttributes.NSAccessibilitySubroleAttribute
+            new MacAttribute[] {
+                MacAttribute.NSAccessibilitySubroleAttribute
             }
         )
-        ;
 
-        long ptr; /* Initialized natively - treat as final */
+        ;long ptr; /* Initialized natively - treat as final */
         Role[] jfxRoles;
-        List<MacAttributes> macAttributes;
+        List<MacAttribute> macAttributes;
 
-        MacSubroles(Role... jfxRoles) {
+        MacSubrole(Role... jfxRoles) {
             this(jfxRoles, null);
         }
 
-        MacSubroles(Role[] jfxRoles, MacAttributes[] macAttributes) {
+        MacSubrole(Role[] jfxRoles, MacAttribute[] macAttributes) {
             this.jfxRoles = jfxRoles;
             this.macAttributes = macAttributes != null ? Arrays.asList(macAttributes) : null;
         }
 
-        static MacSubroles getRole(Role targetRole) {
+        static MacSubrole getRole(Role targetRole) {
             if (targetRole == null) return null;
-            for (MacSubroles macRole : values()) {
+            for (MacSubrole macRole : values()) {
                 for (Role jfxRole : macRole.jfxRoles) {
                     if (jfxRole == targetRole) {
                         return macRole;
@@ -554,7 +518,7 @@
         }
     }
 
-    enum MacActions {
+    static enum MacAction {
         NSAccessibilityCancelAction,
         NSAccessibilityConfirmAction,
         NSAccessibilityDecrementAction(Action.DECREMENT),
@@ -563,17 +527,17 @@
         NSAccessibilityPickAction,
         NSAccessibilityPressAction(Action.FIRE),
         NSAccessibilityRaiseAction,
-        NSAccessibilityShowMenuAction(Action.SHOW_MENU);
+        NSAccessibilityShowMenuAction(Action.SHOW_MENU),
 
-        long ptr; /* Initialized natively - treat as final */
+        ;long ptr; /* Initialized natively - treat as final */
         Action jfxAction;
-        MacActions() {}
-        MacActions(Action jfxAction) {
+        MacAction() {}
+        MacAction(Action jfxAction) {
             this.jfxAction = jfxAction;
         }
 
-        static MacActions getAction(long ptr) {
-            for (MacActions macAction : MacActions.values()) {
+        static MacAction getAction(long ptr) {
+            for (MacAction macAction : MacAction.values()) {
                 if (macAction.ptr == ptr || isEqualToString(macAction.ptr, ptr)) {
                     return macAction;
                 }
@@ -582,7 +546,7 @@
         }
     }
 
-    enum MacNotifications {
+    static enum MacNotification {
         NSAccessibilityCreatedNotification,
         NSAccessibilityFocusedUIElementChangedNotification,
         NSAccessibilityValueChangedNotification,
@@ -597,28 +561,48 @@
         NSAccessibilityRowCollapsedNotification,
         AXMenuOpened,
         AXMenuClosed,
-        ;long ptr;
+        ;long ptr; /* Initialized natively - treat as final */
     }
 
-    enum MacOrientations {
+    static enum MacOrientation {
         NSAccessibilityHorizontalOrientationValue,
         NSAccessibilityVerticalOrientationValue,
-        NSAccessibilityUnknownOrientationValue;
-        long ptr;
+        NSAccessibilityUnknownOrientationValue,
+        ;long ptr; /* Initialized natively - treat as final */
     }
 
-    List<MacAttributes> baseAttributes = Arrays.asList(
-        MacAttributes.NSAccessibilityRoleAttribute,
-        MacAttributes.NSAccessibilityRoleDescriptionAttribute,
-        MacAttributes.NSAccessibilityHelpAttribute,
-        MacAttributes.NSAccessibilityFocusedAttribute,
-        MacAttributes.NSAccessibilityParentAttribute,
-        MacAttributes.NSAccessibilityChildrenAttribute,
-        MacAttributes.NSAccessibilityPositionAttribute,
-        MacAttributes.NSAccessibilitySizeAttribute,
-        MacAttributes.NSAccessibilityWindowAttribute,
-        MacAttributes.NSAccessibilityTopLevelUIElementAttribute,
-        MacAttributes.NSAccessibilityTitleUIElementAttribute
+    /* Do not access the following lists directly from the Mac enums.
+     * It can cause the static initialization to happen in an unexpected order.
+     */
+    static final List<MacAttribute> baseAttributes = Arrays.asList(
+        MacAttribute.NSAccessibilityRoleAttribute,
+        MacAttribute.NSAccessibilityRoleDescriptionAttribute,
+        MacAttribute.NSAccessibilityHelpAttribute,
+        MacAttribute.NSAccessibilityFocusedAttribute,
+        MacAttribute.NSAccessibilityParentAttribute,
+        MacAttribute.NSAccessibilityChildrenAttribute,
+        MacAttribute.NSAccessibilityPositionAttribute,
+        MacAttribute.NSAccessibilitySizeAttribute,
+        MacAttribute.NSAccessibilityWindowAttribute,
+        MacAttribute.NSAccessibilityTopLevelUIElementAttribute,
+        MacAttribute.NSAccessibilityTitleUIElementAttribute
+    );
+
+    static final List<MacAttribute> textAttributes = Arrays.asList(
+        MacAttribute.NSAccessibilityEnabledAttribute,
+        MacAttribute.NSAccessibilityValueAttribute,
+        MacAttribute.NSAccessibilityNumberOfCharactersAttribute,
+        MacAttribute.NSAccessibilitySelectedTextAttribute,
+        MacAttribute.NSAccessibilitySelectedTextRangeAttribute,
+        MacAttribute.NSAccessibilityInsertionPointLineNumberAttribute,
+        MacAttribute.NSAccessibilityVisibleCharacterRangeAttribute
+    );
+
+    static final List<MacAttribute> textParameterizedAttributes = Arrays.asList(
+        MacAttribute.NSAccessibilityLineForIndexParameterizedAttribute,
+        MacAttribute.NSAccessibilityRangeForLineParameterizedAttribute,
+        MacAttribute.NSAccessibilityAttributedStringForRangeParameterizedAttribute,
+        MacAttribute.NSAccessibilityStringForRangeParameterizedAttribute
     );
 
     /* The native peer associated with the instance */
@@ -661,7 +645,7 @@
     public void dispose() {
         if (peer != 0L) {
             if (getView() == null) {
-                NSAccessibilityPostNotification(peer, MacNotifications.NSAccessibilityUIElementDestroyedNotification.ptr);
+                NSAccessibilityPostNotification(peer, MacNotification.NSAccessibilityUIElementDestroyedNotification.ptr);
             }
             _destroyGlassAccessible(peer);
             peer = 0L;
@@ -673,22 +657,22 @@
     public void sendNotification(Attribute notification) {
         if (isDisposed()) return;
 
-        MacNotifications macNotification = null;
+        MacNotification macNotification = null;
         switch (notification) {
             case SELECTED_TAB:
             case SELECTED_PAGE: {
                 View view = getRootView((Scene)getAttribute(SCENE));
                 if (view != null) {
                     long id = view.getNativeView();
-                    NSAccessibilityPostNotification(id, MacNotifications.NSAccessibilityFocusedUIElementChangedNotification.ptr);
+                    NSAccessibilityPostNotification(id, MacNotification.NSAccessibilityFocusedUIElementChangedNotification.ptr);
                 }
                 return;
             }
             case SELECTED_ROWS:
-                macNotification = MacNotifications.NSAccessibilitySelectedRowsChangedNotification;
+                macNotification = MacNotification.NSAccessibilitySelectedRowsChangedNotification;
                 break;
             case SELECTED_CELLS:
-                macNotification = MacNotifications.NSAccessibilitySelectedCellsChangedNotification;
+                macNotification = MacNotification.NSAccessibilitySelectedCellsChangedNotification;
                 break;
             case FOCUS_NODE: {
                 Node node = (Node)getAttribute(FOCUS_NODE);
@@ -720,7 +704,7 @@
                 }
 
                 if (id != 0) {
-                    NSAccessibilityPostNotification(id, MacNotifications.NSAccessibilityFocusedUIElementChangedNotification.ptr);
+                    NSAccessibilityPostNotification(id, MacNotification.NSAccessibilityFocusedUIElementChangedNotification.ptr);
                 }
                 return;
             }
@@ -728,14 +712,14 @@
                 return;
             case SELECTION_START:
             case SELECTION_END:
-                macNotification = MacNotifications.NSAccessibilitySelectedTextChangedNotification;
+                macNotification = MacNotification.NSAccessibilitySelectedTextChangedNotification;
                 break;
             case EXPANDED:
                 boolean expanded = Boolean.TRUE.equals(getAttribute(EXPANDED));
                 if (expanded) {
-                    macNotification = MacNotifications.NSAccessibilityRowExpandedNotification;
+                    macNotification = MacNotification.NSAccessibilityRowExpandedNotification;
                 } else {
-                    macNotification = MacNotifications.NSAccessibilityRowCollapsedNotification;
+                    macNotification = MacNotification.NSAccessibilityRowCollapsedNotification;
                 }
 
                 Role role = (Role) getAttribute(ROLE);
@@ -743,7 +727,7 @@
                     Role container = role == Role.TREE_ITEM ? Role.TREE_VIEW : Role.TREE_TABLE_VIEW;
                     long control = getAccessible(getContainerNode(container));
                     if (control != 0) {
-                        NSAccessibilityPostNotification(control, MacNotifications.NSAccessibilityRowCountChangedNotification.ptr);
+                        NSAccessibilityPostNotification(control, MacNotification.NSAccessibilityRowCountChangedNotification.ptr);
                     }
                 }
                 break;
@@ -751,9 +735,9 @@
                 if (getAttribute(ROLE) == Role.CONTEXT_MENU) {
                     Boolean visible = (Boolean)getAttribute(VISIBLE);
                     if (Boolean.TRUE.equals(visible)) {
-                        macNotification = MacNotifications.AXMenuOpened;
+                        macNotification = MacNotification.AXMenuOpened;
                     } else {
-                        macNotification = MacNotifications.AXMenuClosed;
+                        macNotification = MacNotification.AXMenuClosed;
 
                         /* When a submenu closes the focus is returned to the main
                          * window, as opposite of the previous menu.
@@ -763,15 +747,15 @@
                         Node menuItemOwner = (Node)getAttribute(MENU_FOR);
                         long menu = getAccessible(getContainerNode(menuItemOwner, Role.CONTEXT_MENU));
                         if (menu != 0) {
-                            NSAccessibilityPostNotification(menu, MacNotifications.AXMenuClosed.ptr);
-                            NSAccessibilityPostNotification(menu, MacNotifications.AXMenuOpened.ptr);
+                            NSAccessibilityPostNotification(menu, MacNotification.AXMenuClosed.ptr);
+                            NSAccessibilityPostNotification(menu, MacNotification.AXMenuOpened.ptr);
                         }
                     }
                 }
                 break;
             }
             default:
-                macNotification = MacNotifications.NSAccessibilityValueChangedNotification;
+                macNotification = MacNotification.NSAccessibilityValueChangedNotification;
         }
         if (macNotification != null) {
             View view = getView();
@@ -862,41 +846,70 @@
         return code.isLetterKey() || (code.isDigitKey() && !code.isKeypadKey());
     }
 
+    private MacRole getRole(Role role) {
+        if (role == Role.COMBOBOX) {
+            if (Boolean.TRUE.equals(getAttribute(EDITABLE))) {
+                return MacRole.NSAccessibilityComboBoxRole;
+            } else {
+                return MacRole.NSAccessibilityPopUpButtonRole;
+            }
+        }
+        MacRole macRole = MacRole.getRole(role);
+        if (macRole == MacRole.NSAccessibilityProgressIndicatorRole) {
+            Boolean state = (Boolean)getAttribute(INDETERMINATE);
+            if (Boolean.TRUE.equals(state)) {
+                macRole = MacRole.NSAccessibilityBusyIndicatorRole;
+            }
+        }
+        return macRole;
+    }
+
     /* NSAccessibility Protocol - JNI entry points */
     long[] accessibilityAttributeNames() {
         if (getView() != null) return null; /* Let NSView answer for the Scene */
         Role role = (Role)getAttribute(ROLE);
         if (role != null) {
-            List<MacAttributes> attrs = new ArrayList<>(baseAttributes);
-            MacRoles macRole = MacRoles.getRole(role);
+            List<MacAttribute> attrs = new ArrayList<>(baseAttributes);
+            MacRole macRole = getRole(role);
             if (macRole != null && macRole.macAttributes != null) {
                 attrs.addAll(macRole.macAttributes);
             }
 
             /* Look to see if there is a subrole that we should also get the attributes of */
-            MacSubroles macSubrole = MacSubroles.getRole(role);
+            MacSubrole macSubrole = MacSubrole.getRole(role);
             if (macSubrole != null && macSubrole.macAttributes != null) {
                 attrs.addAll(macSubrole.macAttributes);
             }
 
-            /* ListView is row-based, must remove all the cell-based attributes */
-            if (role == Role.LIST_VIEW || role == Role.TREE_TABLE_VIEW) {
-                attrs.remove(MacAttributes.NSAccessibilitySelectedCellsAttribute);
+            switch (role) {
+                case LIST_VIEW:
+                case TREE_TABLE_VIEW:
+                    /* ListView is row-based, must remove all the cell-based attributes */
+                    attrs.remove(MacAttribute.NSAccessibilitySelectedCellsAttribute);
+                    break;
+                case CONTEXT_MENU:
+                case MENU_ITEM:
+                case MENU_BAR:
+                    /* Menu and MenuItem do have have Window and top-level UI Element*/
+                    attrs.remove(MacAttribute.NSAccessibilityWindowAttribute);
+                    attrs.remove(MacAttribute.NSAccessibilityTopLevelUIElementAttribute);
+                    break;
+                case TEXT:
+                case TEXT_FIELD:
+                case TEXT_AREA:
+                case PASSWORD_FIELD:
+                case COMBOBOX:
+                    attrs.addAll(textAttributes);
+                    break;
+                default:
             }
-
-            /* Menu and MenuItem do have have Window and top-level UI Element*/
-            if (role == Role.CONTEXT_MENU || role == Role.MENU_ITEM || role == Role.MENU_BAR) {
-                attrs.remove(MacAttributes.NSAccessibilityWindowAttribute);
-                attrs.remove(MacAttributes.NSAccessibilityTopLevelUIElementAttribute);
-            }
-
             return attrs.stream().mapToLong(a -> a.ptr).toArray();
         }
         return null;
     }
 
     int accessibilityArrayAttributeCount(long attribute) {
-        MacAttributes attr = MacAttributes.getAttribute(attribute);
+        MacAttribute attr = MacAttribute.getAttribute(attribute);
         if (attr == null) {
             return -1;
         }
@@ -937,7 +950,7 @@
     }
 
     long[] accessibilityArrayAttributeValues(long attribute, int index, int maxCount) {
-        MacAttributes attr = MacAttributes.getAttribute(attribute);
+        MacAttribute attr = MacAttribute.getAttribute(attribute);
         if (attr == null) {
             return null;
         }
@@ -988,7 +1001,7 @@
     }
 
     boolean accessibilityIsAttributeSettable(long attribute) {
-        MacAttributes attr = MacAttributes.getAttribute(attribute);
+        MacAttribute attr = MacAttribute.getAttribute(attribute);
         if (attr == null) return false;
         switch (attr) {
             case NSAccessibilityDisclosingAttribute:
@@ -1005,7 +1018,7 @@
     }
 
     MacVariant accessibilityAttributeValue(long attribute) {
-        MacAttributes attr = MacAttributes.getAttribute(attribute);
+        MacAttribute attr = MacAttribute.getAttribute(attribute);
         if (attr == null) {
             return null;
         }
@@ -1147,30 +1160,17 @@
                 break;
             }
             case NSAccessibilitySubroleAttribute: {
-                MacSubroles subRole = MacSubroles.getRole((Role)result);
+                MacSubrole subRole = MacSubrole.getRole((Role)result);
                 result = subRole != null ? subRole.ptr : 0L;
                 break;
             }
             case NSAccessibilityRoleAttribute: {
-                MacRoles macRole = MacRoles.getRole((Role)result);
-                if (macRole == MacRoles.NSAccessibilityProgressIndicatorRole) {
-                    Boolean state = (Boolean)getAttribute(INDETERMINATE);
-                    if (Boolean.TRUE.equals(state)) {
-                        macRole = MacRoles.NSAccessibilityBusyIndicatorRole;
-                    }
-                }
+                MacRole macRole = getRole(role);
                 result = macRole != null ? macRole.ptr : 0L;
                 break;
             }
             case NSAccessibilityRoleDescriptionAttribute: {
-                MacRoles macRole = MacRoles.getRole((Role)result);
-                if (macRole == null) return null;
-                if (macRole == MacRoles.NSAccessibilityProgressIndicatorRole) {
-                    Boolean state = (Boolean)getAttribute(INDETERMINATE);
-                    if (Boolean.TRUE.equals(state)) {
-                        macRole = MacRoles.NSAccessibilityBusyIndicatorRole;
-                    }
-                }
+                MacRole macRole = getRole(role);
                 /* 
                  * In some cases there is no proper mapping from a JFX role
                  * to a Mac role. For example, reporting 'disclosure triangle'
@@ -1183,7 +1183,7 @@
                     case PAGE: result = "page"; break;
                     case TAB_ITEM: result = "tab"; break;
                     default:
-                        MacSubroles subRole = MacSubroles.getRole(role);
+                        MacSubrole subRole = MacSubrole.getRole(role);
                         result = NSAccessibilityRoleDescription(macRole.ptr, subRole != null ? subRole.ptr : 0l);
                 }
                 break;
@@ -1393,10 +1393,13 @@
                 break;
             }
             case NSAccessibilityInsertionPointLineNumberAttribute: {
-                int offset = (Integer)result;
-                if (offset < 0) result = 0;
-                //TODO multi line support
-                result = 0;
+                if (role == Role.TEXT_AREA) {
+                    Integer lineIndex = (Integer)getAttribute(LINE_FOR_OFFSET, result /*CARET_OFFSET*/);
+                    result = lineIndex != null ? lineIndex : 0;
+                } else {
+                    /* Combo and TextArea */ 
+                    result = 0;
+                }
                 break;
             }
             case NSAccessibilityVisibleCharacterRangeAttribute: {
@@ -1428,8 +1431,8 @@
             case NSAccessibilityOrientationAttribute:
                 Orientation orientation = (Orientation)result;
                 switch (orientation) {
-                    case HORIZONTAL: result = MacOrientations.NSAccessibilityHorizontalOrientationValue.ptr; break;
-                    case VERTICAL: result = MacOrientations.NSAccessibilityVerticalOrientationValue.ptr; break;
+                    case HORIZONTAL: result = MacOrientation.NSAccessibilityHorizontalOrientationValue.ptr; break;
+                    case VERTICAL: result = MacOrientation.NSAccessibilityVerticalOrientationValue.ptr; break;
                     default: return null;
                 }
                 break;
@@ -1447,7 +1450,7 @@
     }
 
     void accessibilitySetValue(long value, long attribute) {
-        MacAttributes attr = MacAttributes.getAttribute(attribute);
+        MacAttribute attr = MacAttribute.getAttribute(attribute);
         if (attr != null) {
             switch (attr) {
                 case NSAccessibilitySelectedCellsAttribute:
@@ -1487,22 +1490,33 @@
         if (getView() != null) return null; /* Let NSView answer for the Scene */
         Role role = (Role)getAttribute(ROLE);
         if (role != null) {
-            MacRoles macRole = MacRoles.getRole(role);
+            List<MacAttribute> attrs = new ArrayList<>();
+            MacRole macRole = getRole(role);
             if (macRole != null && macRole.macParameterizedAttributes != null) {
-                Stream<MacAttributes> attrs = macRole.macParameterizedAttributes.stream();
-
-                /* ListView is row-based, must remove all the cell-based attributes */
-                if (role == Role.LIST_VIEW || role == Role.TREE_TABLE_VIEW) {
-                    attrs = attrs.filter(a -> a != MacAttributes.NSAccessibilityCellForColumnAndRowParameterizedAttribute);
-                }
-                return attrs.mapToLong(a -> a.ptr).toArray();
+                attrs.addAll(macRole.macParameterizedAttributes);
             }
+            switch (role) {
+                case LIST_VIEW:
+                case TREE_TABLE_VIEW:
+                    /* ListView is row-based, must remove all the cell-based attributes */
+                    attrs.remove(MacAttribute.NSAccessibilityCellForColumnAndRowParameterizedAttribute);
+                    break;
+                case TEXT:
+                case TEXT_FIELD:
+                case TEXT_AREA:
+                case PASSWORD_FIELD:
+                case COMBOBOX:
+                    attrs.addAll(textParameterizedAttributes);
+                    break;
+                default:
+            }
+            return attrs.stream().mapToLong(a -> a.ptr).toArray();
         }
         return null;
     }
 
     MacVariant accessibilityAttributeValueForParameter(long attribute, long parameter) {
-        MacAttributes attr = MacAttributes.getAttribute(attribute);
+        MacAttribute attr = MacAttribute.getAttribute(attribute);
         if (attr == null || attr.inputType == 0 || attr.jfxAttr == null) {
             return null;
         }
@@ -1515,6 +1529,31 @@
                 int[] intArray = (int[])value;
                 result = getAttribute(attr.jfxAttr, intArray[1] /*row*/, intArray[0] /*column*/);
                 break;
+            case NSAccessibilityLineForIndexParameterizedAttribute: {
+                if (getAttribute(ROLE) == Role.TEXT_AREA) {
+                    result = getAttribute(attr.jfxAttr, value /*charOffset*/);
+                } else {
+                    /* Combo and TextField */
+                    result = 0;
+                }
+                break;
+            }
+            case NSAccessibilityRangeForLineParameterizedAttribute: {
+                if (getAttribute(ROLE) == Role.TEXT_AREA) {
+                    Integer lineStart = (Integer)getAttribute(LINE_START, value /*line index*/);
+                    Integer lineEnd = (Integer)getAttribute(LINE_END, value /*line index*/);
+                    if (lineStart != null && lineEnd != null) {
+                        result = new int[] {lineStart, lineEnd - lineStart}; 
+                    } else {
+                        result = null;
+                    }
+                } else {
+                    /* Combo and TextField */
+                    String text = (String)getAttribute(TITLE);
+                    result = new int[] {0, text != null ? text.length() : 0};
+                }
+                break;
+            }
             default:
                 result = getAttribute(attr.jfxAttr, value);
         }
@@ -1526,19 +1565,6 @@
                 result = text.substring(variant.int1, variant.int1 + variant.int2);
                 break;
             }
-            case NSAccessibilityLineForIndexParameterizedAttribute: {
-                int offset = (Integer)result;
-                //TODO multi line support
-                if (offset < 0) result = 0;
-                result = 0;
-                break;
-            }
-            case NSAccessibilityRangeForLineParameterizedAttribute: {
-                String text = (String)result;
-                //TODO multi line support
-                result = new int[] {0, text.length()}; 
-                break;
-            }
             case NSAccessibilityCellForColumnAndRowParameterizedAttribute: {
                 result = getAccessible((Node)result);
                 break;
@@ -1551,9 +1577,9 @@
     long[] accessibilityActionNames() {
         if (getView() != null) return null; /* Let NSView answer for the Scene */
         Role role = (Role)getAttribute(ROLE);
-        List<MacActions> actions = new ArrayList<>();
+        List<MacAction> actions = new ArrayList<>();
         if (role != null) {
-            MacRoles macRole = MacRoles.getRole(role);
+            MacRole macRole = getRole(role);
             if (macRole != null && macRole.macActions != null) {
                 actions.addAll(macRole.macActions);
             }
@@ -1562,7 +1588,7 @@
              * has a menu instead of using the role.
              */
             if (role != Role.NODE && role != Role.PARENT) {
-                actions.add(MacActions.NSAccessibilityShowMenuAction);
+                actions.add(MacAction.NSAccessibilityShowMenuAction);
             }
         }
         /* Return empty array instead of null to prevent warnings in the accessibility verifier */
@@ -1574,15 +1600,15 @@
     }
 
     void accessibilityPerformAction(long action) {
-        MacActions macAction = MacActions.getAction(action);
+        MacAction macAction = MacAction.getAction(action);
         boolean expand = false;
-        if (macAction == MacActions.NSAccessibilityPressAction) {
+        if (macAction == MacAction.NSAccessibilityPressAction) {
             Role role = (Role)getAttribute(ROLE);
             if (role == Role.TITLED_PANE || role == Role.COMBOBOX) {
                 expand = true;
             }
         }
-        if (macAction == MacActions.NSAccessibilityShowMenuAction) {
+        if (macAction == MacAction.NSAccessibilityShowMenuAction) {
             if (getAttribute(ROLE) == Role.SPLIT_MENU_BUTTON) {
                 expand = true;
             }
--- a/modules/graphics/src/main/java/com/sun/glass/ui/mac/MacApplication.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/mac/MacApplication.java	Tue Apr 15 13:22:04 2014 -0700
@@ -88,12 +88,15 @@
     native private void _finishTerminating();
     @Override
     protected void finishTerminating() {
-        setEventThread(null);
         _finishTerminating();
 
         super.finishTerminating();
     }
 
+    private void notifyApplicationDidTerminate() {
+        setEventThread(null);
+    }
+
     // Called from the native code
     private void setEventThread() {
         setEventThread(Thread.currentThread());
--- a/modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Tue Apr 15 13:22:04 2014 -0700
@@ -163,10 +163,12 @@
     private static final int UIA_AutomationPropertyChangedEventId= 20004;
     private static final int UIA_AutomationFocusChangedEventId   = 20005;
     private static final int UIA_MenuClosedEventId               = 20007;
-    private static final int UIA_MenuModeEndEventId              = 20019;
-    private static final int UIA_MenuModeStartEventId            = 20018;
     private static final int UIA_SelectionItem_ElementRemovedFromSelectionEventId = 20011;
     private static final int UIA_SelectionItem_ElementSelectedEventId = 20012;
+    private static final int UIA_Text_TextSelectionChangedEventId = 20014;
+    private static final int UIA_Text_TextChangedEventId         = 20015;
+    private static final int UIA_MenuModeStartEventId            = 20018;
+    private static final int UIA_MenuModeEndEventId              = 20019;
 
     /* SupportedTextSelection */
     private static final int SupportedTextSelection_None         = 0;
@@ -363,6 +365,7 @@
             }
             case SELECTION_START:
             case SELECTION_END:
+                UiaRaiseAutomationEvent(peer, UIA_Text_TextSelectionChangedEventId);
                 selectionRangeValid = false;
                 break;
             case TITLE:
@@ -377,7 +380,8 @@
                     vn.bstrVal = value;
                     UiaRaiseAutomationPropertyChangedEvent(peer, UIA_ValueValuePropertyId, vo, vn);
                 }
-                //TODO send ITextProvider UIA event
+
+                UiaRaiseAutomationEvent(peer, UIA_Text_TextChangedEventId);
                 documentRangeValid = false;
                 selectionRangeValid = false;
                 break;
--- a/modules/graphics/src/main/java/com/sun/javafx/css/StyleManager.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/css/StyleManager.java	Tue Apr 15 13:22:04 2014 -0700
@@ -815,12 +815,13 @@
             // We only care about stylesheets from file: URLs.
             if (url != null && "file".equals(url.getProtocol())) {
 
-                final InputStream stream = url.openStream();
+                try (InputStream stream = url.openStream()) {
 
-                // not looking for security, just a checksum. MD5 should be faster than SHA
-                final DigestInputStream dis = new DigestInputStream(stream, MessageDigest.getInstance("MD5"));
-                while (dis.read() != -1) { /* empty loop body is intentional */ }
-                return dis.getMessageDigest().digest();
+                    // not looking for security, just a checksum. MD5 should be faster than SHA
+                    final DigestInputStream dis = new DigestInputStream(stream, MessageDigest.getInstance("MD5"));
+                    while (dis.read() != -1) { /* empty loop body is intentional */ }
+                    return dis.getMessageDigest().digest();
+                }
 
             }
 
--- a/modules/graphics/src/main/java/com/sun/javafx/css/Stylesheet.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/css/Stylesheet.java	Tue Apr 15 13:22:04 2014 -0700
@@ -242,15 +242,10 @@
         if (url == null) return null;
 
         Stylesheet stylesheet = null;
-        InputStream inputStream = null;
-        BufferedInputStream bufferedInputStream = null;
-        DataInputStream dataInputStream = null;
-        try {
-            inputStream = url.openStream();
-            // current bss file is 33k so this leaves a little scope at 40k
-            bufferedInputStream = new BufferedInputStream(inputStream, 40 * 1024);
 
-            dataInputStream = new DataInputStream(bufferedInputStream);
+        try (DataInputStream dataInputStream =
+                     new DataInputStream(new BufferedInputStream(url.openStream(), 40 * 1024))) {
+
             // read file version
             final int bssVersion = dataInputStream.readShort();
             if (bssVersion > Stylesheet.BINARY_CSS_VERSION) {
@@ -263,7 +258,6 @@
             // read binary data
             stylesheet = new Stylesheet(url.toExternalForm());
 
-            boolean retry = false;
             try {
 
                 dataInputStream.mark(Integer.MAX_VALUE);
@@ -286,11 +280,6 @@
         } catch (FileNotFoundException fnfe) {
             // This comes from url.openStream() and is expected.
             // It just means that the .bss file doesn't exist.
-        } finally {
-            try {
-                if (dataInputStream != null) dataInputStream.close();
-            } catch (IOException ignored) {
-            }
         }
 
         // return stylesheet
--- a/modules/graphics/src/main/java/com/sun/javafx/css/parser/CSSParser.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/css/parser/CSSParser.java	Tue Apr 15 13:22:04 2014 -0700
@@ -197,8 +197,11 @@
         final Stylesheet stylesheet = new Stylesheet();
         if (stylesheetText != null && !stylesheetText.trim().isEmpty()) {
             setInputSource(stylesheetText);
-            Reader reader = new CharArrayReader(stylesheetText.toCharArray());
-            parse(stylesheet, reader);
+            try (Reader reader = new CharArrayReader(stylesheetText.toCharArray())) {
+                parse(stylesheet, reader);
+            } catch (IOException ioe) {
+                // this method doesn't explicitly throw IOException
+            }
         }
         return stylesheet;
     }
@@ -214,8 +217,9 @@
         final Stylesheet stylesheet = new Stylesheet(docbase);
         if (stylesheetText != null && !stylesheetText.trim().isEmpty()) {
             setInputSource(docbase, stylesheetText);
-            Reader reader = new CharArrayReader(stylesheetText.toCharArray());
-            parse(stylesheet, reader);
+            try (Reader reader = new CharArrayReader(stylesheetText.toCharArray())) {
+                parse(stylesheet, reader);
+            }
         }
         return stylesheet;
     }
@@ -234,8 +238,9 @@
         final Stylesheet stylesheet = new Stylesheet(path);
         if (url != null) {
             setInputSource(path, null);
-            Reader reader = new BufferedReader(new InputStreamReader(url.openStream()));
-            parse(stylesheet, reader);
+            try (Reader reader = new BufferedReader(new InputStreamReader(url.openStream()))) {
+                parse(stylesheet, reader);
+            }
         }
         return stylesheet;
     }
@@ -248,8 +253,6 @@
 
         try {
             this.parse(stylesheet, lex);
-            reader.close();
-        } catch (IOException ioe) {
         } catch (Exception ex) {
             // Sometimes bad syntax causes an exception. The code should be
             // fixed to handle the bad syntax, but the fallback is
@@ -269,10 +272,9 @@
         if (stylesheetText != null && !stylesheetText.trim().isEmpty()) {
             setInputSource(node);
             final List<Rule> rules = new ArrayList<Rule>();
-            final Reader reader = new CharArrayReader(stylesheetText.toCharArray());
-            final CSSLexer lexer = CSSLexer.getInstance();
-            lexer.setReader(reader);
-            try {
+            try (Reader reader = new CharArrayReader(stylesheetText.toCharArray())) {
+                final CSSLexer lexer = CSSLexer.getInstance();
+                lexer.setReader(reader);
                 currentToken = nextToken(lexer);
                 final List<Declaration> declarations = declarations(lexer);
                 if (declarations != null && !declarations.isEmpty()) {
@@ -283,7 +285,6 @@
                     );
                     rules.add(rule);
                 }
-                reader.close();
             } catch (IOException ioe) {
             } catch (Exception ex) {
                 // Sometimes bad syntax causes an exception. The code should be
@@ -303,22 +304,21 @@
 
     /** convenience method for unit tests */
     public ParsedValueImpl parseExpr(String property, String expr) {
+        if (property == null || expr == null) return null;
+
         ParsedValueImpl value = null;
-        try {
-            setInputSource(null, property + ": " + expr);
-            char buf[] = new char[expr.length() + 1];
-            System.arraycopy(expr.toCharArray(), 0, buf, 0, expr.length());
-            buf[buf.length-1] = ';';
-
-            Reader reader = new CharArrayReader(buf);
+        setInputSource(null, property + ": " + expr);
+        char buf[] = new char[expr.length() + 1];
+        System.arraycopy(expr.toCharArray(), 0, buf, 0, expr.length());
+        buf[buf.length-1] = ';';
+
+        try (Reader reader = new CharArrayReader(buf)) {
             CSSLexer lex = CSSLexer.getInstance();
             lex.setReader(reader);
 
             currentToken = nextToken(lex);
             CSSParser.Term term = this.expr(lex);
             value = valueFor(property, term);
-
-            reader.close();
         } catch (IOException ioe) {
         } catch (ParseException e) {
             if (LOGGER.isLoggable(Level.WARNING)) {
--- a/modules/graphics/src/main/java/com/sun/javafx/scene/text/TextLine.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/scene/text/TextLine.java	Tue Apr 15 13:22:04 2014 -0700
@@ -63,4 +63,14 @@
      * Returns the right side bearing of the line (positive).
      */
     public float getRightSideBearing();
+
+    /**
+     * Returns the line start offset.
+     */
+    public int getStart();
+
+    /**
+     * Returns the line length in character.
+     */
+    public int getLength();
 }
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/GlassViewEventHandler.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/GlassViewEventHandler.java	Tue Apr 15 13:22:04 2014 -0700
@@ -65,10 +65,12 @@
 
     static boolean zoomGestureEnabled;
     static boolean rotateGestureEnabled;
+    static boolean scrollGestureEnabled;
     static {
         AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
             zoomGestureEnabled = Boolean.valueOf(System.getProperty("com.sun.javafx.gestures.zoom", "false"));
             rotateGestureEnabled = Boolean.valueOf(System.getProperty("com.sun.javafx.gestures.rotate", "false"));
+            scrollGestureEnabled = Boolean.valueOf(System.getProperty("com.sun.javafx.gestures.scroll", "false"));
             return null;
         });
     }    
@@ -92,6 +94,9 @@
         if (rotateGestureEnabled) {
             gestures.add(new RotateGestureRecognizer(scene));
         }
+        if (scrollGestureEnabled) {
+            gestures.add(new ScrollGestureRecognizer(scene));
+        }
     }
 
     // Default fullscreen allows limited keyboard input.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/ScrollGestureRecognizer.java	Tue Apr 15 13:22:04 2014 -0700
@@ -0,0 +1,325 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.javafx.tk.quantum;
+
+import com.sun.glass.events.KeyEvent;
+import com.sun.glass.events.TouchEvent;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.HashMap;
+import java.util.Map;
+import javafx.event.EventType;
+import javafx.scene.input.ScrollEvent;
+
+class ScrollGestureRecognizer implements GestureRecognizer {
+    // gesture will be activated if |scroll amount| > SCROLL_THRESHOLD
+    private static double SCROLL_THRESHOLD = 10; //in pixels
+    static {
+        AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+            String s = System.getProperty("com.sun.javafx.gestures.scroll.threshold");
+            if (s != null) {
+                SCROLL_THRESHOLD = Double.valueOf(s);
+            }
+            return null;
+        });
+    }    
+
+    private ViewScene scene;
+
+    private ScrollRecognitionState state = ScrollRecognitionState.IDLE;
+
+    private Map<Long, TouchPointTracker> trackers =
+            new HashMap<Long, TouchPointTracker>();
+
+    private int modifiers;
+    private boolean direct;
+
+    private int currentTouchCount = 0;
+    private int lastTouchCount;
+    private boolean touchPointsSetChanged;
+
+    private double centerX, centerY;
+    private double centerAbsX, centerAbsY;
+    private double lastCenterAbsX, lastCenterAbsY;
+
+    private double deltaX, deltaY;
+    private double totalDeltaX, totalDeltaY;
+    
+    ScrollGestureRecognizer(final ViewScene scene) {
+        this.scene = scene;
+    }
+
+    @Override
+    public void notifyBeginTouchEvent(long time, int modifiers, boolean isDirect,
+            int touchEventCount) {
+        params(modifiers, isDirect);
+        touchPointsSetChanged = false;
+    }
+
+    @Override
+    public void notifyNextTouchEvent(long time, int type, long touchId,
+                                     int x, int y, int xAbs, int yAbs) {
+        switch(type) {
+            case TouchEvent.TOUCH_PRESSED:
+                touchPointsSetChanged = true;
+                touchPressed(touchId, time, x, y, xAbs, yAbs);
+                break;
+            case TouchEvent.TOUCH_STILL:
+                break;
+            case TouchEvent.TOUCH_MOVED:
+                touchMoved(touchId, time, x, y, xAbs, yAbs);
+                break;
+            case TouchEvent.TOUCH_RELEASED:
+                touchPointsSetChanged = true;
+                touchReleased(touchId, time, x, y, xAbs, yAbs);
+                break;
+            default:
+                throw new RuntimeException("Error in Scroll gesture recognition: "
+                        + "unknown touch state: " + state);
+        }
+    }
+
+    private void calculateCenter() {
+        if (currentTouchCount <= 0) {
+            throw new RuntimeException("Error in Scroll gesture recognition: "
+                    + "touch count is zero!");
+        }
+        double totalX = 0.0;
+        double totalY = 0.0;
+        double totalAbsX = 0.0;
+        double totalAbsY = 0.0;
+        for (TouchPointTracker tracker : trackers.values()) {
+            totalX += tracker.getX();
+            totalY += tracker.getY();
+            totalAbsX += tracker.getAbsX();
+            totalAbsY += tracker.getAbsY();
+        }      
+        centerX = totalX / currentTouchCount;
+        centerY = totalY / currentTouchCount;
+        centerAbsX = totalAbsX / currentTouchCount;
+        centerAbsY = totalAbsY / currentTouchCount;
+    }
+    
+    @Override
+    public void notifyEndTouchEvent(long time) {
+        if (currentTouchCount != trackers.size()) {
+            throw new RuntimeException("Error in Scroll gesture recognition: "
+                    + "touch count is wrong: " + currentTouchCount);
+        }
+
+        if (currentTouchCount < 1) {
+            if (state == ScrollRecognitionState.ACTIVE) {
+                sendScrollFinishedEvent(lastCenterAbsX, lastCenterAbsY, lastTouchCount);
+            }
+            reset();
+        } else {
+            // currentTouchCount >= 1
+            calculateCenter();
+
+            if (touchPointsSetChanged) {
+                if (state == ScrollRecognitionState.IDLE) {
+                    state = ScrollRecognitionState.TRACKING;
+                }
+                if (state == ScrollRecognitionState.ACTIVE) {
+                    //finish previous gesture
+                    sendScrollFinishedEvent(lastCenterAbsX, lastCenterAbsY, lastTouchCount);
+                    totalDeltaX = 0.0;
+                    totalDeltaY = 0.0;
+                    //start previous gesture
+                    sendScrollStartedEvent(centerAbsX, centerAbsY, currentTouchCount);
+                }
+                lastTouchCount = currentTouchCount;
+                lastCenterAbsX = centerAbsX;
+                lastCenterAbsY = centerAbsY;
+            } else {
+                //state should be either TRACKING or ACTIVE
+                deltaX = centerAbsX - lastCenterAbsX;
+                deltaY = centerAbsY - lastCenterAbsY;
+                if (state == ScrollRecognitionState.TRACKING) {
+                    if ( Math.abs(deltaX) > SCROLL_THRESHOLD || Math.abs(deltaY) > SCROLL_THRESHOLD) {
+                        state = ScrollRecognitionState.ACTIVE;
+                        sendScrollStartedEvent(centerAbsX, centerAbsY, currentTouchCount);
+                    }
+                }
+                if (state == ScrollRecognitionState.ACTIVE) {
+                    totalDeltaX += deltaX;
+                    totalDeltaY += deltaY;
+
+                    sendScrollEvent(centerAbsX, centerAbsY, currentTouchCount);
+
+                    lastCenterAbsX = centerAbsX;
+                    lastCenterAbsY = centerAbsY;
+                }
+            }
+        }
+    }
+    
+    private void sendScrollStartedEvent(double centerX, double centerY, int touchCount) {
+        AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+            if (scene.sceneListener != null) {
+                scene.sceneListener.scrollEvent(ScrollEvent.SCROLL_STARTED,
+                    0, 0,
+                    0, 0,
+                    1 /*xMultiplier*/, 1 /*yMultiplier*/,
+                    touchCount,
+                    0 /*scrollTextX*/, 0 /*scrollTextY*/,
+                    0 /*defaultTextX*/, 0 /*defaultTextY*/,
+                    centerX, centerY, centerAbsX, centerAbsY,
+                    (modifiers & KeyEvent.MODIFIER_SHIFT) != 0,
+                    (modifiers & KeyEvent.MODIFIER_CONTROL) != 0,
+                    (modifiers & KeyEvent.MODIFIER_ALT) != 0,
+                    (modifiers & KeyEvent.MODIFIER_WINDOWS) != 0,
+                    direct, false /*inertia*/);
+            }
+            return null;
+        }, scene.getAccessControlContext());
+    }
+
+    private void sendScrollEvent(double centerX, double centerY, int touchCount) {
+        AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+            if (scene.sceneListener != null) {
+                scene.sceneListener.scrollEvent(ScrollEvent.SCROLL,
+                    deltaX, deltaY,
+                    totalDeltaX, totalDeltaY,
+                    1 /*xMultiplier*/, 1 /*yMultiplier*/,
+                    touchCount,
+                    0 /*scrollTextX*/, 0 /*scrollTextY*/,
+                    0 /*defaultTextX*/, 0 /*defaultTextY*/,
+                    centerX, centerY, centerAbsX, centerAbsY,
+                    (modifiers & KeyEvent.MODIFIER_SHIFT) != 0,
+                    (modifiers & KeyEvent.MODIFIER_CONTROL) != 0,
+                    (modifiers & KeyEvent.MODIFIER_ALT) != 0,
+                    (modifiers & KeyEvent.MODIFIER_WINDOWS) != 0,
+                    direct, false /*inertia*/);
+            }
+            return null;
+        }, scene.getAccessControlContext());
+    }
+
+    private void sendScrollFinishedEvent(double centerX, double centerY, int touchCount) {
+        AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+            if (scene.sceneListener != null) {
+                scene.sceneListener.scrollEvent(ScrollEvent.SCROLL_FINISHED,
+                    0, 0,
+                    totalDeltaX, totalDeltaY,
+                    1 /*xMultiplier*/, 1 /*yMultiplier*/,
+                    touchCount,
+                    0 /*scrollTextX*/, 0 /*scrollTextY*/,
+                    0 /*defaultTextX*/, 0 /*defaultTextY*/,
+                    centerX, centerY, centerAbsX, centerAbsY,
+                    (modifiers & KeyEvent.MODIFIER_SHIFT) != 0,
+                    (modifiers & KeyEvent.MODIFIER_CONTROL) != 0,
+                    (modifiers & KeyEvent.MODIFIER_ALT) != 0,
+                    (modifiers & KeyEvent.MODIFIER_WINDOWS) != 0,
+                    direct, false /*inertia*/);
+            }
+            return null;
+        }, scene.getAccessControlContext());
+    }
+
+    public void params(int modifiers, boolean direct) {
+        this.modifiers = modifiers;
+        this.direct = direct;
+    }
+
+    public void touchPressed(long id, long nanos, int x, int y, int xAbs, int yAbs) {
+        currentTouchCount++;
+        TouchPointTracker tracker = new TouchPointTracker();
+        tracker.update(nanos, x, y, xAbs, yAbs);
+        trackers.put(id, tracker);
+    }
+
+    public void touchReleased(long id, long nanos, int x, int y, int xAbs, int yAbs) {
+        if (state != ScrollRecognitionState.FAILURE) {
+            TouchPointTracker tracker = trackers.get(id);
+            if (tracker == null) {
+                // we don't know this ID, something went completely wrong
+                state = ScrollRecognitionState.FAILURE;
+                throw new RuntimeException("Error in Scroll gesture "
+                        + "recognition: released unknown touch point");
+            }
+            trackers.remove(id);
+        }
+        currentTouchCount--;
+    }
+
+    public void touchMoved(long id, long nanos, int x, int y, int xAbs, int yAbs) {
+        if (state == ScrollRecognitionState.FAILURE) {
+            return;
+        }
+
+        TouchPointTracker tracker = trackers.get(id);
+        if (tracker == null) {
+            // we don't know this ID, something went completely wrong
+            state = ScrollRecognitionState.FAILURE;
+            throw new RuntimeException("Error in scroll gesture "
+                    + "recognition: reported unknown touch point");
+        }
+        tracker.update(nanos, x, y, xAbs, yAbs);
+    }
+
+    void reset() {
+        state = ScrollRecognitionState.IDLE;
+        totalDeltaX = 0.0;
+        totalDeltaY = 0.0;
+    }
+
+    private static class TouchPointTracker {
+        double x, y;
+        double absX, absY;
+
+        public void update(long nanos, double x, double y, double absX, double absY) {
+            this.x = x;
+            this.y = y;
+            this.absX = absX;
+            this.absY = absY;
+        }
+
+        public double getX() {
+            return x;
+        }
+
+        public double getY() {
+            return y;
+        }
+
+        public double getAbsX() {
+            return absX;
+        }
+
+        public double getAbsY() {
+            return absY;
+        }
+    }
+
+    private enum ScrollRecognitionState {
+        IDLE,       // no touch points available
+        TRACKING,   // 1+ touch points, center position is tracked
+        ACTIVE,     // threshold accepted, gesture is started
+        FAILURE
+    }
+}
--- a/modules/graphics/src/main/java/javafx/scene/Node.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/java/javafx/scene/Node.java	Tue Apr 15 13:22:04 2014 -0700
@@ -8737,10 +8737,6 @@
         // createStyleHelper returned the same styleHelper
         final CssStyleHelper oldStyleHelper = styleHelper;
 
-        // Hang on to current cssFlags in case we have to
-        // set the state back to what it was.
-        final CssFlags oldCssFlag = cssFlag;
-
         // CSS state is "REAPPLY"
         cssFlag = CssFlags.REAPPLY;
 
@@ -8756,15 +8752,11 @@
 
             if (visitChildren) {
 
-                List<Node> children = ((Parent)this).getChildren();
-                for(int n=0, nMax=children.size(); n<nMax; n++) {
+                List<Node> children = ((Parent) this).getChildren();
+                for (int n = 0, nMax = children.size(); n < nMax; n++) {
                     Node child = children.get(n);
                     child.impl_reapplyCSS();
                 }
-
-            } else {
-                cssFlag = oldCssFlag;
-                return;
             }
 
         } else if (styleHelper == null) {
@@ -8776,9 +8768,22 @@
             return;
         }
 
-        // this branch needs update
         cssFlag = CssFlags.UPDATE;
-        notifyParentsOfInvalidatedCSS();
+
+        //
+        // One idiom employed by developers is to, during the layout pass,
+        // add or remove nodes from the scene. For example, a ScrollPane
+        // might add scroll bars to itself if it determines during layout
+        // that it needs them, or a ListView might add cells to itself if
+        // it determines that it needs to. In such situations we must
+        // apply the CSS immediately and not add it to the scene's queue
+        // for deferred action.
+        //
+        if (getParent() != null && getParent().performingLayout) {
+            impl_processCSS(null);
+        } else {
+            notifyParentsOfInvalidatedCSS();
+        }
 
     }
 
--- a/modules/graphics/src/main/java/javafx/scene/Parent.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/java/javafx/scene/Parent.java	Tue Apr 15 13:22:04 2014 -0700
@@ -1071,23 +1071,6 @@
                     break;
                 }
                 performingLayout = true;
-                //
-                // One idiom employed by developers is to, during the layout pass,
-                // add or remove nodes from the scene. For example, a ScrollPane
-                // might add scroll bars to itself if it determines during layout
-                // that it needs them, or a ListView might add cells to itself if
-                // it determines that it needs to. In such situations we must
-                // apply the CSS immediately and not add it to the scene's queue
-                // for deferred action.
-                //
-                // Note that we only call processCSS if the flag is update. If the
-                // flag is DIRTY_BRANCH, then the whatever children need UPDATE
-                // will be visited during this layout anyway. On the next pulse,
-                // doCSSPass will clean up the DIRTY_BRANCH nodes.
-                //
-                if (cssFlag == CssFlags.UPDATE) {
-                    processCSS();
-                }
                 layoutChildren();
                 // Intended fall-through
             case DIRTY_BRANCH:
--- a/modules/graphics/src/main/java/javafx/scene/Scene.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/java/javafx/scene/Scene.java	Tue Apr 15 13:22:04 2014 -0700
@@ -3124,6 +3124,7 @@
 
                 currentTargets.clear();
                 currentTargets.addAll(newTargets);
+                newTargets.clear();
             }
         }
 
@@ -3367,6 +3368,9 @@
                     j--;
                 }
 
+                pressedTargets.clear();
+                releasedTargets.clear();
+
                 if (clickedTarget != null) {
                     MouseEvent click = new MouseEvent(null, clickedTarget,
                             MouseEvent.MOUSE_CLICKED, e.getSceneX(), e.getSceneY(),
@@ -3753,6 +3757,7 @@
                 fullPDRCurrentTarget = eventTarget;
                 fullPDRCurrentEventTargets.clear();
                 fullPDRCurrentEventTargets.addAll(fullPDRNewEventTargets);
+                fullPDRNewEventTargets.clear();
             }
             // done enter/exit handling
 
--- a/modules/graphics/src/main/java/javafx/scene/accessibility/Attribute.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/java/javafx/scene/accessibility/Attribute.java	Tue Apr 15 13:22:04 2014 -0700
@@ -33,6 +33,7 @@
 import javafx.scene.Parent;
 import javafx.scene.Scene;
 import javafx.scene.input.KeyCombination;
+import javafx.scene.text.Font;
 
 /**
  * Experimental API - Do not use (will be removed).
@@ -54,6 +55,20 @@
     BOUNDS("Bounds", Bounds.class),
 
     /**
+     * Returns the array of bounding rectangles for the given char range.
+     * Parameter: Integer range start
+     * Parameter: Integer range length
+     * Type: Bounds[]
+     */
+    BOUNDS_FOR_RANGE("BoundsForRange", Bounds[].class),
+
+    /**
+     * Returns the caret offset for the node.
+     * Type: Integer
+     */
+    CARET_OFFSET("CaretOffset", Integer.class),
+
+    /**
      * Returns the children for the Node.
      * Type: ObservableList&lt;Node&gt;
      */
@@ -103,9 +118,19 @@
      */
     DISCLOSURE_LEVEL("DisclosureLevel", Integer.class),
 
+    /**
+     * Returns the local date for the node.
+     * Type: LocalDate
+     */
     DATE("Date", LocalDate.class),
 
     /**
+     * Returns true if the node is editable.
+     * Type: Boolean
+     */
+    EDITABLE("Editable", Boolean.class),
+
+    /**
      * Returns true if the Node is enabled.
      * Type: Boolean
      */
@@ -142,6 +167,12 @@
     FOCUSED("Focused", Boolean.class),
 
     /**
+     * Returns the font for the node
+     * Type: Font
+     */
+    FONT("Font", Font.class),
+
+    /**
      * Returns the header for the node
      * Type: Node
      */
@@ -178,6 +209,27 @@
     LEAF("Leaf", Boolean.class),
 
     /**
+     * Returns the line start of the given line index.
+     * Parameter: Integer - line index
+     * Type: Integer
+     */
+    LINE_END("LineEnd", Integer.class),
+
+    /**
+     * Returns the line index of the given character offset.
+     * Parameter: Integer - character offset.
+     * Type: Integer
+     */
+    LINE_FOR_OFFSET("LineOffset", Integer.class),
+
+    /**
+     * Returns the line end of the given line index.
+     * Parameter: Integer - line index
+     * Type: Integer
+     */
+    LINE_START("LineStart", Integer.class),
+
+    /**
      * Returns the min value for the node.
      * Type: Double
      */
@@ -227,6 +279,13 @@
     NODE_AT_POINT("NodeAtPoint", Node.class),
 
     /**
+     * Returns the char offset at the given point location.
+     * Type: Integer
+     * Parameters: Point
+     */
+    OFFSET_AT_POINT("OffsetAtPoint", Integer.class),
+
+    /**
      * Returns the orientation of a node
      * Type: Orientation
      */
--- a/modules/graphics/src/main/java/javafx/scene/layout/TilePane.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/java/javafx/scene/layout/TilePane.java	Tue Apr 15 13:22:04 2014 -0700
@@ -910,39 +910,42 @@
         double insideWidth = width - left - right;
         double insideHeight = height - top - bottom;
 
+        double tileWidth = getTileWidth() > insideWidth ? insideWidth : getTileWidth();
+        double tileHeight = getTileHeight() > insideHeight ? insideHeight : getTileHeight();
+
         int lastRowRemainder = 0;
         int lastColumnRemainder = 0;
         if (getOrientation() == HORIZONTAL) {
-            actualColumns = computeColumns(insideWidth, getTileWidth());
+            actualColumns = computeColumns(insideWidth, tileWidth);
             actualRows = computeOther(managed.size(), actualColumns);
             // remainder will be 0 if last row is filled
             lastRowRemainder = hpos != HPos.LEFT?
                  actualColumns - (actualColumns*actualRows - managed.size()) : 0;
         } else {
             // vertical
-            actualRows = computeRows(insideHeight, getTileHeight());
+            actualRows = computeRows(insideHeight, tileHeight);
             actualColumns = computeOther(managed.size(), actualRows);
             // remainder will be 0 if last column is filled
             lastColumnRemainder = vpos != VPos.TOP?
                 actualRows - (actualColumns*actualRows - managed.size()) : 0;
         }
         double rowX = left + computeXOffset(insideWidth,
-                                            computeContentWidth(actualColumns, getTileWidth()),
+                                            computeContentWidth(actualColumns, tileWidth),
                                             hpos);
         double columnY = top + computeYOffset(insideHeight,
-                                            computeContentHeight(actualRows, getTileHeight()),
+                                            computeContentHeight(actualRows, tileHeight),
                                             vpos);
 
         double lastRowX = lastRowRemainder > 0?
                           left + computeXOffset(insideWidth,
-                                            computeContentWidth(lastRowRemainder, getTileWidth()),
+                                            computeContentWidth(lastRowRemainder, tileWidth),
                                             hpos) :  rowX;
         double lastColumnY = lastColumnRemainder > 0?
                           top + computeYOffset(insideHeight,
-                                            computeContentHeight(lastColumnRemainder, getTileHeight()),
+                                            computeContentHeight(lastColumnRemainder, tileHeight),
                                             vpos) : columnY;
         double baselineOffset = getTileAlignmentInternal().getVpos() == VPos.BASELINE ?
-                getAreaBaselineOffset(managed, marginAccessor, i -> getTileWidth(), getTileHeight(), false) : -1;
+                getAreaBaselineOffset(managed, marginAccessor, i -> tileWidth, tileHeight, false) : -1;
 
         int r = 0;
         int c = 0;
@@ -951,12 +954,12 @@
             double xoffset = r == (actualRows - 1)? lastRowX : rowX;
             double yoffset = c == (actualColumns - 1)? lastColumnY : columnY;
 
-            double tileX = xoffset + (c * (getTileWidth() + hgap));
-            double tileY = yoffset + (r * (getTileHeight() + vgap));
+            double tileX = xoffset + (c * (tileWidth + hgap));
+            double tileY = yoffset + (r * (tileHeight + vgap));
 
             Pos childAlignment = getAlignment(child);
 
-            layoutInArea(child, tileX, tileY, getTileWidth(), getTileHeight(), baselineOffset,
+            layoutInArea(child, tileX, tileY, tileWidth, tileHeight, baselineOffset,
                     getMargin(child),
                     childAlignment != null? childAlignment.getHpos() : getTileAlignmentInternal().getHpos(),
                     childAlignment != null? childAlignment.getVpos() : getTileAlignmentInternal().getVpos());
--- a/modules/graphics/src/main/java/javafx/scene/text/FontWeight.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/java/javafx/scene/text/FontWeight.java	Tue Apr 15 13:22:04 2014 -0700
@@ -81,7 +81,7 @@
      */
     BLACK(900, "Black", "Heavy");
 
-    private int weight;
+    private final int weight;
     private final String[] names;
     
     private FontWeight(int weight, String... names) {
--- a/modules/graphics/src/main/java/javafx/scene/text/Text.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/java/javafx/scene/text/Text.java	Tue Apr 15 13:22:04 2014 -0700
@@ -41,7 +41,6 @@
 import com.sun.javafx.tk.Toolkit;
 import javafx.beans.DefaultProperty;
 import javafx.beans.InvalidationListener;
-import javafx.beans.Observable;
 import javafx.beans.binding.DoubleBinding;
 import javafx.beans.binding.ObjectBinding;
 import javafx.beans.property.*;
@@ -1891,6 +1890,12 @@
         switch (attribute) {
             case ROLE: return Role.TEXT;
             case TITLE: return getText();
+            case FONT: return getFont();
+            case CARET_OFFSET: {
+                int sel = getImpl_caretPosition();
+                if (sel >=  0) return sel;
+                return getText().length();
+            }
             case SELECTION_START: {
                 int sel = getImpl_selectionStart();
                 if (sel >=  0) return sel;
@@ -1905,6 +1910,35 @@
                 if (sel >=  0) return sel;
                 return getText().length();
             }
+            case LINE_FOR_OFFSET: {
+                int offset = (Integer)parameters[0];
+                TextLine[] lines = getTextLayout().getLines();
+                int lineIndex = 0;
+                for (int i = 1; i < lines.length; i++) {
+                    TextLine line = lines[i];
+                    if (line.getStart() > offset) break;
+                    lineIndex++;
+                }
+                return lineIndex;
+            }
+            case LINE_START: {
+                int lineIndex = (Integer)parameters[0];
+                TextLine[] lines = getTextLayout().getLines();
+                if (lineIndex < lines.length) {
+                    TextLine line = lines[lineIndex];
+                    return line.getStart();
+                }
+                return 0;
+            }
+            case LINE_END: {
+                int lineIndex = (Integer)parameters[0];
+                TextLine[] lines = getTextLayout().getLines();
+                if (lineIndex < lines.length) {
+                    TextLine line = lines[lineIndex];
+                    return line.getStart() + line.getLength();
+                }
+                return 0;
+            }
             default: return super.accGetAttribute(attribute, parameters);
         }
     }
--- a/modules/graphics/src/main/native-glass/gtk/glass_dnd.cpp	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/native-glass/gtk/glass_dnd.cpp	Tue Apr 15 13:22:04 2014 -0700
@@ -621,6 +621,9 @@
     }
 
     const char *cstring = mainEnv->GetStringUTFChars(string, NULL);
+    if (!cstring) {
+        return FALSE;
+    }
     gint size = strlen(cstring);
     
     gdk_property_change(requestor, property, GDK_SELECTION_TYPE_STRING,
@@ -639,16 +642,18 @@
     
     gboolean is_data_set = FALSE;
     const char *cstring = mainEnv->GetStringUTFChars(string, NULL);
-    gchar *res_str = g_convert((gchar *)cstring, -1, "ISO-8859-1", "UTF-8", NULL, NULL, NULL);
-    
-    if (res_str) {
-        gdk_property_change(requestor, property, GDK_SELECTION_TYPE_STRING,
-                8, GDK_PROP_MODE_REPLACE, (guchar *)res_str, strlen(res_str));
-        g_free(res_str);
-        is_data_set = TRUE;
+    if (cstring) {
+        gchar *res_str = g_convert((gchar *)cstring, -1, "ISO-8859-1", "UTF-8", NULL, NULL, NULL);
+
+        if (res_str) {
+            gdk_property_change(requestor, property, GDK_SELECTION_TYPE_STRING,
+                    8, GDK_PROP_MODE_REPLACE, (guchar *)res_str, strlen(res_str));
+            g_free(res_str);
+            is_data_set = TRUE;
+        }
+
+        mainEnv->ReleaseStringUTFChars(string, cstring);
     }
-    
-    mainEnv->ReleaseStringUTFChars(string, cstring);
     return is_data_set;
 }
 
@@ -745,23 +750,26 @@
     if (data) {
         if (mainEnv->IsInstanceOf(data, jStringCls)) {
             const char *cstring = mainEnv->GetStringUTFChars((jstring)data, NULL);
+            if (cstring) {
+                gdk_property_change(requestor, property, GDK_SELECTION_TYPE_STRING,
+                        8, GDK_PROP_MODE_REPLACE, (guchar *) cstring, strlen(cstring));
 
-            gdk_property_change(requestor, property, GDK_SELECTION_TYPE_STRING,
-                    8, GDK_PROP_MODE_REPLACE, (guchar *) cstring, strlen(cstring));
-        
-            mainEnv->ReleaseStringUTFChars((jstring)data, cstring);
-            is_data_set = TRUE;
+                mainEnv->ReleaseStringUTFChars((jstring)data, cstring);
+                is_data_set = TRUE;
+            }
         } else if (mainEnv->IsInstanceOf(data, jByteBufferCls)) {
             jbyteArray byteArray = (jbyteArray)mainEnv->CallObjectMethod(data, jByteBufferArray);
             if (!EXCEPTION_OCCURED(mainEnv)) {
                 jbyte* raw = mainEnv->GetByteArrayElements(byteArray, NULL);
-                jsize nraw = mainEnv->GetArrayLength(byteArray);
+                if (raw) {
+                    jsize nraw = mainEnv->GetArrayLength(byteArray);
 
-                gdk_property_change(requestor, property, target,
-                        8, GDK_PROP_MODE_REPLACE, (guchar *) raw, nraw);
+                    gdk_property_change(requestor, property, target,
+                            8, GDK_PROP_MODE_REPLACE, (guchar *) raw, nraw);
 
-                mainEnv->ReleaseByteArrayElements(byteArray, raw, JNI_ABORT);
-                is_data_set = TRUE;
+                    mainEnv->ReleaseByteArrayElements(byteArray, raw, JNI_ABORT);
+                    is_data_set = TRUE;
+                }
             }
         }
     }
--- a/modules/graphics/src/main/native-glass/lens/lensport/dispmanCursor.c	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/native-glass/lens/lensport/dispmanCursor.c	Tue Apr 15 13:22:04 2014 -0700
@@ -499,7 +499,8 @@
 extern int load_bcm_symbols();
 
 jboolean select_dispman_cursor(LensNativePort *lensPort) {
-    if (!load_bcm_symbols()) {
+    if (load_bcm_symbols() != 0) {
+        //this indicates an error on loading bcm libraries, thus we cannot use the dispman cursor impl
         return JNI_FALSE;
     }
 
--- a/modules/graphics/src/main/native-glass/lens/lensport/imx6Cursor.c	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/native-glass/lens/lensport/imx6Cursor.c	Tue Apr 15 13:22:04 2014 -0700
@@ -117,7 +117,7 @@
     }
 }
 
-/* Writes an image into the cursor framebuffer with the given x and y shits. */
+/* Writes an image into the cursor framebuffer with the given x and y shifts. */
 static void fbImx6WriteCursor(int fd, jbyte *cursorImage, int bpp) {
     int i, j, k;
     char buffer[256];
--- a/modules/graphics/src/main/native-glass/lens/lensport/wrapped_functions.c	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/native-glass/lens/lensport/wrapped_functions.c	Tue Apr 15 13:22:04 2014 -0700
@@ -121,18 +121,19 @@
 
 /*************************************** BROADCOM ******************************************/
 
-static int bcm_loaded = 0;
 
 int load_bcm_symbols() {
 #ifdef USE_DISPMAN
-    if (bcm_loaded) {
-        return useDispman;
+    static int bcm_loaded = -1;
+
+    if (bcm_loaded != -1) {
+        return bcm_loaded;
     }
-    bcm_loaded = 1;
 
     void *lib = dlopen("libbcm_host.so", RTLD_LAZY);
     if (!lib) {
-        return 1;
+        bcm_loaded = 1;
+        return bcm_loaded;
     }
 
     int error = 0;
@@ -160,8 +161,9 @@
     }
 
     useDispman = 1; 
+    bcm_loaded = 0;
 
-    return 0;
+    return bcm_loaded;
 #else
     return 1;
 #endif /* USE_DISPMAN */
@@ -236,12 +238,14 @@
     }
 
     if (!cached) {
-        if (useDispman) {
+        if (useVivanteFB)  {
+            if (wr_fbGetDisplayByIndex) {
+                cachedNativeDisplayType = wr_fbGetDisplayByIndex(0);
+            } else {
+               cachedNativeDisplayType = (EGLNativeDisplayType)0xBAD;
+            }
+        } else {
             cachedNativeDisplayType = EGL_DEFAULT_DISPLAY;
-        } else if (useVivanteFB)  {
-            cachedNativeDisplayType = wr_fbGetDisplayByIndex(0);
-        } else {
-            cachedNativeDisplayType = (EGLNativeDisplayType)NULL;
         }
 
         cached ++;
--- a/modules/graphics/src/main/native-glass/mac/GlassApplication.m	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/native-glass/mac/GlassApplication.m	Tue Apr 15 13:22:04 2014 -0700
@@ -591,6 +591,9 @@
 
             GLASS_CHECK_EXCEPTION(jEnv);
 
+            (*jEnv)->CallVoidMethod(jEnv, self->jApplication, javaIDs.MacApplication.notifyApplicationDidTerminate);
+            GLASS_CHECK_EXCEPTION(jEnv);
+            
             jint err = (*jVM)->DetachCurrentThread(jVM);
             if (err < 0)
             {
@@ -725,6 +728,9 @@
     javaIDs.Application.reportException = (*env)->GetStaticMethodID(
             env, jClass, "reportException", "(Ljava/lang/Throwable;)V");
 
+    javaIDs.MacApplication.notifyApplicationDidTerminate = (*env)->GetMethodID(
+            env, jClass, "notifyApplicationDidTerminate", "()V");
+
     if (jRunnableRun == NULL)
     {
         jRunnableRun = (*env)->GetMethodID(env, (*env)->FindClass(env, "java/lang/Runnable"), "run", "()V");
--- a/modules/graphics/src/main/native-glass/mac/GlassStatics.h	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/native-glass/mac/GlassStatics.h	Tue Apr 15 13:22:04 2014 -0700
@@ -112,6 +112,9 @@
         jmethodID reportException;
     } Application;
     struct {
+        jmethodID notifyApplicationDidTerminate;
+    } MacApplication;
+    struct {
         jmethodID rotateGesturePerformed;
         jmethodID scrollGesturePerformed;
         jmethodID swipeGesturePerformed;
--- a/modules/graphics/src/main/native-glass/win/FullScreenWindow.cpp	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/native-glass/win/FullScreenWindow.cpp	Tue Apr 15 13:22:04 2014 -0700
@@ -263,12 +263,15 @@
             break;
         case WM_ACTIVATE:
             {
-                if (LOWORD(wParam) == WA_INACTIVE && IsCommonDialogOwner()) {
+                // The fActive shouldn't be WA_INACTIVE && the window shouldn't be minimized:
+                const bool isFocusGained = LOWORD(wParam) != WA_INACTIVE && HIWORD(wParam) == 0;
+
+                if (!isFocusGained && IsCommonDialogOwner()) {
                     // Remain in full screen while a file dialog is showing
                     break;
                 }
 
-                HWND hWndInsertAfter = LOWORD(wParam) != WA_INACTIVE ? HWND_TOPMOST : HWND_BOTTOM;
+                HWND hWndInsertAfter = isFocusGained ? HWND_TOPMOST : HWND_BOTTOM;
 
                 if (m_bgWindow) {
                     ::SetWindowPos(m_bgWindow->GetHWND(), hWndInsertAfter, 0, 0, 0, 0,
@@ -279,14 +282,14 @@
 
                 GlassWindow * window = GlassWindow::FromHandle(m_oldViewParent);
                 if (window) {
-                    window->HandleActivateEvent(LOWORD(wParam) != WA_INACTIVE ?
+                    window->HandleActivateEvent(isFocusGained ?
                         com_sun_glass_events_WindowEvent_FOCUS_GAINED :
                         com_sun_glass_events_WindowEvent_FOCUS_LOST);
 
                     // Child windows don't have a taskbar button, therefore
                     // we force exiting from the FS mode if the window looses
                     // focus.
-                    if (LOWORD(wParam) == WA_INACTIVE) {
+                    if (!isFocusGained) {
                         ExitFullScreenMode(FALSE);
                     }
                 }
--- a/modules/graphics/src/main/native-glass/win/GlassWindow.cpp	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/native-glass/win/GlassWindow.cpp	Tue Apr 15 13:22:04 2014 -0700
@@ -309,15 +309,20 @@
             HandleDestroyEvent();
             return 0;
         case WM_ACTIVATE:
-            if (IsInFullScreenMode()) {
-                HWND hWndInsertAfter = LOWORD(wParam) != WA_INACTIVE ? HWND_TOPMOST : HWND_BOTTOM;
-                ::SetWindowPos(GetHWND(), hWndInsertAfter, 0, 0, 0, 0,
-                        SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOSIZE);
-            }
-            if (!GetDelegateWindow()) {
-                HandleActivateEvent(LOWORD(wParam) != WA_INACTIVE ?
-                        com_sun_glass_events_WindowEvent_FOCUS_GAINED :
-                        com_sun_glass_events_WindowEvent_FOCUS_LOST);
+            {
+                // The fActive shouldn't be WA_INACTIVE && the window shouldn't be minimized:
+                const bool isFocusGained = LOWORD(wParam) != WA_INACTIVE && HIWORD(wParam) == 0;
+
+                if (IsInFullScreenMode()) {
+                    HWND hWndInsertAfter = isFocusGained ? HWND_TOPMOST : HWND_BOTTOM;
+                    ::SetWindowPos(GetHWND(), hWndInsertAfter, 0, 0, 0, 0,
+                            SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOSIZE);
+                }
+                if (!GetDelegateWindow()) {
+                    HandleActivateEvent(isFocusGained ?
+                            com_sun_glass_events_WindowEvent_FOCUS_GAINED :
+                            com_sun_glass_events_WindowEvent_FOCUS_LOST);
+                }
             }
             // Let the DefWindowProc() set the focus to this window
             break;
--- a/modules/graphics/src/main/native-glass/win/Robot.cpp	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/native-glass/win/Robot.cpp	Tue Apr 15 13:22:04 2014 -0700
@@ -261,18 +261,21 @@
  */
 JNIEXPORT jint JNICALL Java_com_sun_glass_ui_win_WinRobot__1getPixelColor
     (JNIEnv *env, jobject jrobot, jint x, jint y)
-{
+{    
+    jint val = 0;
     //NOTE: we don't use the ::GetPixel() on the screen DC because it's not capable of
     //      getting the correct colors when non-opaque windows are present
     jintArray ia = (jintArray)env->NewIntArray(1);
+    if (ia) {
+        Java_com_sun_glass_ui_win_WinRobot__1getScreenCapture(env, jrobot, x, y, 1, 1, ia);
 
-    Java_com_sun_glass_ui_win_WinRobot__1getScreenCapture(env, jrobot, x, y, 1, 1, ia);
-
-    jint * elems = env->GetIntArrayElements(ia, NULL);
-    jint val = elems[0];
-    env->ReleaseIntArrayElements(ia, elems, 0);
-    env->DeleteLocalRef(ia);
-
+        jint * elems = env->GetIntArrayElements(ia, NULL);
+        if (elems) {
+            val = elems[0];
+        }
+        env->ReleaseIntArrayElements(ia, elems, 0);
+        env->DeleteLocalRef(ia);
+    }
     return val;
 }
 
@@ -327,43 +330,45 @@
 
     BITMAPINFO * pinfo = (BITMAPINFO *)(new BYTE[sizeof(BITMAPINFOHEADER) + 3 * sizeof(RGBQUAD) + pixelDataSize]);
 
-    // pixel data starts after 3 RGBQUADS for color masks
-    RGBQUAD *pixelData = &pinfo->bmiColors[3];
+    if (pinfo) {
+        // pixel data starts after 3 RGBQUADS for color masks
+        RGBQUAD *pixelData = &pinfo->bmiColors[3];
 
-    // prepare BITMAPINFO for a 32-bit RGB bitmap
-    ::memset(pinfo, 0, sizeof(*pinfo));
-    pinfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
-    pinfo->bmiHeader.biWidth = width;
-    pinfo->bmiHeader.biHeight = -height; // negative height means a top-down DIB
-    pinfo->bmiHeader.biPlanes = 1;
-    pinfo->bmiHeader.biBitCount = BITS_PER_PIXEL;
-    pinfo->bmiHeader.biCompression = BI_BITFIELDS;
+        // prepare BITMAPINFO for a 32-bit RGB bitmap
+        ::memset(pinfo, 0, sizeof(*pinfo));
+        pinfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+        pinfo->bmiHeader.biWidth = width;
+        pinfo->bmiHeader.biHeight = -height; // negative height means a top-down DIB
+        pinfo->bmiHeader.biPlanes = 1;
+        pinfo->bmiHeader.biBitCount = BITS_PER_PIXEL;
+        pinfo->bmiHeader.biCompression = BI_BITFIELDS;
 
-    // Setup up color masks
-    static const RGBQUAD redMask =   {0, 0, 0xFF, 0};
-    static const RGBQUAD greenMask = {0, 0xFF, 0, 0};
-    static const RGBQUAD blueMask =  {0xFF, 0, 0, 0};
+        // Setup up color masks
+        static const RGBQUAD redMask =   {0, 0, 0xFF, 0};
+        static const RGBQUAD greenMask = {0, 0xFF, 0, 0};
+        static const RGBQUAD blueMask =  {0xFF, 0, 0, 0};
 
-    pinfo->bmiColors[0] = redMask;
-    pinfo->bmiColors[1] = greenMask;
-    pinfo->bmiColors[2] = blueMask;
+        pinfo->bmiColors[0] = redMask;
+        pinfo->bmiColors[1] = greenMask;
+        pinfo->bmiColors[2] = blueMask;
 
-    // Get the bitmap data in device-independent, 32-bit packed pixel format
-    ::GetDIBits(hdcMem, hbitmap, 0, height, pixelData, pinfo, DIB_RGB_COLORS);
+        // Get the bitmap data in device-independent, 32-bit packed pixel format
+        ::GetDIBits(hdcMem, hbitmap, 0, height, pixelData, pinfo, DIB_RGB_COLORS);
 
-    // convert Win32 pixel format (BGRX) to Java format (ARGB)
-    ASSERT(sizeof(jint) == sizeof(RGBQUAD));
-    for(int nPixel = 0; nPixel < numPixels; nPixel++) {
-        RGBQUAD * prgbq = &pixelData[nPixel];
-        jint jpixel = WinToJavaPixel(prgbq->rgbRed, prgbq->rgbGreen, prgbq->rgbBlue);
-        // stuff the 32-bit pixel back into the 32-bit RGBQUAD
-        *prgbq = *( (RGBQUAD *)(&jpixel) );
+        // convert Win32 pixel format (BGRX) to Java format (ARGB)
+        ASSERT(sizeof(jint) == sizeof(RGBQUAD));
+        for(int nPixel = 0; nPixel < numPixels; nPixel++) {
+            RGBQUAD * prgbq = &pixelData[nPixel];
+            jint jpixel = WinToJavaPixel(prgbq->rgbRed, prgbq->rgbGreen, prgbq->rgbBlue);
+            // stuff the 32-bit pixel back into the 32-bit RGBQUAD
+            *prgbq = *( (RGBQUAD *)(&jpixel) );
+        }
+
+        // copy pixels into Java array
+        env->SetIntArrayRegion(pixelArray, 0, numPixels, (jint *)pixelData);
+        delete pinfo;
     }
 
-    // copy pixels into Java array
-    env->SetIntArrayRegion(pixelArray, 0, numPixels, (jint *)pixelData);
-    delete pinfo;
-
     // free all the GDI objects we made
     ::SelectObject(hdcMem, hOldBitmap);
     if (hOldPalette != NULL) {
--- a/modules/graphics/src/main/native-glass/win/ViewContainer.cpp	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/native-glass/win/ViewContainer.cpp	Tue Apr 15 13:22:04 2014 -0700
@@ -457,17 +457,20 @@
     JNIEnv* env = GetEnv();
 
     jcharArray jKeyChars = env->NewCharArray(keyCharCount);
-    if (keyCharCount) {
-        env->SetCharArrayRegion(jKeyChars, 0, keyCharCount, keyChars);
+    if (jKeyChars) {
+        if (keyCharCount) {
+            env->SetCharArrayRegion(jKeyChars, 0, keyCharCount, keyChars);
+            CheckAndClearException(env);
+        }
+
+        env->CallVoidMethod(GetView(), javaIDs.View.notifyKey,
+                            (msg == WM_KEYDOWN || msg == WM_SYSKEYDOWN) ?
+                            com_sun_glass_events_KeyEvent_PRESS : com_sun_glass_events_KeyEvent_RELEASE,
+                            jKeyCode, jKeyChars, jModifiers);
+        CheckAndClearException(env);
+
+        env->DeleteLocalRef(jKeyChars);
     }
-
-    env->CallVoidMethod(GetView(), javaIDs.View.notifyKey,
-                        (msg == WM_KEYDOWN || msg == WM_SYSKEYDOWN) ?
-                        com_sun_glass_events_KeyEvent_PRESS : com_sun_glass_events_KeyEvent_RELEASE,
-                        jKeyCode, jKeyChars, jModifiers);
-    CheckAndClearException(env);
-
-    env->DeleteLocalRef(jKeyChars);
 }
 
 void ViewContainer::HandleViewTypedEvent(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) 
@@ -479,19 +482,22 @@
     int repCount = LOWORD(lParam);
     JNIEnv* env = GetEnv();
     jcharArray jKeyChars = env->NewCharArray(repCount);
-    jchar* nKeyChars = env->GetCharArrayElements(jKeyChars, NULL);
-    for (int i = 0; i < repCount; i++) {
-        nKeyChars[i] = (jchar)wParam;
+    if (jKeyChars) {
+        jchar* nKeyChars = env->GetCharArrayElements(jKeyChars, NULL);
+        if (nKeyChars) {
+            for (int i = 0; i < repCount; i++) {
+                nKeyChars[i] = (jchar)wParam;
+            }
+            env->ReleaseCharArrayElements(jKeyChars, nKeyChars, 0);
+
+            env->CallVoidMethod(GetView(), javaIDs.View.notifyKey,
+                                com_sun_glass_events_KeyEvent_TYPED,
+                                com_sun_glass_events_KeyEvent_VK_UNDEFINED, jKeyChars, 
+                                GetModifiers());
+            CheckAndClearException(env);
+        }
+        env->DeleteLocalRef(jKeyChars);
     }
-    env->ReleaseCharArrayElements(jKeyChars, nKeyChars, 0);
-
-    env->CallVoidMethod(GetView(), javaIDs.View.notifyKey,
-                        com_sun_glass_events_KeyEvent_TYPED,
-                        com_sun_glass_events_KeyEvent_VK_UNDEFINED, jKeyChars, 
-                        GetModifiers());
-    CheckAndClearException(env);
-
-    env->DeleteLocalRef(jKeyChars);
 }
 
 BOOL ViewContainer::HandleViewMouseEvent(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -904,7 +910,10 @@
     if (cClause && rgClauseBoundary) {
         // convert clause boundary offset array to java array
         clauseBoundary = env->NewIntArray(cClause+1);
-        env->SetIntArrayRegion(clauseBoundary, 0, cClause+1, (jint *)rgClauseBoundary);
+        if (clauseBoundary) {
+            env->SetIntArrayRegion(clauseBoundary, 0, cClause+1, (jint *)rgClauseBoundary);
+            CheckAndClearException(env);
+        }
     }
 
     // attribute information
@@ -913,15 +922,22 @@
     if (cAttrBlock && rgAttrBoundary && rgAttrValue) {
         // convert attribute boundary offset array to java array
         attrBoundary = env->NewIntArray(cAttrBlock+1);
-        env->SetIntArrayRegion(attrBoundary, 0, cAttrBlock+1, (jint *)rgAttrBoundary);
+        if (attrBoundary) {
+            env->SetIntArrayRegion(attrBoundary, 0, cAttrBlock+1, (jint *)rgAttrBoundary);
+            CheckAndClearException(env);
+        }
         // convert attribute value byte array to java array
         attrValue = env->NewByteArray(cAttrBlock);
-        env->SetByteArrayRegion(attrValue, 0, cAttrBlock, (jbyte *)rgAttrValue);
+        if (attrValue) {
+            env->SetByteArrayRegion(attrValue, 0, cAttrBlock, (jbyte *)rgAttrValue);
+            CheckAndClearException(env);
+        }
     }
 
     env->CallBooleanMethod(GetView(), javaIDs.View.notifyInputMethod,
                         text, clauseBoundary, attrBoundary,
                         attrValue, commitedTextLength, caretPos, visiblePos);
+    CheckAndClearException(env);
 
     if (clauseBoundary) {
         env->DeleteLocalRef(clauseBoundary);
@@ -944,11 +960,12 @@
                         javaIDs.View.notifyInputMethodCandidatePosRequest,
                         0);
     nativePos = env->GetDoubleArrayElements(pos, NULL);
+    if (nativePos) {
+        curPos->x = (int)nativePos[0];
+        curPos->y  = (int)nativePos[1];
 
-    curPos->x = (int)nativePos[0];
-    curPos->y  = (int)nativePos[1];
-
-    env->ReleaseDoubleArrayElements(pos, nativePos, 0);
+        env->ReleaseDoubleArrayElements(pos, nativePos, 0);
+    }
 }
 
 namespace {
--- a/modules/graphics/src/main/native-prism-es2/eglfb/EGLFBGLDrawable.c	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/native-prism-es2/eglfb/EGLFBGLDrawable.c	Tue Apr 15 13:22:04 2014 -0700
@@ -60,7 +60,12 @@
 
     /* initialize the structure */
     initializeDrawableInfo(dInfo);
-    dInfo->egldisplay = eglGetDisplay(getNativeDisplayType());
+    EGLNativeDisplayType disptype = getNativeDisplayType();
+    if (disptype == (EGLNativeDisplayType)0xBAD) {
+        fprintf(stderr, "nCreateDrawable: Failed in getNativeDisplayType\n");
+        return 0;
+    }
+    dInfo->egldisplay = eglGetDisplay(disptype);
     dInfo->eglsurface = getSharedWindowSurface(dInfo->egldisplay,
                                                pfInfo->fbConfig,
                                                jlong_to_ptr(nativeWindow));
@@ -92,8 +97,14 @@
 
     /* initialize the structure */
     initializeDrawableInfo(dInfo);
+    EGLNativeDisplayType disptype = getNativeDisplayType();
+    if (disptype == (EGLNativeDisplayType)0xBAD) {
+        fprintf(stderr, "nGetDummyDrawable: Failed in getNativeDisplayType\n");
+        free(dInfo);
+        return 0;
+    }
     dInfo->egldisplay =
-        eglGetDisplay(getNativeDisplayType());
+        eglGetDisplay(disptype);
     dInfo->onScreen = JNI_FALSE;
     dInfo->eglsurface = getDummyWindowSurface(pfInfo->display,
                                               pfInfo->fbConfig);
--- a/modules/graphics/src/main/native-prism-es2/eglfb/EGLFBGLFactory.c	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/native-prism-es2/eglfb/EGLFBGLFactory.c	Tue Apr 15 13:22:04 2014 -0700
@@ -59,7 +59,12 @@
     EGLint numconfigs = 0;
     EGLint configId = 0;
 
-    EGLDisplay egldisplay = eglGetDisplay(getNativeDisplayType());
+    EGLNativeDisplayType disptype = getNativeDisplayType();
+    if (disptype == (EGLNativeDisplayType)0xBAD) {
+        fprintf(stderr, "nInitialize: Failed in getNativeDisplayType\n");
+        return 0;
+    }
+    EGLDisplay egldisplay = eglGetDisplay(disptype);
     if (EGL_NO_DISPLAY == egldisplay) {
         fprintf(stderr, "eglGetDisplay returned EGL_NO_DISPLAY");
         // cleanup
@@ -113,7 +118,7 @@
         return 0; // cleanup
     }
     /* Information required by GLass at startup */
-    ctxInfo->display = getNativeDisplayType();
+    ctxInfo->display = disptype;
     ctxInfo->gl2 = JNI_FALSE;
     eglDestroyContext(ctxInfo->egldisplay, ctxInfo->context);
     return ptr_to_jlong(ctxInfo);
--- a/modules/graphics/src/main/native-prism-es2/eglfb/EGLFBGLPixelFormat.c	Fri Apr 11 06:41:11 2014 -0700
+++ b/modules/graphics/src/main/native-prism-es2/eglfb/EGLFBGLPixelFormat.c	Tue Apr 15 13:22:04 2014 -0700
@@ -57,7 +57,12 @@
     setEGLAttrs(attrs, eglAttrs);
     (*env)->ReleaseIntArrayElements(env, attrArr, attrs, JNI_ABORT);
 
-    EGLDisplay egldisplay = eglGetDisplay(getNativeDisplayType());
+    EGLNativeDisplayType disptype = getNativeDisplayType();
+    if (disptype == (EGLNativeDisplayType)0xBAD) {
+        fprintf(stderr, "nCreatePixelFormat: Failed in getNativeDisplayType\n");
+        return 0;
+    }
+    EGLDisplay egldisplay = eglGetDisplay(disptype);
     if (EGL_NO_DISPLAY == egldisplay) {
         fprintf(stderr, "eglGetDisplay returned EGL_NO_DISPLAY");
         return 0;
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/ZoomTest.java	Fri Apr 11 06:41:11 2014 -0700
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/ZoomTest.java	Tue Apr 15 13:22:04 2014 -0700
@@ -30,13 +30,12 @@
 import javafx.geometry.Rectangle2D;
 import org.junit.Assert;
 import org.junit.Assume;
-import org.junit.Ignore;
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.runners.Parameterized;
 import java.util.Collection;
 
 /** Zoom tests with two touch points */
-@Ignore("RT-36595")
 public class ZoomTest extends ParameterizedTestBase {
 
     public ZoomTest(TestTouchDevice device) {
@@ -48,6 +47,11 @@
         return TestTouchDevices.getTouchDeviceParameters(2);
     }
 
+    @Before
+    public void verifyZoomEnabled() {
+        Assume.assumeTrue(Boolean.getBoolean("com.sun.javafx.gestures.zoom"));
+    }
+
     /**
      * Touch down two fingers,
      * drag upper finger up in order move but not enough for zooming,