|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jalios.jcms.widget.WidgetUtil
public class WidgetUtil
Nested Class Summary | |
---|---|
static class |
WidgetUtil.TinyMceSpellChecker
RPC Class used by TinyMCE spellchecker |
Fields inherited from interface com.jalios.util.JaliosConstants |
---|
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR |
Constructor Summary | |
---|---|
WidgetUtil()
|
Method Summary | |
---|---|
static void |
addWikiwygJavaScripts(JcmsJspContext jcmsContext)
Add the required JavaScript files to the current context |
static void |
addWysiwygJavaScripts(JcmsJspContext jcmsContext)
Add the required JavaScript files to the current context |
static String |
getHtmlHidden(String widgetName,
String value)
Convenient method that build an input hidden field calling printHiddenField |
static String |
getHtmlIcon(String src,
String title)
Build an icon |
static String |
getHtmlIcon(String src,
String title,
String alt)
Build an icon |
static String |
getHtmlIcon(String src,
String title,
String id,
String style,
String onclick)
Build an icon |
static String |
getHtmlIcon(String src,
String title,
String alt,
String id,
String style,
String onclick)
Build an icon |
static String |
getLangTab(String widget,
String lang)
Return ONE Lang Tab for a given lang with a given widget has content. |
static String |
getPropertyEditor(String name)
Returns the editor associated to the given default Property. |
static String |
getShortProperty(String key)
Return the value of the property without the editor value |
static String |
getShortProperty(String key,
String editor)
Return the value of the property without the editor value |
static String |
printConfirmSubmitFormButton(String label,
String action,
String formName,
String msg,
String userLang)
Display a Button that will ask to confirm the action |
static String |
printConfirmSubmitFormButton(String label,
String action,
String formName,
String msg,
String userLang,
int tabindex)
|
protected static void |
printDataChooser(StringBuffer sb,
String ctxPath,
String formField,
String formName,
String alt,
int pos,
String jsp,
String chooserQS,
int width,
int height,
String icon)
|
static void |
printDataSourceSelect(StringBuffer sb,
String widgetName,
String dataSource,
String userLang)
This method write to the buffer a select box of sql datasource. |
static void |
printDBRecordChooser(StringBuffer sb,
String ctxPath,
String formField,
String formName,
String alt,
int pos,
String chooserQS)
Print a DBRecord Chooser |
static void |
printDescription(StringBuffer sb,
String formDescription)
Print the field Description |
static void |
printHiddenField(StringBuffer sb,
String widgetName,
String value)
Print Hidden Input |
static void |
printHiddenField(StringBuffer sb,
String widgetName,
String value,
String style,
String id)
Print Hidden Input |
static String |
printHtmlButton(String widgetName,
String value,
boolean submit,
String onClick,
boolean isMainAction)
Print an HTML Button |
static String |
printHtmlButton(String widgetName,
String value,
boolean submit,
String onClick,
boolean isMainAction,
int tabindex)
|
static void |
printInfo(StringBuffer sb,
String formInfo)
Print the field Info |
static void |
printInputBox(StringBuffer sb,
String inputId,
String fieldName,
String fieldValue,
String fieldLabel,
boolean check,
boolean selected,
boolean disabled,
int tabindex,
String customAttributes,
String lang)
Print an input Checkbox or Radio button |
static String |
printInputBox(String fieldId,
String fieldName,
String fieldValue,
String fieldLabel,
boolean check,
boolean selected,
boolean disabled,
int tabindex,
String lang)
|
static String |
printInputBox(String fieldId,
String fieldName,
String fieldValue,
String fieldLabel,
boolean check,
boolean selected,
boolean disabled,
int tabindex,
String customAttributes,
String lang)
|
static void |
printInputBoxList(StringBuffer sb,
Collection<?> fieldIds,
String fieldName,
Collection<?> fieldValue,
Collection<?> fieldLabel,
boolean check,
Collection<?> selected,
boolean br,
boolean disabled,
int tabindex,
String customAttributes,
String lang)
Print an html list of check/radio box |
static void |
printInputComboBox(StringBuffer sb,
String fieldId,
String fieldName,
Collection<?> fieldValue,
Collection<?> fieldLabel,
String selected,
boolean blank,
int tabindex,
boolean disabled,
String custom,
String lang)
Print a ComboBox |
static void |
printInputListBox(StringBuffer sb,
String fieldId,
String fieldName,
int size,
Collection<?> fieldValue,
Collection<?> fieldLabel,
Collection<?> selected,
boolean disabled,
int tabindex,
String customs,
String lang)
Print a ListBox |
static void |
printLabel(StringBuffer sb,
String formLabel,
String inputId)
Print the field Label |
static void |
printLabel(StringBuffer sb,
String formLabel,
String[] inputId)
Print the field label. |
static void |
printLangAttributes(StringBuffer sb,
String lang)
Appends the html language attributes to use for the given language. |
static void |
printMandatory(StringBuffer sb)
Print the Mandatory for a given field |
protected static void |
printMoveFormElement(StringBuffer sb,
String jsfunc,
String formField,
String formName,
String action,
String icon,
String alt,
int pos,
int relFirst,
String formFieldId)
|
static String |
printPopupButton(String label,
String url)
|
static void |
printRichTextZone(StringBuffer sb,
String fieldName,
String fieldValue,
int cols,
int rows,
int tabindex,
int count,
boolean inline,
String wysiwygParams,
String wysiwygCss,
String lang)
Print a Rich Text Area |
static void |
printSeparator(StringBuffer sb,
String formField)
Print a HR separator and an Anchor for the field |
static String |
printSubmitButton(String label,
String action)
Return a Submit HTML Button with a given label/action |
static String |
printSubmitButton(String label,
String action,
int tabindex)
|
static String |
printSubmitFormButton(String label,
String action,
String formName,
String userLang)
Display a Button that will submit form for a given action |
static String |
printSubmitFormButton(String label,
String action,
String formName,
String userLang,
int tabindex)
|
static void |
printUnits(StringBuffer sb,
String formUnit)
Print the units for field |
static void |
printWikiwyg(StringBuffer sb,
String fieldName,
String fieldValue,
int cols,
int rows,
int tabindex,
int count,
boolean inline,
String wysiwygParams,
String lang)
Print a Wysiwyg Wiki Text Area |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
public static final String CSS_BUTTON
public static final String CSS_MAIN_BUTTON
public static final String CSS_TEXTAREA
public static final String CSS_WIKIWYG
public static final String CSS_WIKIWYG_POPUP
public static final String CSS_RICHTEXT
public static final String CSS_RICHTEXT_POPUP
public static final String CSS_CHECKBOX
public static final String CSS_RADIOBOX
public static final String CSS_LABELBOX
public static final String CSS_COMBOBOX
public static final String CSS_SELECTBOX
public static final String CSS_LISTBOX
public static final String CSS_TEXTFIELD
public static final String CSS_UPLOADFIELD
public static final String CSS_CHOOSERFIELD
public static final String CSS_CHOOSERLABELFIELD
public static final String CSS_UNITS
public static final String CSS_MANDATORY
public static final String CSS_LABEL
public static final String CSS_DESCRIPTION
public static final String CSS_INFO
public static final String ICON_EDIT
public static final String ICON_CLEAR
public static final String ICON_PLUS
public static final String ICON_FIELD_UP
public static final String ICON_FIELD_DOWN
public static final String ICON_ARROW_UP
public static final String ICON_ARROW_DOWN
public static final String ICON_ARROW_LEFT
public static final String ICON_ARROW_RIGHT
public static final String ICON_TRASH
public static final String ICON_DATE
public static final String ICON_FOLDER
public static final String ICON_IMAGE_CHOOSER
public static final String ICON_MEDIA_CHOOSER
public static final String ICON_COLOR_CHOOSER
public static final String ICON_QUERY_CHOOSER
public static final String ICON_MEMBER_CHOOSER
public static final String ICON_GROUP_CHOOSER
public static final String ICON_WORKSPACE_CHOOSER
public static final String ICON_CATEGORY_CHOOSER
public static final String ICON_PUB_CHOOSER
public static final String ICON_DBRECORD_CHOOSER
public static final String ICON_DOC_CHOOSER
public static final String ICON_DOC_RECHOOSER
public static final String ICON_ACL_CHOOSER
public static final String ICON_MULTILANG
public static final String SPRITE_CLEAR
public static final String SPRITE_REMOVE
public static final String SPRITE_ADD
public static final String SPRITE_COLOR_CHOOSER
public static final String SPRITE_IMAGE_CHOOSER
public static final String SPRITE_MEDIA_CHOOSER
public static final String SPRITE_DOC_CHOOSER
public static final String SPRITE_PUB_CHOOSER
public static final String SPRITE_CAT_CHOOSER
public static final String SPRITE_EYE
public static final String SPRITE_DOC_EYE
public static final String SPRITE_DATE
public static final String SPRITE_QUERY_CHOOSER
public static final String SPRITE_MEMBER_CHOOSER
public static final String SPRITE_GROUP_CHOOSER
public static final String SPRITE_WORKSPACE_CHOOSER
public static final String SPRITE_CATEGORY_CHOOSER
public static final String SPRITE_ACL_CHOOSER
public static final String HAS_RICHTEXT
Constructor Detail |
---|
public WidgetUtil()
Method Detail |
---|
public static String getHtmlIcon(String src, String title)
src
- the image sourcetitle
- the image title
public static String getHtmlIcon(String src, String title, String alt)
src
- the image sourcetitle
- the image titlealt
- the image alt
public static String getHtmlIcon(String src, String title, String id, String style, String onclick)
src
- the image URLtitle
- the image titleid
- the idstyle
- the styleonclick
- the onclick value
public static String getHtmlIcon(String src, String title, String alt, String id, String style, String onclick)
src
- the image URLtitle
- the image titlealt
- the image altid
- the idstyle
- the styleonclick
- the onclick value
public static String getHtmlHidden(String widgetName, String value)
widgetName
- the name of the hidden fieldvalue
- the value of the hidden field
public static String getLangTab(String widget, String lang)
widget
- the widget to putlang
- the lang of the tab
public static String getPropertyEditor(String name)
name
- the default property name
public static String getShortProperty(String key)
key
- the full extra key
public static String getShortProperty(String key, String editor)
key
- the full extra keyeditor
- the editor
public static String printHtmlButton(String widgetName, String value, boolean submit, String onClick, boolean isMainAction)
widgetName
- the name of the buttonvalue
- the value of the buttonsubmit
- is a submit buttononClick
- is onClick actionisMainAction
- if true use
public static String printHtmlButton(String widgetName, String value, boolean submit, String onClick, boolean isMainAction, int tabindex)
public static String printPopupButton(String label, String url)
public static String printSubmitButton(String label, String action)
label
- the label of the buttonaction
- the name of the action while submitting
public static String printSubmitButton(String label, String action, int tabindex)
public static String printSubmitFormButton(String label, String action, String formName, String userLang)
label
- the label of the buttonaction
- the name of the action while submittingformName
- the name of the formuserLang
- the current userLang
public static String printSubmitFormButton(String label, String action, String formName, String userLang, int tabindex)
public static String printConfirmSubmitFormButton(String label, String action, String formName, String msg, String userLang)
label
- the label of the buttonaction
- the name of the action while submittingformName
- the name of the formmsg
- an I18N confirm messageuserLang
- the current userLang
public static String printConfirmSubmitFormButton(String label, String action, String formName, String msg, String userLang, int tabindex)
public static void printHiddenField(StringBuffer sb, String widgetName, String value, String style, String id)
sb
- the BufferwidgetName
- the widget namevalue
- the valuestyle
- id
- public static void printHiddenField(StringBuffer sb, String widgetName, String value)
sb
- the BufferwidgetName
- the widget namevalue
- the valuepublic static void printRichTextZone(StringBuffer sb, String fieldName, String fieldValue, int cols, int rows, int tabindex, int count, boolean inline, String wysiwygParams, String wysiwygCss, String lang)
sb
- the BufferfieldName
- the name of the widgetfieldValue
- the value of the widgetcols
- the "TextArea" like colsrows
- the "TextArea" like rowstabindex
- the tab indexcount
- for multivalued fields, this is the index of the textareainline
- set to false to use a popup edition (instead of the inline editor,
a preview/source zone is displayed with a edit button which opens a popup)wysiwygParams
- the wysiwyg parameterswysiwygCss
- WYSIWYG css to use instead of the expected "formRichText" or "formRichTextPopup". Used to trigger a custom configuration of TinyMCE editorlang
- the language (ISO-639) of this rich text zone or null for default site language.public static void printWikiwyg(StringBuffer sb, String fieldName, String fieldValue, int cols, int rows, int tabindex, int count, boolean inline, String wysiwygParams, String lang)
sb
- the BufferfieldName
- the name of the widgetfieldValue
- the value of the widgetcols
- the "TextArea" like colsrows
- the "TextArea" like rowstabindex
- the tab indexcount
- for multivalued fields, this is the index of the textareainline
- set to false to use a popup edition (instead of the inline editor,
a preview/source zone is displayed with a edit button which opens a popup)wysiwygParams
- the wysiwyg parameterslang
- the language (ISO-639) of this rich text zone or null for default site language.public static void addWikiwygJavaScripts(JcmsJspContext jcmsContext)
jcmsContext
- public static void addWysiwygJavaScripts(JcmsJspContext jcmsContext)
jcmsContext
- public static void printInputBox(StringBuffer sb, String inputId, String fieldName, String fieldValue, String fieldLabel, boolean check, boolean selected, boolean disabled, int tabindex, String customAttributes, String lang)
sb
- the bufferinputId
- fieldName
- the name of the widgetfieldValue
- the value of the widgetfieldLabel
- the label of the widgetcheck
- checkbox or radio button ?selected
- selected or not ?disabled
- true to disabled the input boxtabindex
- customAttributes
- the custom attributes to add to each inputlang
- the language (ISO-639) of this text area or null for default site language.public static String printInputBox(String fieldId, String fieldName, String fieldValue, String fieldLabel, boolean check, boolean selected, boolean disabled, int tabindex, String lang)
public static String printInputBox(String fieldId, String fieldName, String fieldValue, String fieldLabel, boolean check, boolean selected, boolean disabled, int tabindex, String customAttributes, String lang)
public static void printInputBoxList(StringBuffer sb, Collection<?> fieldIds, String fieldName, Collection<?> fieldValue, Collection<?> fieldLabel, boolean check, Collection<?> selected, boolean br, boolean disabled, int tabindex, String customAttributes, String lang)
sb
- the bufferfieldIds
- the DOM ids item : must be null or contains as many elements as fieldValue and fieldLabelfieldName
- the name of the widgetfieldValue
- the values of the widgetfieldLabel
- the labels of the widgetcheck
- checkbox or radio button ?selected
- a Set of selected valuesbr
- should append brdisabled
- true to disabled the inputstabindex
- customAttributes
- the custom attributes to add to each inputlang
- the language (ISO-639) of this text area or null for default site language.public static void printInputComboBox(StringBuffer sb, String fieldId, String fieldName, Collection<?> fieldValue, Collection<?> fieldLabel, String selected, boolean blank, int tabindex, boolean disabled, String custom, String lang)
sb
- the bufferfieldId
- the id of the fieldfieldName
- the name of the widgetfieldValue
- the values of the widgetfieldLabel
- the labels of the widgetselected
- the selected Stringblank
- disabled
- true to disable the combo boxtabindex
- custom
- custom html attribute to be added inside the select taglang
- the language (ISO-639) of this text area or null for default site language.public static void printInputListBox(StringBuffer sb, String fieldId, String fieldName, int size, Collection<?> fieldValue, Collection<?> fieldLabel, Collection<?> selected, boolean disabled, int tabindex, String customs, String lang)
sb
- the bufferfieldId
- the id of the fieldfieldName
- the name of the widgetsize
- size of the selectfieldValue
- the values of the widgetfieldLabel
- the labels of the widgetselected
- the selected Stringdisabled
- true to disabled the input listboxtabindex
- customs
- custom html attribute to be added inside the select taglang
- the language (ISO-639) of this text area or null for default site language.public static void printDBRecordChooser(StringBuffer sb, String ctxPath, String formField, String formName, String alt, int pos, String chooserQS)
sb
- the BufferctxPath
- the context pathformField
- the field nameformName
- the form namealt
- the icon altpos
- the relative widget positionchooserQS
- queryString for the chooserpublic static void printDataSourceSelect(StringBuffer sb, String widgetName, String dataSource, String userLang)
sb
- the BufferwidgetName
- the widget namedataSource
- the selected datasourceuserLang
- the userlangpublic static void printLangAttributes(StringBuffer sb, String lang)
sb
- the StringBuffer in which to append the class namelang
- the language of the class to generated or null to use default jcms languageChannel.isUsingAdvancedI18N()
public static void printUnits(StringBuffer sb, String formUnit)
sb
- the BufferformUnit
- public static void printMandatory(StringBuffer sb)
sb
- the Bufferpublic static void printLabel(StringBuffer sb, String formLabel, String inputId)
sb
- the BufferformLabel
- inputId
- if not null, the given label is linked to the input with DOM idpublic static void printLabel(StringBuffer sb, String formLabel, String[] inputId)
sb
- formLabel
- inputId
- array of ids of the input. Used in a "for" attribute.public static void printDescription(StringBuffer sb, String formDescription)
sb
- the BufferformDescription
- public static void printInfo(StringBuffer sb, String formInfo)
sb
- the BufferformInfo
- public static void printSeparator(StringBuffer sb, String formField)
sb
- the BufferformField
- nameprotected static void printMoveFormElement(StringBuffer sb, String jsfunc, String formField, String formName, String action, String icon, String alt, int pos, int relFirst, String formFieldId)
protected static void printDataChooser(StringBuffer sb, String ctxPath, String formField, String formName, String alt, int pos, String jsp, String chooserQS, int width, int height, String icon)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |