UIX 2.2.16

oracle.cabo.ui.data.bind
Class TruncateBoundValue

java.lang.Object
  |
  +--oracle.cabo.ui.data.bind.TruncateBoundValue
All Implemented Interfaces:
BoundValue

public class TruncateBoundValue
extends java.lang.Object
implements BoundValue

A BoundValue that will truncate another string if necessary.


Constructor Summary
TruncateBoundValue()
          Creates a TruncateBoundValue.
TruncateBoundValue(BoundValue textBinding, int truncateAt)
          Creates a TruncateBoundValue
 
Method Summary
 java.lang.String getText()
          Returns the text that will be truncated.
 int getTruncateAt()
          Returns the length at which the text will be truncated.
 java.lang.Object getValue(RenderingContext context)
          Called to retrieve a value based on the current rendering context.
 void setText(java.lang.String text)
          Sets the text that will be truncated.
 void setTextBinding(BoundValue textBinding)
          Sets the databound text that will be truncated.
 void setTruncateAt(int truncateAt)
          Sets the length at which the text will be truncated.
static java.lang.Object truncateString(RenderingContext context, java.lang.Object text, int truncateAt)
          Truncates a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TruncateBoundValue

public TruncateBoundValue()
Creates a TruncateBoundValue.

TruncateBoundValue

public TruncateBoundValue(BoundValue textBinding,
                          int truncateAt)
Creates a TruncateBoundValue
Parameters:
textValue - the BoundValue that returns the text
truncateAt - the number of characters at which truncation begins
Method Detail

truncateString

public static java.lang.Object truncateString(RenderingContext context,
                                              java.lang.Object text,
                                              int truncateAt)
Truncates a string.
Parameters:
context - a rendering context
text - the text value
truncateAt - the number of characters at which the string should be truncated. Strings will never be truncated to less than 13 characters.

getText

public java.lang.String getText()
Returns the text that will be truncated.

setText

public void setText(java.lang.String text)
Sets the text that will be truncated.

setTextBinding

public void setTextBinding(BoundValue textBinding)
Sets the databound text that will be truncated.

getTruncateAt

public int getTruncateAt()
Returns the length at which the text will be truncated.

setTruncateAt

public void setTruncateAt(int truncateAt)
Sets the length at which the text will be truncated.

getValue

public java.lang.Object getValue(RenderingContext context)
Description copied from interface: BoundValue
Called to retrieve a value based on the current rendering context.
Specified by:
getValue in interface BoundValue
Following copied from interface: oracle.cabo.ui.data.BoundValue
Parameters:
context - the rendering context

UIX 2.2.16