changeset 6504:5159a070e730

RT-28458: add rtl icons for HTMLEditor. Fix bug in SimpleSelector causing rtl selection to fail
author David Grieve<david.grieve@oracle.com>
date Tue, 18 Mar 2014 11:51:33 -0400
parents 2b9df4db108e
children d3f5ba2e8117
files modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Bullets-Black-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Bullets-Black@2x-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Bullets-White-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Bullets-White@2x-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Bullets-Yellow-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Bullets-Yellow@2x-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Bullets-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Bullets@2x-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Indent-Black-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Indent-Black@2x-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Indent-White-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Indent-White@2x-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Indent-Yellow-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Indent-Yellow@2x-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Indent-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Indent@2x-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Numbered-Black-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Numbered-Black@2x-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Numbered-White-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Numbered-White@2x-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Numbered-Yellow-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Numbered-Yellow@2x-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Numbered-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Numbered@2x-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Outdent-Black-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Outdent-Black@2x-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Outdent-White-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Outdent-White@2x-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Outdent-Yellow-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Outdent-Yellow@2x-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Outdent-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Outdent@2x-rtl.png modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/blackOnWhite.css modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/modena.css modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/whiteOnBlack.css modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/yellowOnBlack.css modules/graphics/src/main/java/com/sun/javafx/css/SimpleSelector.java modules/web/src/main/java/com/sun/javafx/scene/web/skin/HTMLEditorSkin.java
diffstat 38 files changed, 65 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Bullets-Black-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Bullets-Black@2x-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Bullets-White-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Bullets-White@2x-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Bullets-Yellow-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Bullets-Yellow@2x-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Bullets-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Bullets@2x-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Indent-Black-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Indent-Black@2x-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Indent-White-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Indent-White@2x-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Indent-Yellow-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Indent-Yellow@2x-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Indent-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Indent@2x-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Numbered-Black-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Numbered-Black@2x-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Numbered-White-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Numbered-White@2x-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Numbered-Yellow-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Numbered-Yellow@2x-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Numbered-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Numbered@2x-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Outdent-Black-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Outdent-Black@2x-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Outdent-White-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Outdent-White@2x-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Outdent-Yellow-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Outdent-Yellow@2x-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Outdent-rtl.png has changed
Binary file modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/HTMLEditor-Outdent@2x-rtl.png has changed
--- a/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/blackOnWhite.css	Tue Mar 18 11:51:33 2014 -0400
+++ b/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/blackOnWhite.css	Tue Mar 18 11:51:33 2014 -0400
@@ -153,20 +153,38 @@
 .html-editor-outdent:hover:armed {
     -fx-graphic: url("HTMLEditor-Outdent-Black.png");
 }
+.html-editor-outdent:dir(rtl),
+.html-editor-outdent:hover:armed:dir(rtl) {
+    -fx-graphic: url("HTMLEditor-Outdent-Black-rtl.png");
+}
 .html-editor-indent,
 .html-editor-indent:hover:armed {
     -fx-graphic: url("HTMLEditor-Indent-Black.png");
 }
+.html-editor-indent:dir(rtl),
+.html-editor-indent:hover:armed:dir(rtl) {
+    -fx-graphic: url("HTMLEditor-Indent-Black-rtl.png");
+}
 .html-editor-bullets,
 .html-editor-bullets:hover:armed,
 .html-editor-bullets:selected:armed {
     -fx-graphic: url("HTMLEditor-Bullets-Black.png");
 }
+.html-editor-bullets:dir(rtl),
+.html-editor-bullets:hover:armed:dir(rtl),
+.html-editor-bullets:selected:armed:dir(rtl) {
+    -fx-graphic: url("HTMLEditor-Bullets-Black-rtl.png");
+}
 .html-editor-numbers,
 .html-editor-numbers:hover:armed,
 .html-editor-numbers:selected:armed {
     -fx-graphic: url("HTMLEditor-Numbered-Black.png");
 }
+.html-editor-numbers:dir(rtl),
+.html-editor-numbers:hover:armed:dir(rtl),
+.html-editor-numbers:selected:armed:dir(rtl) {
+    -fx-graphic: url("HTMLEditor-Numbered-Black-rtl.png");
+}
 .html-editor-bold,
 .html-editor-bold:hover:armed,
 .html-editor-bold:selected:armed {
@@ -506,4 +524,4 @@
 .default-color7.chart-series-area-fill { -fx-fill: CHART_COLOR_8_TRANS_20; }
 .area-legend-symbol {
     -fx-background-insets: 0, 2;
-}
\ No newline at end of file
+}
--- a/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/modena.css	Tue Mar 18 11:51:33 2014 -0400
+++ b/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/modena.css	Tue Mar 18 11:51:33 2014 -0400
@@ -1358,15 +1358,27 @@
 .html-editor-outdent {
     -fx-graphic: url("HTMLEditor-Outdent.png");
 }
+.html-editor-outdent:dir(rtl) {
+    -fx-graphic: url("HTMLEditor-Outdent-rtl.png");
+}
 .html-editor-indent {
     -fx-graphic: url("HTMLEditor-Indent.png");
 }
+.html-editor-indent:dir(rtl) {
+    -fx-graphic: url("HTMLEditor-Indent-rtl.png");
+}
 .html-editor-bullets {
     -fx-graphic: url("HTMLEditor-Bullets.png");
 }
+.html-editor-bullets:dir(rtl) {
+    -fx-graphic: url("HTMLEditor-Bullets-rtl.png");
+}
 .html-editor-numbers {
     -fx-graphic: url("HTMLEditor-Numbered.png");
 }
