com.extjs.gxt.ui.client.util
Class Format

java.lang.Object
  extended by com.extjs.gxt.ui.client.util.Format

public class Format
extends java.lang.Object

Formatting functions.


Constructor Summary
Format()
           
 
Method Summary
static java.lang.String camelize(java.lang.String s)
           
static java.lang.String capitalize(java.lang.String value)
           
static java.lang.String ellipse(java.lang.String value, int len)
          Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length.
static java.lang.String escape(java.lang.String s)
           
static java.lang.String fileSize(int size)
           
static java.lang.String htmlDecode(java.lang.String value)
           
static java.lang.String htmlEncode(java.lang.String value)
           
static java.lang.String hyphenize(java.lang.String name)
           
static java.lang.String stripScripts(java.lang.String v)
           
static java.lang.String stripTags(java.lang.String v)
           
static java.lang.String substitute(java.lang.String text, int param)
          Substitutes the indexed parameters.
static java.lang.String substitute(java.lang.String text, java.util.Map<java.lang.String,java.lang.Object> params)
          Substitutes the named parameters.
static java.lang.String substitute(java.lang.String text, java.lang.Object... params)
          Substitutes the indexed parameters.
static java.lang.String substitute(java.lang.String text, Params params)
          Substitutes the parameters.
static java.lang.String substitute(java.lang.String text, java.lang.String[] keys, java.util.Map<java.lang.String,java.lang.Object> params)
          Substitutes the named parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Format

public Format()
Method Detail

camelize

public static java.lang.String camelize(java.lang.String s)

capitalize

public static java.lang.String capitalize(java.lang.String value)

ellipse

public static java.lang.String ellipse(java.lang.String value,
                                       int len)
Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length.

Parameters:
value - the string to truncate
len - the maximum length to allow before truncating
Returns:
the converted text

escape

public static java.lang.String escape(java.lang.String s)

fileSize

public static java.lang.String fileSize(int size)

htmlDecode

public static java.lang.String htmlDecode(java.lang.String value)

htmlEncode

public static java.lang.String htmlEncode(java.lang.String value)

hyphenize

public static java.lang.String hyphenize(java.lang.String name)

stripScripts

public static java.lang.String stripScripts(java.lang.String v)

stripTags

public static java.lang.String stripTags(java.lang.String v)

substitute

public static java.lang.String substitute(java.lang.String text,
                                          int param)
Substitutes the indexed parameters.

Parameters:
text - the text
param - the parameter
Returns:
the new text

substitute

public static java.lang.String substitute(java.lang.String text,
                                          java.util.Map<java.lang.String,java.lang.Object> params)
Substitutes the named parameters. The passed keys and values must be Strings.

Parameters:
text - the text
params - the parameters
Returns:
the new text

substitute

public static java.lang.String substitute(java.lang.String text,
                                          Params params)
Substitutes the parameters.

Parameters:
text - the text
params - the parameters
Returns:
the new text

substitute

public static java.lang.String substitute(java.lang.String text,
                                          java.lang.Object... params)
Substitutes the indexed parameters.

Parameters:
text - the text
params - the parameters
Returns:
the new text

substitute

public static java.lang.String substitute(java.lang.String text,
                                          java.lang.String[] keys,
                                          java.util.Map<java.lang.String,java.lang.Object> params)
Substitutes the named parameters. The passed keys and values must be Strings.

Parameters:
text - the text
keys - the parameter names
params - the parameter values
Returns:
the new text