com.cc.framework.ui.javascript
Class JavaScriptUtil

java.lang.Object
  extended bycom.cc.framework.ui.javascript.JavaScriptUtil

public abstract class JavaScriptUtil
extends java.lang.Object

Helper Class for JavaScript Resources

Since:
1.5
Version:
$Revision: 1.8 $
Author:
Gernot Schulz

Constructor Summary
private JavaScriptUtil()
          Constructor
 
Method Summary
static java.lang.String createStringArrayLiteral(java.lang.String[] arr)
          Creates a String representation to initialize a JavaScript array.
static java.lang.String createStringLiteral(int value)
          Creates a JavaScript String literal
static java.lang.String createStringLiteral(java.lang.Object value)
          Creates a JavaScript String literal
static java.lang.String doCreateJSImage(java.lang.String resourceId, ImageModel imageModel)
          Creates a Javascript Icon Object which is used to generate images
static java.lang.String escapeString(java.lang.Object raw)
          Creates a String representation that is compatible with JavaScript syntax
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaScriptUtil

private JavaScriptUtil()
Constructor

Method Detail

doCreateJSImage

public static java.lang.String doCreateJSImage(java.lang.String resourceId,
                                               ImageModel imageModel)
Creates a Javascript Icon Object which is used to generate images

Parameters:
resourceId - The id for this resource
imageModel - The image model, containing the information from the registered image
Returns:
A String like Icon(id, resPath, src, width, height, tooltip, alt)

createStringArrayLiteral

public static java.lang.String createStringArrayLiteral(java.lang.String[] arr)
Creates a String representation to initialize a JavaScript array.

Example ['item1', 'item2', ... , 'itemN']

Parameters:
arr - The array which should be transformed into a String
Returns:
The String representation for the array

escapeString

public static java.lang.String escapeString(java.lang.Object raw)
Creates a String representation that is compatible with JavaScript syntax

Parameters:
raw - The string which should be transformed into a Java Script String
Returns:
The string in valid JavaScript Syntax

createStringLiteral

public static java.lang.String createStringLiteral(int value)
Creates a JavaScript String literal

Parameters:
value - value
Returns:
JavaScript String literal

createStringLiteral

public static java.lang.String createStringLiteral(java.lang.Object value)
Creates a JavaScript String literal

Parameters:
value - value
Returns:
JavaScript String literal


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.