Added RTL support to DecoratorPanel and improved RTL support in Showcase.  This patch is TBR.

Patch by: jlabanca



git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@2359 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/Application.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/Application.java
index 4220543..c8c2774 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/Application.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/Application.java
@@ -221,10 +221,11 @@
     windowWidth = width;
     int menuWidth = mainMenu.getOffsetWidth();
     int contentWidth = width - menuWidth - 30;
+    int contentWidthInner = width - menuWidth - 10;
     bottomPanel.setCellWidth(mainMenu, menuWidth + "px");
-    contentLayout.setWidth(contentWidth + "px");
-    contentLayout.getCellFormatter().setWidth(0, 0, contentWidth + "px");
-    contentLayout.getCellFormatter().setWidth(1, 0, contentWidth + "px");
+    bottomPanel.setCellWidth(contentLayout, contentWidth + "px");
+    contentLayout.getCellFormatter().setWidth(0, 0, contentWidthInner + "px");
+    contentLayout.getCellFormatter().setWidth(1, 0, contentWidthInner + "px");
   }
 
   /**
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/generator/ShowcaseGenerator.java b/samples/showcase/src/com/google/gwt/sample/showcase/generator/ShowcaseGenerator.java
index 79dd3b4..47b8715 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/generator/ShowcaseGenerator.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/generator/ShowcaseGenerator.java
@@ -236,7 +236,9 @@
       // Recurse the directory
       File[] subFiles = root.listFiles();
       for (int i = 0; i < subFiles.length; i++) {
-        generateRawFiles(subFiles[i]);
+        if (!subFiles[i].getName().equals(".svn")) {
+          generateRawFiles(subFiles[i]);
+        }
       }
     } else if (root.isFile()) {
       String fileContents = getFileContents(root);
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/public/Showcase.rtl.css b/samples/showcase/src/com/google/gwt/sample/showcase/public/Showcase.rtl.css
index 07276cf..4035b8f 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/public/Showcase.rtl.css
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/public/Showcase.rtl.css
@@ -61,14 +61,14 @@
 /**
  * Applied to widgets in the content area.
  */
