wt.templateutil.components
Class DefaultDecimalComponent

java.lang.Object
  extended bywt.templateutil.components.HTMLComponent
      extended bywt.templateutil.components.DefaultHTMLComponent
          extended bywt.templateutil.components.DefaultDecimalComponent

public class DefaultDecimalComponent
extends DefaultHTMLComponent


Field Summary
private static String CLASSNAME
           
private static String CODEBASE
           
private static String RESOURCE
           
private static boolean VERBOSE
           
private static String versionID
           
 
Fields inherited from class wt.templateutil.components.DefaultHTMLComponent
defaultComponent
 
Fields inherited from class wt.templateutil.components.HTMLComponent
CLASS, COMPONENT_ID, COMPONENT_ID_SEPARATOR, CREATE, DEFAULT_SERVICE_NAME, DEFAULTS_ONLY, EMPTY_STRING, ID, ID_US_ENGLISH_LOCALE, NAME, NULLVALUE, PRINT_TAG_ATTR, SERVICENAME, TAG, UPDATE, VIEW
 
Constructor Summary
DefaultDecimalComponent()
           
 
Method Summary
private  String getFileSize(ApplicationData file, Locale locale)
          Returns a String containing the size of the given file in Kilobytes.
private  float roundToTwoDecimals(float number)
          Returns the given float rounded to two decimal places.
 String show(Object value, Properties formData, OutputStream os, Locale locale)
          This method is the main control for the Display of all HTMLComponent subclasses.
 
Methods inherited from class wt.templateutil.components.DefaultHTMLComponent
endComponent, init, setTagListArray, startComponent
 
Methods inherited from class wt.templateutil.components.HTMLComponent
appendID, appendID, appendToID, appendToID, createIDForComponent, getHtmlComponents, getID, getIdProp, getName, getOID, getPrintWriter, getRealValue, getServiceName, getState, getTag, getTagID, getTagIDKey, getTagList, getTagSettings, getURLFactory, insertID, insertID, isInheritStyle, isPrintTagAttributes, isUseDefaultsOnly, main, putTagID, putTagID, removeID, removeTagID, setHtmlComponents, setID, setInheritStyle, setName, setPrintTagAttributes, setServiceName, setState, setTag, setTagList, setTagListDefaults, setTagSettings, setTagValue, setUseDefaultsOnly, showSubComponents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

versionID

private static final String versionID
See Also:
Constant Field Values

VERBOSE

private static boolean VERBOSE

CODEBASE

private static String CODEBASE
Constructor Detail

DefaultDecimalComponent

public DefaultDecimalComponent()
Method Detail

show

public String show(Object value,
                   Properties formData,
                   OutputStream os,
                   Locale locale)
Description copied from class: HTMLComponent
This method is the main control for the Display of all HTMLComponent subclasses. It first calls startComponent, then showSubComponents, and then endComponent. It returns a string that is the concatenation of the results of these three methods. A call to show() should be all that is needed to display any subclass component.

Supported API: true

Overrides:
show in class HTMLComponent
Parameters:
value -
formData -
os -
locale -
Returns:
String

getFileSize

private String getFileSize(ApplicationData file,
                           Locale locale)
Returns a String containing the size of the given file in Kilobytes. The string returned also contains the units (e.g "100 KB").

Supported API: false

Parameters:
file - the ApplicationData item whose size is returned
Returns:
a String containing the size of the file and the units.

roundToTwoDecimals

private float roundToTwoDecimals(float number)
Returns the given float rounded to two decimal places.

Supported API: false

Parameters:
number - the float to be rounded
Returns:
the given number rounded to two decimal places