+.html-editor-numbers:dir(rtl) {
+    -fx-graphic: url("HTMLEditor-Numbered-rtl.png");
+}
 .html-editor-bold {
     -fx-graphic: url("HTMLEditor-Bold.png");
 }
--- a/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/whiteOnBlack.css	Tue Mar 18 11:51:33 2014 -0400
+++ b/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/whiteOnBlack.css	Tue Mar 18 11:51:33 2014 -0400
@@ -132,15 +132,27 @@
 .html-editor-outdent {
     -fx-graphic: url("HTMLEditor-Outdent-White.png");
 }
+.html-editor-outdent:dir(rtl) {
+    -fx-graphic: url("HTMLEditor-Outdent-White-rtl.png");
+}
 .html-editor-indent {
     -fx-graphic: url("HTMLEditor-Indent-White.png");
 }
+.html-editor-indent:dir(rtl) {
+    -fx-graphic: url("HTMLEditor-Indent-White-rtl.png");
+}
 .html-editor-bullets {
     -fx-graphic: url("HTMLEditor-Bullets-White.png");
 }
+.html-editor-bullets:dir(rtl) {
+    -fx-graphic: url("HTMLEditor-Bullets-White-rtl.png");
+}
 .html-editor-numbers {
     -fx-graphic: url("HTMLEditor-Numbered-White.png");
 }
+.html-editor-numbers:dir(rtl) {
+    -fx-graphic: url("HTMLEditor-Numbered-White-rtl.png");
+}
 .html-editor-bold {
     -fx-graphic: url("HTMLEditor-Bold-White.png");
 }
@@ -486,4 +498,4 @@
 }
 .chart-pie-label {
     -fx-fill: -fx-hover-base;
-}
\ No newline at end of file
+}
--- a/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/yellowOnBlack.css	Tue Mar 18 11:51:33 2014 -0400
+++ b/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/yellowOnBlack.css	Tue Mar 18 11:51:33 2014 -0400
@@ -163,15 +163,27 @@
 .html-editor-outdent {
     -fx-graphic: url("HTMLEditor-Outdent-Yellow.png");
 }
+.html-editor-outdent:dir(rtl) {
+    -fx-graphic: url("HTMLEditor-Outdent-Yellow-rtl.png");
+}
 .html-editor-indent {
     -fx-graphic: url("HTMLEditor-Indent-Yellow.png");
 }
+.html-editor-indent:dir(rtl) {
+    -fx-graphic: url("HTMLEditor-Indent-Yellow-rtl.png");
+}
 .html-editor-bullets {
     -fx-graphic: url("HTMLEditor-Bullets-Yellow.png");
 }
+.html-editor-bullets:dir(rtl) {
+    -fx-graphic: url("HTMLEditor-Bullets-Yellow-rtl.png");
+}
 .html-editor-numbers {
     -fx-graphic: url("HTMLEditor-Numbered-Yellow.png");
 }
+.html-editor-numbers:dir(rtl) {
+    -fx-graphic: url("HTMLEditor-Numbered-Yellow-rtl.png");
+}
 .html-editor-bold {
     -fx-graphic: url("HTMLEditor-Bold-Yellow.png");
 }
@@ -600,4 +612,4 @@
 }
 .chart-pie-label {
     -fx-fill: -fx-hover-base;
-}
\ No newline at end of file
+}
--- a/modules/graphics/src/main/java/com/sun/javafx/css/SimpleSelector.java	Tue Mar 18 11:51:33 2014 -0400
+++ b/modules/graphics/src/main/java/com/sun/javafx/css/SimpleSelector.java	Tue Mar 18 11:51:33 2014 -0400
@@ -201,17 +201,17 @@
         // handle functional pseudo-class :dir()
         // INHERIT applies to both :dir(rtl) and :dir(ltr)
         if (nodeOrientation != INHERIT && styleable instanceof Node) {
-            
-            final Scene scene = ((Node)styleable).getScene();
-            final NodeOrientation effectiveNodeOrientation =
-                    scene.getEffectiveNodeOrientation();
-            
-            if (effectiveNodeOrientation != INHERIT &&
-                    effectiveNodeOrientation != nodeOrientation) {
+            final Node node = (Node)styleable;
+            final NodeOrientation orientation = node.getNodeOrientation();
+
+            if (orientation == INHERIT
+                    ? node.getEffectiveNodeOrientation() != nodeOrientation
+                    : orientation != nodeOrientation)
+            {
                 return false;
             }
         }
-        
+
         // if the selector has an id,
         // then bail if it doesn't match the node's id
         // (do this first since it is potentially the cheapest check)
--- a/modules/web/src/main/java/com/sun/javafx/scene/web/skin/HTMLEditorSkin.java	Tue Mar 18 11:51:33 2014 -0400
+++ b/modules/web/src/main/java/com/sun/javafx/scene/web/skin/HTMLEditorSkin.java	Tue Mar 18 11:51:33 2014 -0400
@@ -824,15 +824,6 @@
             htmlDocumentElement.setAttribute("dir", (orientation == RIGHT_TO_LEFT) ? "rtl" : "ltr");
         }
 
-        if (orientation == RIGHT_TO_LEFT) {
-            try {
-                final String iconName = resources.getString("numbersIcon-rtl");
-                Image icon = AccessController.doPrivileged((PrivilegedAction<Image>) () -> new Image(HTMLEditorSkin.class.getResource(iconName).toString()));
-                numbersButton.setGraphic(new ImageView(icon));
-            } catch (java.util.MissingResourceException ex) {
-                // ignore
-            }
-        }
     }
 
     private void updateToolbarState(final boolean updateAlignment) {