-.Application-content-decorator .topRightInner, 
-.Application-content-decorator .middleRightInner, 
-.Application-content-decorator .bottomRightInner { 
+.Application-content-decorator .topLeftInner, 
+.Application-content-decorator .middleLeftInner, 
+.Application-content-decorator .bottomLeftInner { 
 	display: none;
 }
-.Application-content-decorator .middleCenter .topRightInner, 
-.Application-content-decorator .middleCenter .middleRightInner, 
-.Application-content-decorator .middleCenter .bottomRightInner { 
+.Application-content-decorator .middleCenter .topLeftInner, 
+.Application-content-decorator .middleCenter .middleLeftInner, 
+.Application-content-decorator .middleCenter .bottomLeftInner { 
   display: block;
 }
 .Application-content-title {
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/public/source/com.google.gwt.sample.showcase.client.content.lists.CwStackPanel.html b/samples/showcase/src/com/google/gwt/sample/showcase/public/source/com.google.gwt.sample.showcase.client.content.lists.CwStackPanel.html
index 1548043..e6dcb34 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/public/source/com.google.gwt.sample.showcase.client.content.lists.CwStackPanel.html
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/public/source/com.google.gwt.sample.showcase.client.content.lists.CwStackPanel.html
@@ -46,9 +46,8 @@
 
     /**
      * Use noimage.png, which is a blank 1x1 image.
-     * 
-     * @gwt.resource noimage.png
      */
+    @Resource("noimage.png")
     AbstractImagePrototype treeLeaf();
   }
 
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/public/source/com.google.gwt.sample.showcase.client.content.other.CwFrame.html b/samples/showcase/src/com/google/gwt/sample/showcase/public/source/com.google.gwt.sample.showcase.client.content.other.CwFrame.html
index 77fd3c9..4187b7d 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/public/source/com.google.gwt.sample.showcase.client.content.other.CwFrame.html
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/public/source/com.google.gwt.sample.showcase.client.content.other.CwFrame.html
@@ -21,7 +21,7 @@
   @Override
   public Widget onInitialize() {
     // Create a new frame
-    final Frame frame = new Frame("http://www.google.com");
+    final Frame frame = new Frame("GWT-default.css");
     frame.setSize("700px", "300px");
     frame.ensureDebugId("cwFrame");
 
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/public/source/com.google.gwt.sample.showcase.client.content.panels.CwDecoratorPanel.html b/samples/showcase/src/com/google/gwt/sample/showcase/public/source/com.google.gwt.sample.showcase.client.content.panels.CwDecoratorPanel.html
index fbe7bcc..e0ff4d5 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/public/source/com.google.gwt.sample.showcase.client.content.panels.CwDecoratorPanel.html
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/public/source/com.google.gwt.sample.showcase.client.content.panels.CwDecoratorPanel.html
@@ -24,7 +24,7 @@
     FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();
 
     // Add a title to the form
-    layout.setHTML(0, 0, "Enter Serch Criteria");
+    layout.setHTML(0, 0, "Enter Search Criteria");
     cellFormatter.setColSpan(0, 0, 2);
     cellFormatter.setHorizontalAlignment(0, 0,
         HasHorizontalAlignment.ALIGN_CENTER);
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/public/source/com.google.gwt.sample.showcase.client.content.widgets.CwCustomButton.html b/samples/showcase/src/com/google/gwt/sample/showcase/public/source/com.google.gwt.sample.showcase.client.content.widgets.CwCustomButton.html
index f92af7c..228f85f 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/public/source/com.google.gwt.sample.showcase.client.content.widgets.CwCustomButton.html
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/public/source/com.google.gwt.sample.showcase.client.content.widgets.CwCustomButton.html
@@ -39,6 +39,7 @@
     PushButton normalPushButton = new PushButton(
         Showcase.images.gwtLogo().createImage());
     normalPushButton.ensureDebugId("cwCustomButton-push-normal");
+    normalPushButton.addKeyboardListener(new KeyboardListenerAdapter());
     pushPanel.add(normalPushButton);
 
     // Add a disabled PushButton
@@ -52,6 +53,7 @@
     ToggleButton normalToggleButton = new ToggleButton(
         Showcase.images.gwtLogo().createImage());
     normalToggleButton.ensureDebugId("cwCustomButton-toggle-normal");
+    normalToggleButton.addKeyboardListener(new KeyboardListenerAdapter());
     togglePanel.add(normalToggleButton);
 
     // Add a disabled ToggleButton
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/public/style/com.google.gwt.sample.showcase.client.content.panels.CwDecoratorPanel.html b/samples/showcase/src/com/google/gwt/sample/showcase/public/style/com.google.gwt.sample.showcase.client.content.panels.CwDecoratorPanel.html
index 73a4aef..1ba2c13 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/public/style/com.google.gwt.sample.showcase.client.content.panels.CwDecoratorPanel.html
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/public/style/com.google.gwt.sample.showcase.client.content.panels.CwDecoratorPanel.html
@@ -7,10 +7,10 @@
 .gwt-DecoratorPanel .middleRight {
   background: url(images/vborder.png) repeat-y;
 }</pre><pre>
-.gwt-DecoratorPanel .topLeft,
-.gwt-DecoratorPanel .topRight,
-.gwt-DecoratorPanel .bottomLeft,
-.gwt-DecoratorPanel .bottomRight {
+.gwt-DecoratorPanel .topLeftInner,
+.gwt-DecoratorPanel .topRightInner,
+.gwt-DecoratorPanel .bottomLeftInner,
+.gwt-DecoratorPanel .bottomRightInner {
   width: 5px;
   height: 5px;
   zoom: 1;
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/public/style/com.google.gwt.sample.showcase.client.content.widgets.CwCustomButton.html b/samples/showcase/src/com/google/gwt/sample/showcase/public/style/com.google.gwt.sample.showcase.client.content.widgets.CwCustomButton.html
index ffa90ce..ed43f56 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/public/style/com.google.gwt.sample.showcase.client.content.widgets.CwCustomButton.html
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/public/style/com.google.gwt.sample.showcase.client.content.widgets.CwCustomButton.html
@@ -25,9 +25,8 @@
   border-bottom: 2px solid #625b54;
   cursor: default;
   opacity: 0.5;
-}</pre><pre>
-.gwt-PushButton-up-disabled .gwt-Image {
   filter: alpha(opacity=30);
+  zoom: 1;
 }</pre><pre>
 .gwt-PushButton-down {
   padding: 2px 1px 2px 3px;
@@ -55,6 +54,8 @@
   border-bottom: 2px solid #625b54;
   cursor: default;
   opacity: 0.5;
+  filter: alpha(opacity=30);
+  zoom: 1;  
 }</pre><pre>
 .gwt-PushButton-down-disabled .gwt-Image {
   filter: alpha(opacity=30);
@@ -85,9 +86,8 @@
   border-bottom: 2px solid #625b54;
   cursor: default;
   opacity: 0.5;
-}</pre><pre>
-.gwt-ToggleButton-up-disabled .gwt-Image {
-  filter: alpha(opacity=30);
+  filter: alpha(opacity=40);
+  zoom: 1;
 }</pre><pre>
 .gwt-ToggleButton-down {
   padding: 2px 1px 2px 3px;
@@ -115,7 +115,6 @@
   border-bottom: 2px solid #625b54;
   cursor: default;
   opacity: 0.5;
-}</pre><pre>
-.gwt-ToggleButton-down-disabled .gwt-Image {
-  filter: alpha(opacity=30);
+  filter: alpha(opacity=40);
+  zoom: 1;
 }</pre>
\ No newline at end of file
diff --git a/user/src/com/google/gwt/user/client/ui/DecoratorPanel.java b/user/src/com/google/gwt/user/client/ui/DecoratorPanel.java
index 5ed9464..0ec52cf 100644
--- a/user/src/com/google/gwt/user/client/ui/DecoratorPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/DecoratorPanel.java
@@ -15,6 +15,7 @@
  */
 package com.google.gwt.user.client.ui;
 
+import com.google.gwt.i18n.client.LocaleInfo;
 import com.google.gwt.user.client.DOM;
 import com.google.gwt.user.client.Element;
 
@@ -86,9 +87,15 @@
   static Element createTR(String styleName) {
     Element trElem = DOM.createTR();
     setStyleName(trElem, styleName);
-    DOM.appendChild(trElem, createTD(styleName + "Left"));
-    DOM.appendChild(trElem, createTD(styleName + "Center"));
-    DOM.appendChild(trElem, createTD(styleName + "Right"));
+    if (LocaleInfo.getCurrentLocale().isRTL()) {
+      DOM.appendChild(trElem, createTD(styleName + "Right"));
+      DOM.appendChild(trElem, createTD(styleName + "Center"));
+      DOM.appendChild(trElem, createTD(styleName + "Left"));
+    } else {
+      DOM.appendChild(trElem, createTD(styleName + "Left"));
+      DOM.appendChild(trElem, createTD(styleName + "Center"));
+      DOM.appendChild(trElem, createTD(styleName + "Right"));
+    }
     return trElem;
   }