|
HATS 7.5.1 Web API ReferencePublicly accessible methods not documented here are for IBM internal use only and may change in a future release of the product. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.hats.transform.widgets.HTMLWidgetUtilities
public class HTMLWidgetUtilities
HTMLWidgetUtilities is a class which represents a collection of static convenience methods to be used in the development of Widgets which implement the HTMLRenderer interface.
| Field Summary | |
|---|---|
static String |
BIDI_ALREADY_REORDERED
|
static String |
CLASS_NAME
|
protected static String |
COPYRIGHT
The HsrCopyright.COPYRIGHT field will be updated each release, thereby "magically" updating this class file. |
static String |
PROPERTY_ESCAPETAGS
|
| Constructor Summary | |
|---|---|
HTMLWidgetUtilities()
Constructor for HTMLWidgetUtilities. |
|
| Method Summary | |
|---|---|
static String |
activeItemTrim(String val)
|
static String |
activeItemTrim(String val,
boolean padIfZero)
|
static String |
activeItemTrim(String val,
boolean padIfZero,
boolean leaveExtra)
|
static void |
bidiTransformWidgetDescription(InputComponentElement ice,
Properties settings,
ContextAttributes contextAttributes)
|
static void |
completeHtmlEscape(String s,
StringBuffer buffer,
boolean escapeSpaces)
HTML escapes a string (optionally escaping spaces), builds escaped string in the specified string bufffer |
static String |
convertBidi_oneline(String in,
ContextAttributes contextAttributes,
boolean disableReordering,
String dirMarker,
Properties settings,
String screenOrientation,
int codepage)
|
static String |
convertBidi_oneline(String in,
ContextAttributes contextAttributes,
boolean disableReordering,
String dirMarker,
Properties settings,
String screenOrientation,
int codepage,
boolean nobr)
|
static String |
convertBidi(String in,
ContextAttributes contextAttributes)
|
static String |
convertBidi(String in,
ContextAttributes contextAttributes,
boolean disableReordering,
String dirMarker,
Properties settings,
String screenOrientation,
int codepage)
|
static String |
convertBidi(String in,
ContextAttributes contextAttributes,
boolean disableReordering,
String dirMarker,
Properties settings,
String screenOrientation,
int codepage,
boolean nobr)
|
static String |
convertBidi(String in,
Hashtable contextAttributes)
Deprecated. |
static String |
convertBidi(String in,
Hashtable contextAttributes,
boolean disableReordering,
String dirMarker,
Properties settings,
String screenOrientation,
int codepage)
Deprecated. |
static void |
doSymSwap(StringBuffer s)
|
static void |
exactCursorDefaultProperties(Properties defaults)
creates default settings for widgets using the exact cursor positioning option |
static String |
fixImageLink(String in)
|
static String |
fixReversedHTMLSegment(String buf,
boolean SymSwap,
boolean fixBrackets)
|
static StringBuffer |
fixReversedHTMLSegment(StringBuffer buf,
boolean SymSwap,
boolean fixBrackets)
|
static String |
getDefaultElementStyle(String element)
Gets the default CSS class for a particular type of element, e.g., HTMLElementFactory.LINK_CLASS gets HATSLINK. |
static String[] |
getForegroundColorStyleClasses()
Gets a static array of CSS classes indexed by foreground colors (0-15), e.g., 4 gets HRED. |
static String |
getReversedColor(String htmlColor)
Deprecated. Does not work. |
static String |
getReversedVideoClass(String foregroundColor)
|
static String |
getStyleClassPropertyName(String type)
Convenience method for creating a formatted property name denoting a CSS class mapping. |
static String |
HandleRTLReplacement(String buf,
boolean useBDO)
|
static StringBuffer |
HandleRTLReplacement(StringBuffer buf,
boolean useBDO)
|
static void |
hideElement(HTMLElement e)
Hide a given HTML element |
static String |
htmlEscape(boolean escapeHTMLtags,
String s)
HTML escapes a string (optionally escaping spaces), builds escaped string in the specified string buffer |
static String |
htmlEscape(boolean escapeHTMLtags,
String s,
boolean escapeSpaces)
HTML escapes a string (optionally escaping spaces), builds escaped string in the specified string buffer |
static void |
htmlEscape(boolean escapeHTMLtags,
String s,
StringBuffer buffer)
HTML escapes a string (optionally escaping spaces), builds escaped string in the specified string buffer |
static void |
htmlEscape(boolean escapeHTMLtags,
String s,
StringBuffer buffer,
boolean escapeSpaces)
HTML escapes a string (optionally escaping spaces), builds escaped string in the specified string buffer |
static String |
htmlEscape(String s)
HTML escapes a string. |
static String |
htmlEscape(String s,
boolean escapeSpaces)
HTML escapes a string, optionally escapes spaces |
static void |
htmlEscape(String s,
StringBuffer buffer)
HTML escapes a string, builds escaped string in the specified string bufffer |
static void |
htmlEscape(String s,
StringBuffer buffer,
boolean escapeSpaces)
HTML escapes a string (optionally escaping spaces), builds escaped string in the specified string buffer. |
static void |
main(String[] args)
|
static void |
makeAccessible(HTMLElement target,
String description,
HTMLElementFactory factory,
ContextAttributes contextAttributes,
StringBuffer buffer)
Sticks an html id attribute on the targeted element, then creates an AccessibilityLabelElement pointing to it with the specified description, then renders it to the specified buffer. |
static void |
makeAccessible(HTMLElement target,
String description,
HTMLElementFactory factory,
Hashtable contextAttributes,
StringBuffer buffer)
Deprecated. |
static Map |
processCSSOverrides(Properties settings)
Constructs a HashMap of CSS class keys to CSS classes from the Widget settings. |
static void |
renderAccessibleAndExactCursor(HTMLElement target,
HTMLElementFactory factory,
ContextAttributes contextAttributes,
StringBuffer buffer,
boolean renderAccessible,
boolean renderExactCursor,
Properties defaults,
Properties settings,
String description)
Adds an html id attribute on the targeted element. |
static void |
renderAsAccessible(HTMLElement target,
String description,
HTMLElementFactory factory,
ContextAttributes contextAttributes,
StringBuffer buffer)
Sticks an html id attribute on the targeted element, then creates an AccessibilityLabelElement pointing to it with the specified description, then renders both elements to the specified buffer. |
static void |
renderCaption(String caption,
HTMLElementFactory htmlFactory,
StringBuffer buffer)
Renders a caption for an html form control, given an HTMLElementFactory and a buffer to use for output. |
static void |
renderCaption(String caption,
HTMLElementFactory htmlFactory,
StringBuffer buffer,
String additionalCaptionClass)
Renders a caption for an html form control, given an HTMLElementFactory and a buffer to use for output. |
static StringBuffer |
replaceToken(StringBuffer str,
String token,
String sub)
|
static String |
replaceToken(String str,
String token,
String sub)
|
static String |
reverseImageLink(String in)
|
static String |
reverseImageLink(String in,
boolean isRTLScreen,
boolean isRTLWizard)
|
static StringBuffer |
reverseImageLink(StringBuffer str,
boolean isRTLScreen,
boolean isRTLWizard)
|
static String |
reverseImageLinkBack(String in)
|
static StringBuffer |
reverseWidget(String buf,
boolean SymSwap)
|
static StringBuffer |
reverseWidget(StringBuffer result,
boolean SymSwap)
|
static String |
saveStringBufferToFile(StringBuffer sb,
String filename,
com.ibm.hats.transform.IPathInfo pathInfo)
|
static String |
saveToFile(StringBuffer content,
String filename,
ContextAttributes contextAttributes)
|
static String |
trimAllSpace(String val)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String COPYRIGHT
public static final String CLASS_NAME
public static final String PROPERTY_ESCAPETAGS
public static final String BIDI_ALREADY_REORDERED
| Constructor Detail |
|---|
public HTMLWidgetUtilities()
| Method Detail |
|---|
public static Map processCSSOverrides(Properties settings)
HTMLElementFactorypublic static String htmlEscape(String s)
s - String to escape
public static String htmlEscape(String s,
boolean escapeSpaces)
s - String to escapeescapeSpaces - true to escape spaces, false to not
public static void htmlEscape(String s,
StringBuffer buffer)
s - string to escapebuffer - buffer to put escaped content in
public static void htmlEscape(boolean escapeHTMLtags,
String s,
StringBuffer buffer)
escapeHTMLtags - false to permit HTML tags in text, true to nots - string to escapebuffer - buffer to put escaped content in
public static void htmlEscape(boolean escapeHTMLtags,
String s,
StringBuffer buffer,
boolean escapeSpaces)
escapeHTMLtags - false to permit HTML tags in text, true to nots - string to escapebuffer - buffer to put escaped content inescapeSpaces - true to escape spaces, false to not
public static String htmlEscape(boolean escapeHTMLtags,
String s,
boolean escapeSpaces)
escapeHTMLtags - false to permit HTML tags in text, true to nots - string to escapeescapeSpaces - true to escape spaces, false to not
public static String htmlEscape(boolean escapeHTMLtags,
String s)
escapeHTMLtags - false to permit HTML tags in text, true to nots - string to escape
public static void htmlEscape(String s,
StringBuffer buffer,
boolean escapeSpaces)
s - string to escapebuffer - buffer to put escaped content inescapeSpaces - true to escape spaces, false to not
public static void completeHtmlEscape(String s,
StringBuffer buffer,
boolean escapeSpaces)
s - string to escapebuffer - buffer to put escaped content inescapeSpaces - true to escape spaces, false to notpublic static String getReversedVideoClass(String foregroundColor)
public static String getReversedColor(String htmlColor)
public static void renderCaption(String caption,
HTMLElementFactory htmlFactory,
StringBuffer buffer)
caption - caption to renderhtmlFactory - factory to use in renderingbuffer - output buffer
public static void renderCaption(String caption,
HTMLElementFactory htmlFactory,
StringBuffer buffer,
String additionalCaptionClass)
caption - Caption to render.htmlFactory - Factory to use in rendering.buffer - The output buffer.additionalCaptionClass - The caption class.public static void exactCursorDefaultProperties(Properties defaults)
defaults - the default properties object of the widget
public static void renderAccessibleAndExactCursor(HTMLElement target,
HTMLElementFactory factory,
ContextAttributes contextAttributes,
StringBuffer buffer,
boolean renderAccessible,
boolean renderExactCursor,
Properties defaults,
Properties settings,
String description)
target - targeted HTML elementfactory - HTMLElementFactory to use to construct the labelcontextAttributes - use these to analyze statebuffer - buffer to output to for displayrenderAccessible - whether or not to render the area with an accessibility labelrenderExactCursor - whether or not to render the input field with the exact cursor positioning optiondefaults - settings from the calling widgetsettings - from the calling widgetdescription - label content
public static void renderAsAccessible(HTMLElement target,
String description,
HTMLElementFactory factory,
ContextAttributes contextAttributes,
StringBuffer buffer)
target - targeted HTML elementdescription - label contentfactory - HTMLElementFacory to use to construct the labelcontextAttributes - use these to analyze statebuffer - buffer to output to
public static void makeAccessible(HTMLElement target,
String description,
HTMLElementFactory factory,
Hashtable contextAttributes,
StringBuffer buffer)
target - targeted HTML elementdescription - label contentfactory - HTMLElementFacory to use to construct the labelcontextAttributes - use these to analyze statebuffer - buffer to output to
public static void makeAccessible(HTMLElement target,
String description,
HTMLElementFactory factory,
ContextAttributes contextAttributes,
StringBuffer buffer)
target - targeted HTML elementdescription - label contentfactory - HTMLElementFacory to use to construct the labelcontextAttributes - use these to analyze statebuffer - buffer to output topublic static String getStyleClassPropertyName(String type)
type - type of element, such as HTMLElementFactory.TABLE_CLASS
HTMLElementFactorypublic static void doSymSwap(StringBuffer s)
public static final String getDefaultElementStyle(String element)
element - CSS class mapping key
public static String[] getForegroundColorStyleClasses()
public static String convertBidi(String in,
Hashtable contextAttributes)
public static String convertBidi(String in,
ContextAttributes contextAttributes)
public static String convertBidi(String in,
Hashtable contextAttributes,
boolean disableReordering,
String dirMarker,
Properties settings,
String screenOrientation,
int codepage)
public static String convertBidi(String in,
ContextAttributes contextAttributes,
boolean disableReordering,
String dirMarker,
Properties settings,
String screenOrientation,
int codepage)
public static String convertBidi(String in,
ContextAttributes contextAttributes,
boolean disableReordering,
String dirMarker,
Properties settings,
String screenOrientation,
int codepage,
boolean nobr)
public static String convertBidi_oneline(String in,
ContextAttributes contextAttributes,
boolean disableReordering,
String dirMarker,
Properties settings,
String screenOrientation,
int codepage)
public static String convertBidi_oneline(String in,
ContextAttributes contextAttributes,
boolean disableReordering,
String dirMarker,
Properties settings,
String screenOrientation,
int codepage,
boolean nobr)
public static void bidiTransformWidgetDescription(InputComponentElement ice,
Properties settings,
ContextAttributes contextAttributes)
public static StringBuffer fixReversedHTMLSegment(StringBuffer buf,
boolean SymSwap,
boolean fixBrackets)
public static String fixReversedHTMLSegment(String buf,
boolean SymSwap,
boolean fixBrackets)
public static StringBuffer HandleRTLReplacement(StringBuffer buf,
boolean useBDO)
public static String HandleRTLReplacement(String buf,
boolean useBDO)
public static StringBuffer replaceToken(StringBuffer str,
String token,
String sub)
public static String replaceToken(String str,
String token,
String sub)
public static String trimAllSpace(String val)
public static String activeItemTrim(String val)
public static String activeItemTrim(String val,
boolean padIfZero)
public static String activeItemTrim(String val,
boolean padIfZero,
boolean leaveExtra)
public static StringBuffer reverseWidget(String buf,
boolean SymSwap)
public static StringBuffer reverseWidget(StringBuffer result,
boolean SymSwap)
public static String fixImageLink(String in)
public static String reverseImageLink(String in,
boolean isRTLScreen,
boolean isRTLWizard)
public static StringBuffer reverseImageLink(StringBuffer str,
boolean isRTLScreen,
boolean isRTLWizard)
public static String reverseImageLink(String in)
public static String reverseImageLinkBack(String in)
public static String saveToFile(StringBuffer content,
String filename,
ContextAttributes contextAttributes)
public static String saveStringBufferToFile(StringBuffer sb,
String filename,
com.ibm.hats.transform.IPathInfo pathInfo)
public static void main(String[] args)
public static void hideElement(HTMLElement e)
e - HTMLElement to be hidden.
|
HATS 7.5.1 (201005110649) | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||