com.ibm.xsp.util
Class DirLangUtil

java.lang.Object
  extended by com.ibm.xsp.util.DirLangUtil

public class DirLangUtil
extends java.lang.Object

Utility for checking RTL/LTR settings


Field Summary
static java.lang.String DIR
          Corresponds to the dir attribute
static java.lang.String LANG
          Corresponds to the lang attribute
protected static java.lang.String LANG_ARABIC
          Corresponds to the ar language code
protected static java.lang.String LANG_CZECH
          Corresponds to the cs language code
protected static java.lang.String LANG_HEBREW
          Corresponds to the he language code
protected static java.lang.String LANG_HEBREW_ALT
          Corresponds to the iw language code
protected static java.lang.String LANG_PERSIAN
          Corresponds to the fa language code
protected static java.lang.String LANG_POLISH
          Corresponds to the pl language code
protected static java.lang.String LANG_URDU
          Corresponds to the ur language code
static java.lang.String RTL
          Corresponds to the rtl attribute
 
Constructor Summary
DirLangUtil()
           
 
Method Summary
static boolean isCzechPolish(javax.faces.context.FacesContext context)
          Utility method for checking is the current locale czech or polish
static boolean isLanguageRtl(java.lang.String lang)
          Utility method for checking if a language uses Right to Left
static boolean isRTL(javax.faces.component.UIComponent component)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIR

public static final java.lang.String DIR
Corresponds to the dir attribute

See Also:
Constant Field Values

RTL

public static final java.lang.String RTL
Corresponds to the rtl attribute

See Also:
Constant Field Values

LANG

public static final java.lang.String LANG
Corresponds to the lang attribute

See Also:
Constant Field Values

LANG_ARABIC

protected static final java.lang.String LANG_ARABIC
Corresponds to the ar language code

See Also:
Constant Field Values

LANG_HEBREW

protected static final java.lang.String LANG_HEBREW
Corresponds to the he language code

See Also:
Constant Field Values

LANG_HEBREW_ALT

protected static final java.lang.String LANG_HEBREW_ALT
Corresponds to the iw language code

See Also:
Constant Field Values

LANG_URDU

protected static final java.lang.String LANG_URDU
Corresponds to the ur language code

See Also:
Constant Field Values

LANG_PERSIAN

protected static final java.lang.String LANG_PERSIAN
Corresponds to the fa language code

See Also:
Constant Field Values

LANG_CZECH

protected static final java.lang.String LANG_CZECH
Corresponds to the cs language code

See Also:
Constant Field Values

LANG_POLISH

protected static final java.lang.String LANG_POLISH
Corresponds to the pl language code

See Also:
Constant Field Values
Constructor Detail

DirLangUtil

public DirLangUtil()
Method Detail

isRTL

public static boolean isRTL(javax.faces.component.UIComponent component)
Parameters:
component - Check the current component for a dir or a lang property. If setting found, use that. If no setting found, go to the parent and try again. If the current component is UIViewRootEx, then try its locale setting for language.
Returns:
true if component is RTL and false if it is LTR

isCzechPolish

public static boolean isCzechPolish(javax.faces.context.FacesContext context)
Utility method for checking is the current locale czech or polish

Parameters:
{@link - javax.faces.context.FacesContext}
Returns:
true if locale is either czech or polish, false if not

isLanguageRtl

public static boolean isLanguageRtl(java.lang.String lang)
Utility method for checking if a language uses Right to Left

Parameters:
lang -
Returns:
true is lang is either arabic,urdu,persian,hebrew. false if anything else.