1 29 30 package nextapp.echo2.webcontainer.propertyrender; 31 32 import java.util.Locale ; 33 34 import nextapp.echo2.app.LayoutDirection; 35 import nextapp.echo2.webrender.output.CssStyle; 36 37 41 public class LayoutDirectionRender { 42 43 50 public static String renderCssAttributeValue(LayoutDirection layoutDirection) { 51 return layoutDirection.isLeftToRight() ? "ltr" : "rtl"; 52 } 53 54 69 public static void renderToStyle(CssStyle cssStyle, LayoutDirection layoutDirection, Locale locale) { 70 if (layoutDirection == null) { 71 if (locale == null) { 72 return; 73 } 74 layoutDirection = LayoutDirection.forLocale(locale); 75 } 76 cssStyle.setAttribute("direction", renderCssAttributeValue(layoutDirection)); 77 } 78 79 80 private LayoutDirectionRender() { } 81 } 82 | Popular Tags |