org.apache.manifoldcf.ui.util
Class Formatter

java.lang.Object
  extended by org.apache.manifoldcf.ui.util.Formatter

public class Formatter
extends java.lang.Object

Various useful formatting methods for working with html


Field Summary
static java.lang.String _rcsid
           
 
Constructor Summary
Formatter()
           
 
Method Summary
static java.lang.String[] formatString(java.lang.String value, int maxWidth, boolean multiple, boolean ellipsis)
          Format a string as a number of continuation fields, so that the total string is not too long.
static java.lang.String formatTime(long time)
          Format a long as an understandable date.
protected static void writechars(java.lang.StringBuffer sb, int value, int length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rcsid

public static final java.lang.String _rcsid
See Also:
Constant Field Values
Constructor Detail

Formatter

public Formatter()
Method Detail

formatTime

public static java.lang.String formatTime(long time)
Format a long as an understandable date.

Parameters:
time - is the long.
Returns:
the date, as a human-readable string. This date will be in local time.

formatString

public static java.lang.String[] formatString(java.lang.String value,
                                              int maxWidth,
                                              boolean multiple,
                                              boolean ellipsis)
Format a string as a number of continuation fields, so that the total string is not too long.

Parameters:
value - is the string to format.
maxWidth - is the maximum width desired for each field.
multiple - is true if multiple lines desired.
ellipsis - is true if ellipses are desired for each non-terminal line.
Returns:
an array of strings representing the split-up value.

writechars

protected static void writechars(java.lang.StringBuffer sb,
                                 int value,
                                 int length)