public class WebCurrencyField extends WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField> implements CurrencyField
CurrencyField.CurrencyLabelPosition
Field.Validator
Component.ActionOwner, Component.ActionsHolder, Component.Alignment, Component.BelongToFrame, Component.Buffered, Component.ChildEditableController, Component.Collapsable, Component.Container, Component.Disposable, Component.Editable, Component.EditableChangeEvent, Component.EditableChangeListener, Component.EditableChangeNotifier, Component.ExpandedStateChangeEvent, Component.ExpandedStateChangeListener, Component.Focusable, Component.HasBorder, Component.HasButtonsPanel, Component.HasCaption, Component.HasFormatter, Component.HasIcon, Component.HasInputPrompt, Component.HasNamedComponents, Component.HasPresentations, Component.HasRowsCount, Component.HasSettings, Component.HasValue, Component.HasXmlDescriptor, Component.LayoutClickEvent, Component.LayoutClickListener, Component.LayoutClickNotifier, Component.Margin, Component.MouseEventDetails, Component.OrderedContainer, Component.OuterMargin, Component.SecuredActionsHolder, Component.ShortcutAction, Component.ShortcutNotifier, Component.ShortcutTriggeredEvent, Component.Spacing, Component.UiPermissionAware, Component.Validatable, Component.ValueChangeEvent, Component.ValueChangeListener, Component.Wrapper
ICON_STYLE, UNIT_SYMBOLS
NAME
AUTO_SIZE, AUTO_SIZE_PX, UNITS_PERCENTAGE, UNITS_PIXELS
Constructor and Description |
---|
WebCurrencyField() |
Modifier and Type | Method and Description |
---|---|
void |
addValueChangeListener(Component.ValueChangeListener listener) |
void |
commit()
Updates all changes since the previous commit to the data source.
|
void |
discard()
Discards all changes since last commit.
|
java.lang.String |
getCurrency() |
CurrencyField.CurrencyLabelPosition |
getCurrencyLabelPosition() |
Datasource |
getDatasource() |
Datatype |
getDatatype() |
MetaProperty |
getMetaProperty() |
MetaPropertyPath |
getMetaPropertyPath() |
boolean |
getShowCurrencyLabel() |
<V> V |
getValue() |
boolean |
isBuffered() |
boolean |
isModified()
Tests if the value stored in the object has been modified since it was
last updated from the data source.
|
boolean |
isRequired() |
void |
removeValueChangeListener(Component.ValueChangeListener listener) |
void |
setBuffered(boolean buffered)
Sets the buffered mode.
|
void |
setCurrency(java.lang.String currency)
Sets the given
currency to the field. |
void |
setCurrencyLabelPosition(CurrencyField.CurrencyLabelPosition currencyLabelPosition)
Sets where the currency label will be located: to the left or to the right from the text input component.
|
void |
setDatasource(Datasource datasource,
java.lang.String property)
Set datasource and its property.
|
void |
setDatatype(Datatype datatype)
Sets the given
datatype to the component. |
void |
setRequired(boolean required) |
void |
setShowCurrencyLabel(boolean showCurrencyLabel)
Enables or disables currency label displaying.
|
void |
setValue(java.lang.Object value) |
void |
validate() |
addListener, addValidator, getRequiredMessage, getValidators, isEditable, isValid, removeListener, removeValidator, setEditable, setParent, setRequiredMessage
addStyleName, assignAutoDebugId, getAlignment, getCaption, getComponent, getComponentEnabledFlag, getComponentVisibleFlag, getComposition, getDebugId, getDescription, getFrame, getHeight, getHeightUnits, getIcon, getId, getParent, getStyleName, getWidth, getWidthUnits, getXmlDescriptor, isEnabled, isEnabledItself, isResponsive, isVisible, isVisibleItself, removeStyleName, requestFocus, setAlignment, setCaption, setDebugId, setDescription, setEnabled, setFrame, setHeight, setIcon, setId, setResponsive, setStyleName, setVisible, setWidth, setXmlDescriptor, unwrap, unwrapComposition
addListener, addListener, fireEvent, hasListeners, removeListener, removeListener
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addValidator, getRequiredMessage, getValidators, removeValidator, setRequiredMessage
addListener, removeListener
isEditable, isEditableWithParent, setEditable
getFrame, setFrame
addStyleName, getAlignment, getDebugId, getHeight, getHeightUnits, getId, getParent, getStyleName, getWidth, getWidthUnits, isEnabled, isEnabledItself, isResponsive, isVisible, isVisibleItself, removeStyleName, requestFocus, setAlignment, setDebugId, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition
getCaption, getDescription, setCaption, setDescription
isValid, isValidateOnCommit
getIcon, setIcon
public void setCurrency(java.lang.String currency)
CurrencyField
currency
to the field. Currency label will be displayed next to the text input
component if the showCurrency
option is enabled.
Recommended max currency length - 3 character.setCurrency
in interface CurrencyField
currency
- currency ($, EUR, etc)public java.lang.String getCurrency()
getCurrency
in interface CurrencyField
public void setShowCurrencyLabel(boolean showCurrencyLabel)
CurrencyField
setShowCurrencyLabel
in interface CurrencyField
public boolean getShowCurrencyLabel()
getShowCurrencyLabel
in interface CurrencyField
public void setCurrencyLabelPosition(CurrencyField.CurrencyLabelPosition currencyLabelPosition)
CurrencyField
setCurrencyLabelPosition
in interface CurrencyField
currencyLabelPosition
- not-null CurrencyField.CurrencyLabelPosition
valuepublic CurrencyField.CurrencyLabelPosition getCurrencyLabelPosition()
getCurrencyLabelPosition
in interface CurrencyField
public void setDatasource(Datasource datasource, java.lang.String property)
DatasourceComponent
setDatasource
in interface DatasourceComponent
setDatasource
in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>
public Datasource getDatasource()
getDatasource
in interface DatasourceComponent
getDatasource
in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>
public MetaProperty getMetaProperty()
getMetaProperty
in interface DatasourceComponent
getMetaProperty
in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>
public MetaPropertyPath getMetaPropertyPath()
getMetaPropertyPath
in interface DatasourceComponent
getMetaPropertyPath
in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>
public void setDatatype(Datatype datatype)
CurrencyField
datatype
to the component. Its value will be formatted according to this
datatype.setDatatype
in interface CurrencyField
datatype
- Datatype
instancepublic Datatype getDatatype()
getDatatype
in interface CurrencyField
public void addValueChangeListener(Component.ValueChangeListener listener)
addValueChangeListener
in interface Component.HasValue
addValueChangeListener
in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>
public void removeValueChangeListener(Component.ValueChangeListener listener)
removeValueChangeListener
in interface Component.HasValue
removeValueChangeListener
in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>
public <V> V getValue()
getValue
in interface Component.HasValue
getValue
in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>
public void setValue(java.lang.Object value)
setValue
in interface Component.HasValue
setValue
in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>
public void setBuffered(boolean buffered)
Component.Buffered
When in buffered mode, an internal buffer will be used to store changes
until Component.Buffered.commit()
is called. Calling Component.Buffered.discard()
will revert
the internal buffer to the value of the data source.
When in non-buffered mode both read and write operations will be done
directly on the data source. In this mode the Component.Buffered.commit()
and
Component.Buffered.discard()
methods serve no purpose.
setBuffered
in interface Component.Buffered
buffered
- true
if buffered mode should be turned on, false
otherwisepublic boolean isBuffered()
isBuffered
in interface Component.Buffered
true
if buffered mode is on, false
otherwisepublic void commit()
Component.Buffered
commit
in interface Component.Buffered
public void discard()
Component.Buffered
discard
in interface Component.Buffered
public boolean isModified()
Component.Buffered
isModified
in interface Component.Buffered
true
if the value in the object has been modified
since the last data source update, false
if not.public void validate() throws ValidationException
validate
in interface Component.Validatable
validate
in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>
ValidationException
public boolean isRequired()
isRequired
in interface Field
isRequired
in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>
public void setRequired(boolean required)
setRequired
in interface Field
setRequired
in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>