com.jalios.jcms.widget
Class WidgetManager

java.lang.Object
  extended by com.jalios.jcms.widget.WidgetManager

public class WidgetManager
extends Object


Method Summary
 String getIcon(String src, String title, String alt, String clazz, String style, String onclick, String id)
          Build an html icon
 String getInputText(String fieldType, String fieldName, String fieldValue, String css, boolean disabled, String fieldId, int size, int maxLength, int tabindex, String customAttributes, String lang)
          Returns a text input
static WidgetManager getInstance()
           
 String getLangAttributes(String lang)
           
 String getLinkField(String fieldName, String fieldValue, String fieldLabel, String css, boolean disabled, String fieldId, int size, int maxLength, int tabindex, String customAttributes, String lang)
          Returns 2 text input that represents a JCMS Data Link
 String getSelectField(String fieldName, Collection<?> fieldLabel, Collection<?> fieldValue, Object selectedValue, String css, boolean disabled, boolean blank, String fieldId, int tabindex, String customAttributes, String lang)
          Returns a select box
 String getTextArea(String fieldName, String fieldValue, String css, boolean disabled, boolean escapeEntities, String fieldId, int cols, int rows, int tabindex, String customAttributes, String lang)
          Returns a text area
 String getTooltip(String tip)
          Returns the tooltip for the given tips.
 boolean isRichTextDisabled()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static WidgetManager getInstance()

isRichTextDisabled

public boolean isRichTextDisabled()

getInputText

public String getInputText(String fieldType,
                           String fieldName,
                           String fieldValue,
                           String css,
                           boolean disabled,
                           String fieldId,
                           int size,
                           int maxLength,
                           int tabindex,
                           String customAttributes,
                           String lang)
Returns a text input

Parameters:
fieldType - the field type (hidden,password,text)
fieldName - the field name
fieldValue - the field value (quote will be escaped)
css - the classes of the input field
disabled - the field is disabled
fieldId - the field ID (Warning should not be used with dynamic context)
size - the field length in cars (Warning should be set in CSS)
maxLength - the field max length in cars (Warning should be checked in javascript)
tabindex - the tabindex (Warning should not be used with dynamic context)
customAttributes - custom attributes to append at the end of the input (onclick, ...)
lang - the language of the input (@see #getLangAttributes()) (lang, xml:lang, dir)

getTextArea

public String getTextArea(String fieldName,
                          String fieldValue,
                          String css,
                          boolean disabled,
                          boolean escapeEntities,
                          String fieldId,
                          int cols,
                          int rows,
                          int tabindex,
                          String customAttributes,
                          String lang)
Returns a text area

Parameters:
fieldName - the field name
fieldValue - the field value (quote will be escaped)
css - the classes of the input field
disabled - the field is disabled
escapeEntities - will escape html entities
fieldId - the field ID (Warning should not be used with dynamic context)
cols - the field length in cars (Warning should be set in CSS)
rows - the field rows in lines (Warning should be set in CSS)
tabindex - the tabindex (Warning should not be used with dynamic context)
customAttributes - custom attributes to append at the end of the input (onclick, ...)
lang - the language of the input (@see #getLangAttributes()) (lang, xml:lang, dir)

getLinkField

public String getLinkField(String fieldName,
                           String fieldValue,
                           String fieldLabel,
                           String css,
                           boolean disabled,
                           String fieldId,
                           int size,
                           int maxLength,
                           int tabindex,
                           String customAttributes,
                           String lang)
Returns 2 text input that represents a JCMS Data Link

Parameters:
fieldName - the field name
fieldValue - the field value (quote will be escaped)
fieldLabel - the value of the field label (quote will be escaped)
css - the classes of the input field
disabled - the field is disabled
fieldId - the field ID (Warning should not be used with dynamic context)
size - the field length in cars (Warning should be set in CSS)
maxLength - the field max length in cars (Warning should be checked in javascript)
tabindex - the tabindex (Warning should not be used with dynamic context)
customAttributes - custom attributes to append at the end of the input (onclick, ...)
lang - the language of the input (@see #getLangAttributes()) (lang, xml:lang, dir)

getSelectField

public String getSelectField(String fieldName,
                             Collection<?> fieldLabel,
                             Collection<?> fieldValue,
                             Object selectedValue,
                             String css,
                             boolean disabled,
                             boolean blank,
                             String fieldId,
                             int tabindex,
                             String customAttributes,
                             String lang)
Returns a select box

Parameters:
fieldName - the field name
fieldLabel - the collection of labels
fieldValue - the collection of values
selectedValue - the field value (quote will be escaped)
css - the classes of the input field
disabled - the field is disabled
blank - if true generate an empty option
fieldId - the field ID (Warning should not be used with dynamic context)
tabindex - the tabindex (Warning should not be used with dynamic context)
customAttributes - custom attributes to append at the end of the input (onclick, ...)
lang - the language of the input (@see #getLangAttributes()) (lang, xml:lang, dir)

getIcon

public String getIcon(String src,
                      String title,
                      String alt,
                      String clazz,
                      String style,
                      String onclick,
                      String id)
Build an html icon

Parameters:
src - the image URL or Sprite
title - the image title
alt - the image alt
clazz - the css class
style - the css style
onclick - the onclick value
id - the id
Returns:
the image tag representation

getTooltip

public String getTooltip(String tip)
Returns the tooltip for the given tips. Tips without spaces ' ' are treated as Properties

Parameters:
tip - String for the tooltip
Returns:
String the tooltip

getLangAttributes

public String getLangAttributes(String lang)


Copyright © 2001-2010 Jalios SA. All Rights Reserved.