org.apache.myfaces.trinidadinternal.style.util
Class NameUtils

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.style.util.NameUtils

public class NameUtils
extends java.lang.Object

Utilities for converting between variant names and ids

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/util/NameUtils.java#0 $) $Date: 10-nov-2005.18:58:52 $
Author:
The Oracle ADF Faces Team

Method Summary
static int getBrowser(java.lang.String browserName)
          Returns the id of the browser with the specified name
static java.lang.String getBrowserName(int browser)
          Returns the name of the specified browser id
static java.lang.String getContextName(StyleContext context)
          Returns name for the specified context, suitable for inclusion in a file name.
static java.lang.String getContextName(StyleContext context, StyleSheetDocument document)
          Returns name for the specified context, based on the actual matching style sheets in the document.
static int getDirection(java.lang.String directionName)
          Returns the direction value for the specified name.
static java.lang.String getDirectionName(int direction)
          Returns the name of the specified direction
static int getMode(java.lang.String modeName)
           
static java.lang.String getModeName(int mode)
           
static int getPlatform(java.lang.String platformName)
          Returns the platform with the specified name
static java.lang.String getPlatformName(int platform)
          Returns the name of the specified platform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBrowser

public static int getBrowser(java.lang.String browserName)
Returns the id of the browser with the specified name


getBrowserName

public static java.lang.String getBrowserName(int browser)
Returns the name of the specified browser id


getDirection

public static int getDirection(java.lang.String directionName)
Returns the direction value for the specified name.


getMode

public static int getMode(java.lang.String modeName)

getDirectionName

public static java.lang.String getDirectionName(int direction)
Returns the name of the specified direction


getModeName

public static java.lang.String getModeName(int mode)

getPlatform

public static int getPlatform(java.lang.String platformName)
Returns the platform with the specified name


getPlatformName

public static java.lang.String getPlatformName(int platform)
Returns the name of the specified platform


getContextName

public static java.lang.String getContextName(StyleContext context)
Returns name for the specified context, suitable for inclusion in a file name.

This utility method generates the context-specific portion of a style sheet file name. It combines that locale, direction, agent and color scheme information provided by the context, and returns a name which can be embedded in a file name - eg. "en_US-ltr-ie-4-windows-red".

Parameters:
context - The context for which a name is generated.

getContextName

public static java.lang.String getContextName(StyleContext context,
                                              StyleSheetDocument document)
Returns name for the specified context, based on the actual matching style sheets in the document.

Like getContextName(StyleContext), this utility method generates the context-specific portion of a style sheet file name. However, getContextName(StyleContext) always returns a fully specified name. This version of getContextName() returns a partially specified name - only those variants which match the underlying style sheets are included in the returned name.

So, where getContextName(StyleContext) might return a name with placeholders for unknown variants, eg:

styles-en_US-ie-0-0-0-default.css

This method would return the partially specified name:

styles-en_US-ie-default.css

Parameters:
context - The context for which a name is generated.


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.