com.ivata.mask.web.format
Class NonBreakingSpaceFormat

java.lang.Object
  extended bycom.ivata.mask.web.format.NonBreakingSpaceFormat
All Implemented Interfaces:
HTMLFormat

public class NonBreakingSpaceFormat
extends java.lang.Object
implements HTMLFormat

Convert all spaces in a text to non-breaking spaces. You can choose whether all spaces are converted (default), or just those at the start of the line, by changing the value of the style field.

Since:
ivata masks 0.4 (2002-06-19)
Version:
$Revision: 1.4 $
Author:
Colin MacLeod colin.macleod@ivata.com

Field Summary
static int NONBREAKING_ALL
           Use this flag to indicate that all spaces should be converted to non-breaking ( )
static int NONBREAKING_NONE
           Use this flag to indicate that all spaces should be left as they are and not converted to non-breaking ( ).
static int NONBREAKING_START_LINE
           Use this flag to indicate that spaces at the start of a line should be converted to non-breaking ( ).
 
Constructor Summary
NonBreakingSpaceFormat()
           
 
Method Summary
 java.lang.String format(java.lang.String hTMLTextParam)
           Format the string given in hTMLText to the maximum length provided by calling setMaxLength.
 int getStyle()
           Get the style of non-breaking space conversion applied.
 void setStyle(int styleParam)
           Set the style of non-breaking space conversion applied.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONBREAKING_ALL

public static final int NONBREAKING_ALL

Use this flag to indicate that all spaces should be converted to non-breaking ( )

This flag represents the default setting.

See Also:
NONBREAKING_NONE, NONBREAKING_START_LINE, Constant Field Values

NONBREAKING_NONE

public static final int NONBREAKING_NONE

Use this flag to indicate that all spaces should be left as they are and not converted to non-breaking ( ).

See Also:
NONBREAKING_START_LINE, NONBREAKING_ALL, Constant Field Values

NONBREAKING_START_LINE

public static final int NONBREAKING_START_LINE

Use this flag to indicate that spaces at the start of a line should be converted to non-breaking ( ).

See Also:
NONBREAKING_NONE, NONBREAKING_ALL, Constant Field Values
Constructor Detail

NonBreakingSpaceFormat

public NonBreakingSpaceFormat()
Method Detail

format

public final java.lang.String format(java.lang.String hTMLTextParam)

Format the string given in hTMLText to the maximum length provided by calling setMaxLength.

Specified by:
format in interface HTMLFormat
Parameters:
hTMLTextParam - the text to truncate.
Returns:
Refer to HTMLFormat.format(java.lang.String).

getStyle

public int getStyle()

Get the style of non-breaking space conversion applied. By default all spaces will be converted.

Returns:
the current value of style.

setStyle

public final void setStyle(int styleParam)

Set the style of non-breaking space conversion applied. By default all spaces will be converted.

You should use one of the constant NONBREAKING_... values set in this class, as the setting of style.

Parameters:
styleParam - the new value of style.


Copyright © 2001-2005 ivata limited. All Rights Reserved.