public class CurrencyFieldImpl<V extends java.lang.Number> extends AbstractField<JmixCurrencyField,java.lang.String,V> implements CurrencyField<V>
CurrencyField.CurrencyLabelPosition
HasValue.ValueChangeEvent<V>
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
HasContextHelp.ContextHelpIconClickEvent
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
conversionErrorMessage |
protected DataAwareComponentsTools |
dataAwareComponentsTools |
protected io.jmix.core.metamodel.datatype.Datatype<V> |
datatype |
protected io.jmix.core.metamodel.datatype.Datatype<V> |
defaultDatatype |
protected java.util.Locale |
locale |
editable, parentEditableChangeListener, validators, VALIDATORS_LIST_INITIAL_CAPACITY
internalValue, uiTestIdsSupport, valueBinding
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parent
NAME, TYPE_BIGDECIMAL, TYPE_DEFAULT, TYPE_DOUBLE, TYPE_INTEGER, TYPE_LONG
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Constructor and Description |
---|
CurrencyFieldImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
attachValueChangeListener(JmixCurrencyField component) |
void |
commit()
Updates all changes since the previous commit to the data source.
|
protected V |
convertToModel(java.lang.String componentRawValue) |
protected java.lang.String |
convertToPresentation(V modelValue) |
protected JmixCurrencyField |
createComponent() |
void |
discard()
Discards all changes since last commit.
|
void |
focus()
Sets focus to this component
|
protected CurrencyField.CurrencyLabelPosition |
fromWidgetLabelPosition(CurrencyLabelPosition wLabelPosition) |
java.lang.String |
getConversionErrorMessage() |
protected java.lang.String |
getConversionErrorMessageInternal() |
java.lang.String |
getCurrency() |
CurrencyField.CurrencyLabelPosition |
getCurrencyLabelPosition() |
io.jmix.core.metamodel.datatype.Datatype<V> |
getDatatype() |
protected io.jmix.core.metamodel.datatype.Datatype<V> |
getDatatypeInternal() |
boolean |
getShowCurrencyLabel() |
int |
getTabIndex()
Gets the tabulator index of the
HasTabIndex component. |
protected void |
initComponent(JmixCurrencyField component) |
boolean |
isBuffered() |
boolean |
isModified()
Tests if the value stored in the object has been modified since it was
last updated from the data source.
|
void |
setBuffered(boolean buffered)
Sets the buffered mode.
|
void |
setConversionErrorMessage(java.lang.String conversionErrorMessage)
Sets custom conversion error message that is used when value doesn't correspond to datatype.
|
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 |
setCurrentAuthentication(io.jmix.core.security.CurrentAuthentication currentAuthentication) |
void |
setDataAwareComponentsTools(DataAwareComponentsTools dataAwareComponentsTools) |
void |
setDatatype(io.jmix.core.metamodel.datatype.Datatype<V> datatype)
Sets the given
datatype to the component. |
void |
setDatatypeRegistry(io.jmix.core.metamodel.datatype.DatatypeRegistry datatypeRegistry) |
void |
setShowCurrencyLabel(boolean showCurrencyLabel)
Enables or disables currency label displaying.
|
void |
setTabIndex(int tabIndex)
Sets the tabulator index of the
Focusable component. |
protected CurrencyLabelPosition |
toWidgetLabelPosition(CurrencyField.CurrencyLabelPosition labelPosition) |
protected void |
valueBindingConnected(ValueSource<V> valueSource) |
addValidator, getDatatypeConversionErrorMsg, getErrorMessage, getRequiredMessage, getValidators, isEditable, isRequired, isValid, removeValidator, setEditable, setEditableToComponent, setParent, setRequired, setRequiredMessage, setupComponentErrorProvider, triggerValidators, validate
addValueChangeListener, componentValueChanged, fieldValueEquals, getValue, getValueSource, setUiTestId, setUiTestIdsSupport, setValue, setValueSource, setValueToPresentation, valueBindingActivated
addAttachListener, addDetachListener, addStyleName, assignDebugId, attached, detached, getAlignment, getCaption, getComponent, getComposition, getContextHelpIconClickHandler, getContextHelpText, getDebugId, getDescription, getEventHub, getFrame, getHeight, getHeightSizeUnit, getHtmlSanitizer, getIcon, getIconName, getIconResource, getId, getParent, getStyleName, getUiComponentProperties, getUiProperties, getWidth, getWidthSizeUnit, getXmlDescriptor, hasSubscriptions, hasValidationError, isAttached, isCaptionAsHtml, isContextHelpTextHtmlEnabled, isDescriptionAsHtml, isEnabled, isEnabledRecursive, isHtmlSanitizerEnabled, isResponsive, isVisible, isVisibleRecursive, onContextHelpIconClick, publish, removeStyleName, sanitize, setAlignment, setApplicationContext, setCaption, setCaptionAsHtml, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled, setDebugId, setDescription, setDescriptionAsHtml, setEnabled, setFrame, setHeight, setHtmlSanitizerEnabled, setIcon, setIconFromSet, setId, setResponsive, setStyleName, setValidationError, setVisible, setWidth, setXmlDescriptor, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getValueSource, setValueSource
addValueChangeListener, clear, getEmptyValue, getValue, isEmpty, setValue
isEditable, isEditableWithParent, setEditable
getFrame, setFrame
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
isValid, isValidateOnCommit, validate
getIcon, setIcon, setIconFromSet
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
isCaptionAsHtml, setCaptionAsHtml
getCaption, setCaption
getDescription, setDescription
isDescriptionAsHtml, setDescriptionAsHtml
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
addValidator, addValidators, getValidators, removeValidator
getRequiredMessage, isRequired, setRequired, setRequiredMessage
isFocusable, setFocusable
protected java.util.Locale locale
protected io.jmix.core.metamodel.datatype.Datatype<V extends java.lang.Number> datatype
protected io.jmix.core.metamodel.datatype.Datatype<V extends java.lang.Number> defaultDatatype
protected java.lang.String conversionErrorMessage
protected DataAwareComponentsTools dataAwareComponentsTools
protected JmixCurrencyField createComponent()
protected void initComponent(JmixCurrencyField component)
@Autowired public void setDataAwareComponentsTools(DataAwareComponentsTools dataAwareComponentsTools)
@Autowired public void setDatatypeRegistry(io.jmix.core.metamodel.datatype.DatatypeRegistry datatypeRegistry)
protected void attachValueChangeListener(JmixCurrencyField component)
attachValueChangeListener
in class AbstractField<JmixCurrencyField,java.lang.String,V extends java.lang.Number>
@Autowired public void setCurrentAuthentication(io.jmix.core.security.CurrentAuthentication currentAuthentication)
protected java.lang.String convertToPresentation(@Nullable V modelValue) throws ConversionException
convertToPresentation
in class AbstractValueComponent<JmixCurrencyField,java.lang.String,V extends java.lang.Number>
ConversionException
@Nullable protected V convertToModel(@Nullable java.lang.String componentRawValue) throws ConversionException
convertToModel
in class AbstractValueComponent<JmixCurrencyField,java.lang.String,V extends java.lang.Number>
ConversionException
public void setConversionErrorMessage(@Nullable java.lang.String conversionErrorMessage)
HasConversionErrorMessage
setConversionErrorMessage
in interface HasConversionErrorMessage
conversionErrorMessage
- custom conversion error message@Nullable public java.lang.String getConversionErrorMessage()
getConversionErrorMessage
in interface HasConversionErrorMessage
protected java.lang.String getConversionErrorMessageInternal()
public void setCurrency(@Nullable 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<V extends java.lang.Number>
currency
- currency ($, EUR, etc)@Nullable public java.lang.String getCurrency()
getCurrency
in interface CurrencyField<V extends java.lang.Number>
public void setShowCurrencyLabel(boolean showCurrencyLabel)
CurrencyField
setShowCurrencyLabel
in interface CurrencyField<V extends java.lang.Number>
public boolean getShowCurrencyLabel()
getShowCurrencyLabel
in interface CurrencyField<V extends java.lang.Number>
public void setCurrencyLabelPosition(CurrencyField.CurrencyLabelPosition currencyLabelPosition)
CurrencyField
setCurrencyLabelPosition
in interface CurrencyField<V extends java.lang.Number>
currencyLabelPosition
- not-null CurrencyField.CurrencyLabelPosition
valuepublic CurrencyField.CurrencyLabelPosition getCurrencyLabelPosition()
getCurrencyLabelPosition
in interface CurrencyField<V extends java.lang.Number>
protected void valueBindingConnected(ValueSource<V> valueSource)
valueBindingConnected
in class AbstractValueComponent<JmixCurrencyField,java.lang.String,V extends java.lang.Number>
public void setDatatype(io.jmix.core.metamodel.datatype.Datatype<V> datatype)
HasDatatype
datatype
to the component. Its value will be formatted according to this
datatype.setDatatype
in interface HasDatatype<V extends java.lang.Number>
datatype
- Datatype
instance@Nullable public io.jmix.core.metamodel.datatype.Datatype<V> getDatatype()
getDatatype
in interface HasDatatype<V extends java.lang.Number>
@Nullable protected io.jmix.core.metamodel.datatype.Datatype<V> getDatatypeInternal()
public void commit()
Buffered
commit
in interface Buffered
commit
in class AbstractValueComponent<JmixCurrencyField,java.lang.String,V extends java.lang.Number>
public void discard()
Buffered
discard
in interface Buffered
discard
in class AbstractValueComponent<JmixCurrencyField,java.lang.String,V extends java.lang.Number>
public boolean isBuffered()
isBuffered
in interface Buffered
isBuffered
in class AbstractValueComponent<JmixCurrencyField,java.lang.String,V extends java.lang.Number>
true
if buffered mode is on, false
otherwisepublic void setBuffered(boolean buffered)
Buffered
When in buffered mode, an internal buffer will be used to store changes
until Buffered.commit()
is called. Calling 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 Buffered.commit()
and
Buffered.discard()
methods serve no purpose.
setBuffered
in interface Buffered
setBuffered
in class AbstractValueComponent<JmixCurrencyField,java.lang.String,V extends java.lang.Number>
buffered
- true
if buffered mode should be turned on, false
otherwisepublic boolean isModified()
Buffered
isModified
in interface Buffered
isModified
in class AbstractValueComponent<JmixCurrencyField,java.lang.String,V extends java.lang.Number>
true
if the value in the object has been modified
since the last data source update, false
if not.public void focus()
Component.Focusable
focus
in interface Component.Focusable
public int getTabIndex()
Component.Focusable
HasTabIndex
component.getTabIndex
in interface Component.Focusable
HasTabIndex
componentpublic void setTabIndex(int tabIndex)
Component.Focusable
Focusable
component.
The tab index property is used to specify the order in which the
fields are focused when the user presses the Tab key. Components with
a defined tab index are focused sequentially first, and then the
components with no tab index.setTabIndex
in interface Component.Focusable
tabIndex
- tab indexprotected CurrencyLabelPosition toWidgetLabelPosition(CurrencyField.CurrencyLabelPosition labelPosition)
protected CurrencyField.CurrencyLabelPosition fromWidgetLabelPosition(CurrencyLabelPosition wLabelPosition)