silverorange Code


Swat.SwatMoneyEntry
/Swat/SwatMoneyEntry.php at line 16

Class SwatMoneyEntry

SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatControl
└─SwatInputControl
└─SwatEntry
└─SwatNumericEntry
└─SwatFloatEntry
└─SwatMoneyEntry

public class SwatMoneyEntry
extends SwatFloatEntry

A money entry widget

Copyright:
2004-2007 silverorange
License:
http://www.gnu.org/copyleft/lesser.html LGPL License 2.1

Field Summary
integer

$decimal_places

Number of decimal places to accept.

boolean

$display_currency

Whether to display international currency symbol.

string

$locale

Optional locale for currency format.

Method Summary
void

display()

Displays this money entry widget.

protected array

getCSSClassNames()

Gets the array of CSS classes that are applied to this entry.

protected string

getDisplayValue(string value)

Formats a monetary value to display.

protected mixed

getNumericValue(string value)

Gets the numeric value of this money entry.

protected SwatMessage

getValidationMessage(string id)

Gets a validation message for this money entry widget.

void

process()

Processes this money entry widget.

Methods inherited from Swat.SwatFloatEntry
getCSSClassNames, getDisplayValue, getNumericValue, getValidationMessage, process
Methods inherited from Swat.SwatNumericEntry
getCSSClassNames, getNumericValue, getValidationMessage, process
Methods inherited from Swat.SwatEntry
display, getCSSClassNames, getDisplayValue, getFocusableHtmlId, getInputTag, getNonce, getRawValue, getState, getValidationMessage, hasRawValue, process, setState
Methods inherited from Swat.SwatInputControl
getForm, init
Methods inherited from Swat.SwatControl
addMessage, getNote, printWidgetTree
Methods inherited from Swat.SwatWidget
addCompositeWidget, addMessage, confirmCompositeWidgets, copy, createCompositeWidgets, display, displayHtmlHeadEntries, getCSSClassNames, getCompositeWidget, getCompositeWidgets, getFocusableHtmlId, getHtmlHeadEntrySet, getMessages, hasMessage, init, isDisplayed, isInitialized, isProcessed, isSensitive, printWidgetTree, process, replaceWithContainer
Methods inherited from Swat.SwatUIObject
addComment, addJavaScript, addStyleSheet, addTangoAttribution, copy, getCSSClassNames, getCSSClassString, getFirstAncestor, getHtmlHeadEntrySet, getInlineJavaScript, getUniqueId, isVisible

Field Detail

/Swat/SwatMoneyEntry.php at line 49

decimal_places

public integer $decimal_places = null

Number of decimal places to accept

This also controls how many decimal places are displayed when editing existing values.

If set to null, the number of decimal places allowed by the locale is used.


/Swat/SwatMoneyEntry.php at line 36

display_currency

public boolean $display_currency = false

Whether to display international currency symbol

If true, displays the international currency symbol after the input box.


/Swat/SwatMoneyEntry.php at line 27

locale

public string $locale = null

Optional locale for currency format

If no locale is specified, the current system locale is used.


Method Detail

/Swat/SwatMoneyEntry.php at line 59

display

public void display()

Displays this money entry widget

The widget is displayed as an input box and an optional currency symbol.


/Swat/SwatMoneyEntry.php at line 251

getCSSClassNames

protected array getCSSClassNames()

Gets the array of CSS classes that are applied to this entry

Returns:
the array of CSS classes that are applied to this entry.
See Also:
SwatUIObject::getCSSClassString()

/Swat/SwatMoneyEntry.php at line 166

getDisplayValue

protected string getDisplayValue(string value)

Formats a monetary value to display

Parameters:
value - the value to format for display.
Returns:
the formatted value.

/Swat/SwatMoneyEntry.php at line 188

getNumericValue

protected mixed getNumericValue(string value)

Gets the numeric value of this money entry

Parameters:
value - the raw value to use to get the numeric value.
Returns:
the numeric value of this money entry widget or null if no numeric value is available.

/Swat/SwatMoneyEntry.php at line 204

getValidationMessage

protected SwatMessage getValidationMessage(string id)

Gets a validation message for this money entry widget

See Also:
SwatEntry::getValidationMessage()
Parameters:
id - the string identifier of the validation message.
Returns:
the validation message.

/Swat/SwatMoneyEntry.php at line 83

process

public void process()

Processes this money entry widget

If the value of this widget is not a monetary value or the number of fractional decimal places is not within the allowed range, an error message is attached to this money entry widget.


silverorange Code