
Public Member Functions | |
| ERXFixedLengthString (WOContext context) | |
| boolean | escapeHTML () |
| int | length () |
| void | reset () |
| String | strippedValue () |
| String | suffixWhenTrimmed () |
| String | value () |
Protected Attributes | |
| String | _fixedLengthString |
| boolean | valueWasTrimmed = false |
value string that is passed in to display in a fixed length setting. length fixed length that is compared to the length of the passed in string. shouldPadToLength boolean binding to indicate if the string to be displayed is shorter than the fixed length if it should then be padded with white space. suffixWhenTrimmed only appended to the end of the string if characters are trimmed from the end of the string to be displayed escapeHTML replace the entities > and & with their escape codes (like WOString does). When this is set to true, all HTML text is cleared from the string first to prevent half-open tags
| ERXFixedLengthString | ( | WOContext | context | ) |
Public constructor
| context | to be used |
| boolean escapeHTML | ( | ) |
Returns the value for the binding: escapeHTML.
| int length | ( | ) |
Fixed length of the string to be displayed.
| void reset | ( | ) |
Resets cached instance variables.
Reimplemented from ERXStatelessComponent.
| String strippedValue | ( | ) |
Returns the value stripped from HTML tags if escapeHTML is false. This makes sense because it is not terribly useful to have half-finished tags in your code. Note that the "length" of the resulting string is not very exact. FIXME: we could remove extra whitespace and character entities here MOVEME: should go to ERXStringUtilities
| String suffixWhenTrimmed | ( | ) |
Returns the value for the binding: suffixWhenTrimmed only if the string was trimmed.
| String value | ( | ) |
Calculates the fixed length string from the string passed in via the binding: value. If the length of the value string is greater than the int value of the length binding then the string is trimmed to the fixed length. If the string is shorter than the fixed length size and the binding: shouldPadToLength is set to true then whitespace is added to the end of the string buffer.
String _fixedLengthString [protected] |
Holds the local cache for the calculated fixed length string
boolean valueWasTrimmed = false [protected] |
flag to indicate if characters were trimmed from the end of the passed in string.
1.5.8