public class WebCurrencyField extends WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField> implements CurrencyField
CurrencyField.CurrencyLabelPositionField.ValidatorComponent.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.WrapperICON_STYLE, UNIT_SYMBOLSNAMEAUTO_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, setRequiredMessageaddStyleName, 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, unwrapCompositionaddListener, addListener, fireEvent, hasListeners, removeListener, removeListenerequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddValidator, getRequiredMessage, getValidators, removeValidator, setRequiredMessageaddListener, removeListenerisEditable, isEditableWithParent, setEditablegetFrame, setFrameaddStyleName, 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, unwrapCompositiongetCaption, getDescription, setCaption, setDescriptionisValid, isValidateOnCommitgetIcon, setIconpublic void setCurrency(java.lang.String currency)
CurrencyFieldcurrency 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 CurrencyFieldcurrency - currency ($, EUR, etc)public java.lang.String getCurrency()
getCurrency in interface CurrencyFieldpublic void setShowCurrencyLabel(boolean showCurrencyLabel)
CurrencyFieldsetShowCurrencyLabel in interface CurrencyFieldpublic boolean getShowCurrencyLabel()
getShowCurrencyLabel in interface CurrencyFieldpublic void setCurrencyLabelPosition(CurrencyField.CurrencyLabelPosition currencyLabelPosition)
CurrencyFieldsetCurrencyLabelPosition in interface CurrencyFieldcurrencyLabelPosition - not-null CurrencyField.CurrencyLabelPosition valuepublic CurrencyField.CurrencyLabelPosition getCurrencyLabelPosition()
getCurrencyLabelPosition in interface CurrencyFieldpublic void setDatasource(Datasource datasource, java.lang.String property)
DatasourceComponentsetDatasource in interface DatasourceComponentsetDatasource in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>public Datasource getDatasource()
getDatasource in interface DatasourceComponentgetDatasource in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>public MetaProperty getMetaProperty()
getMetaProperty in interface DatasourceComponentgetMetaProperty in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>public MetaPropertyPath getMetaPropertyPath()
getMetaPropertyPath in interface DatasourceComponentgetMetaPropertyPath in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>public void setDatatype(Datatype datatype)
CurrencyFielddatatype to the component. Its value will be formatted according to this
datatype.setDatatype in interface CurrencyFielddatatype - Datatype instancepublic Datatype getDatatype()
getDatatype in interface CurrencyFieldpublic void addValueChangeListener(Component.ValueChangeListener listener)
addValueChangeListener in interface Component.HasValueaddValueChangeListener in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>public void removeValueChangeListener(Component.ValueChangeListener listener)
removeValueChangeListener in interface Component.HasValueremoveValueChangeListener in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>public <V> V getValue()
getValue in interface Component.HasValuegetValue in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>public void setValue(java.lang.Object value)
setValue in interface Component.HasValuesetValue 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.Bufferedbuffered - true if buffered mode should be turned on, false otherwisepublic boolean isBuffered()
isBuffered in interface Component.Bufferedtrue if buffered mode is on, false otherwisepublic void commit()
Component.Bufferedcommit in interface Component.Bufferedpublic void discard()
Component.Buffereddiscard in interface Component.Bufferedpublic boolean isModified()
Component.BufferedisModified in interface Component.Bufferedtrue 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.Validatablevalidate in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>ValidationExceptionpublic boolean isRequired()
isRequired in interface FieldisRequired in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>public void setRequired(boolean required)
setRequired in interface FieldsetRequired in class WebAbstractField<com.haulmont.cuba.web.toolkit.ui.CubaCurrencyField>