ch.elexis.util
Class MoneyInput
java.lang.Object
Composite
ch.elexis.util.MoneyInput
public class MoneyInput
- extends Composite
A class to display and let the user enter or change currency strings
- Author:
- gerry
Constructor Summary |
MoneyInput(Composite parent)
|
MoneyInput(Composite parent,
java.lang.String label)
|
MoneyInput(Composite parent,
java.lang.String label,
ch.rgw.tools.Money money)
|
Method Summary |
void |
addSelectionListener(SelectionListener lis)
|
Text |
getControl()
|
static ch.rgw.tools.Money |
getFromTextField(Text textField)
get the money out of a SWT Text-field This might fail if the text field's contents doesn't
conform to the current locale's standard currency format |
ch.rgw.tools.Money |
getMoney(boolean bNullIfEmpty)
Return the entered value as Money. |
void |
removeSelectionListener(SelectionListener lis)
|
void |
setMoney(java.lang.String m)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MoneyInput
public MoneyInput(Composite parent)
MoneyInput
public MoneyInput(Composite parent,
java.lang.String label)
MoneyInput
public MoneyInput(Composite parent,
java.lang.String label,
ch.rgw.tools.Money money)
getMoney
public ch.rgw.tools.Money getMoney(boolean bNullIfEmpty)
- Return the entered value as Money.
- Parameters:
bNullIfEmpty
- if nothing was entered return null (Otherwise: return 0.00)
setMoney
public void setMoney(java.lang.String m)
getControl
public Text getControl()
addSelectionListener
public void addSelectionListener(SelectionListener lis)
removeSelectionListener
public void removeSelectionListener(SelectionListener lis)
getFromTextField
public static ch.rgw.tools.Money getFromTextField(Text textField)
- get the money out of a SWT Text-field This might fail if the text field's contents doesn't
conform to the current locale's standard currency format
- Returns:
- the Money or null
Copyright 2005-2010 by Gerry Weirich, Elexis