gwt /
gwt /
44cb42a8e0c47c67277fbfc49780f652d74ba51e Adds support for RTL layout in GWT. Here are the specific changes:
-adds the dir="rtl" attribute to the <html> element on the first call to RootPanel.get(id) or RootPanel.get(), provided that the application's current locale is one with an RTL language
-Sets the default alignment of the HorizontalPanel to be "left" in LTR layout, and "right" in RTL layout
-DockPanel defines two new direction constants - LINE_START and LINE_END. They are bidi-friendly constants. In an RTL environment, LINE_START corresponds to the right side of the DockPanel. In an LTR environment, LINE_START corresponds to the left side of the DockPanel. WEST and EAST are now ALWAYS west and east - they do not vary based on directionality. WEST is always on the left, and EAST is always on the right.
-changes the layout of the Tree based on the directionality of the document - branches expand to the left when the layout is RTL. Also changed keyboard navigation - in an RTL layout, the left key expands branches, and the right key collapses them. Also added TreeImagesRTL, which extends TreeImages. This is a future extension point in case we end up using tree icons that are not direction-agnostic.
-changes the layout of Menus so that submenus pop out to the left in an RTL layout; also changed keyboard navigation so that the left key expands submenus in an RTL layout. Changed MenuBar so that it accepts an image bundle as input to its ctor for its images, and added the MenuImagesRTL bundle, which contains the rtl versions of the menu images.
-added the DisclosureImagesRTL image bundle, which contains rtl versions of DisclosurePanel's default images.
-adds support for HorizontalSplitPanel in an RTL layout. Two methods have been added to support the adding of widgets to the panel that is at the "start of the line layout" and "end of the line layout", as opposed to just LEFT and RIGHT (this is similar to the change that was made to DockPanel). Also, the positioning of widgets with HorizontalSplitPanel.add() is right pane first, and then left pane. setSplitPosition still sets the size of the left pane in RTL mode.
-TextArea, TextBox, and Label implement the HasDirection interface. This interface allows those widgets that implement it to set their own directionality, thereby overriding the global direction.
-KitchenSink's tabs have been modified to 'look pretty' in RTL mode. This required the addition of another rounded corner image for use in RTL mode. While making this change, I also cleaned up (hopefully) some of the style switching code for first vs. other tabs, selected vs. unselected tabs. The existing code did not take advantage of dependent style names, so I updated the code to do so.
-User.gwt.xml now includes the I18N module. This change was necessary in order to support the use of LocaleInfo in the user libraries without having to move the LocaleInfo class into the user.client package
-Removed LocaleInfo_none_Test. This test was used to test that LocaleInfo functioned correctly when the I18N module was not included. Due to the above-mentioned change, this test is no longer relevant
-Addition of BidiUtils.java. This utility class defines two static methods setDirectionOnElement(elem, Direction) and getDirection(elem). All of the current implementations of HasDirection basically delegate to these two helper methods.
-Added an RTL-version of the submenu icon. In the future, this bundle containing both images should probably be replaced by a locale-sensitive FooBundle
Patch By: adil.allawi, shanjian, rdayal, jgw, knorton, jat, ecc
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@2350 8db76d5a-ed1c-0410-87a9-c151d255dfc7
30 files changed