public class ColorPickerImpl extends AbstractField<JmixColorPickerWrapper,com.vaadin.shared.ui.colorpicker.Color,java.lang.String> implements ColorPicker, org.springframework.beans.factory.InitializingBean
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 io.jmix.core.Messages |
messages |
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
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Constructor and Description |
---|
ColorPickerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
commit()
Updates all changes since the previous commit to the data source.
|
protected java.lang.String |
convertToModel(com.vaadin.shared.ui.colorpicker.Color componentRawValue) |
protected com.vaadin.shared.ui.colorpicker.Color |
convertToPresentation(java.lang.String modelValue) |
protected JmixColorPickerWrapper |
createComponent() |
void |
discard()
Discards all changes since last commit.
|
void |
focus()
Sets focus to this component
|
java.lang.String |
getBlueSliderCaption()
Returns caption of the slider for blue color.
|
java.lang.String |
getButtonCaption()
Returns caption of color picker button.
|
java.lang.String |
getCancelButtonCaption()
Returns caption of the cancel button.
|
java.lang.String |
getConfirmButtonCaption()
Returns caption of the confirm button.
|
java.lang.String |
getGreenSliderCaption()
Returns caption of the slider for green color.
|
java.lang.String |
getHueSliderCaption()
Returns caption of the slider for HUE.
|
java.lang.String |
getLookupAllCaption()
Returns caption of the all colors in lookup.
|
java.lang.String |
getLookupBlueCaption()
Returns caption of the blue colors in lookup.
|
java.lang.String |
getLookupGreenCaption()
Returns caption of the green colors in lookup.
|
java.lang.String |
getLookupRedCaption()
Returns caption of the red colors in lookup.
|
java.lang.String |
getPopupCaption()
Returns caption of the popup window.
|
java.lang.String |
getRedSliderCaption()
Returns caption of the slider for red color.
|
java.lang.String |
getSaturationSliderCaption()
Returns caption of the slider for saturation.
|
java.lang.String |
getSwatchesTabCaption()
Returns caption of the swatches tab.
|
int |
getTabIndex()
Gets the tabulator index of the
HasTabIndex component. |
java.lang.String |
getValueSliderCaption()
Returns caption of the slider for value.
|
protected void |
initComponent(JmixColorPickerWrapper component) |
boolean |
isBuffered() |
boolean |
isDefaultCaptionEnabled() |
boolean |
isHistoryVisible() |
boolean |
isHSVVisible() |
boolean |
isModified()
Tests if the value stored in the object has been modified since it was
last updated from the data source.
|
boolean |
isRGBVisible() |
boolean |
isSwatchesVisible() |
void |
setBlueSliderCaption(java.lang.String caption)
Sets caption for the slider of blue color.
|
void |
setBuffered(boolean buffered)
Sets the buffered mode.
|
void |
setButtonCaption(java.lang.String value)
Sets caption for color picker button.
|
void |
setCancelButtonCaption(java.lang.String caption)
Sets caption for the cancel button.
|
protected void |
setCaptions(io.jmix.core.Messages messages) |
void |
setConfirmButtonCaption(java.lang.String caption)
Sets caption for the confirm button.
|
void |
setDefaultCaptionEnabled(boolean defaultCaptionEnabled)
Sets HEX value as button caption.
|
void |
setGreenSliderCaption(java.lang.String caption)
Sets caption for the slider of green color.
|
void |
setHistoryVisible(boolean historyVisible)
Sets visibility for history pane
|
void |
setHSVVisible(boolean value)
Sets visibility for HSV tab
|
void |
setHueSliderCaption(java.lang.String caption)
Sets caption for the HUE slider.
|
void |
setLookupAllCaption(java.lang.String caption)
Sets caption for the all colors in lookup.
|
void |
setLookupBlueCaption(java.lang.String caption)
Sets caption for the blue colors in lookup.
|
void |
setLookupGreenCaption(java.lang.String caption)
Sets caption for the green colors in lookup.
|
void |
setLookupRedCaption(java.lang.String caption)
Sets caption for the red colors in lookup.
|
void |
setMessages(io.jmix.core.Messages messages) |
void |
setPopupCaption(java.lang.String popupCaption)
Sets caption for the popup window.
|
void |
setRedSliderCaption(java.lang.String caption)
Sets caption for the slider of red color.
|
void |
setRGBVisible(boolean value)
Sets visibility for RGB tab
|
void |
setSaturationSliderCaption(java.lang.String caption)
Sets caption for the saturation slider.
|
void |
setSwatchesTabCaption(java.lang.String caption)
Sets caption for the swatches tab.
|
void |
setSwatchesVisible(boolean value)
Sets visibility for swatches tab
|
void |
setTabIndex(int tabIndex)
Sets the tabulator index of the
Focusable component. |
void |
setValueSliderCaption(java.lang.String caption)
Sets caption for the value slider.
|
addValidator, attachValueChangeListener, 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, valueBindingConnected
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 JmixColorPickerWrapper createComponent()
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
protected void initComponent(JmixColorPickerWrapper component)
@Autowired public void setMessages(io.jmix.core.Messages messages)
protected void setCaptions(io.jmix.core.Messages messages)
public void setSwatchesVisible(boolean value)
ColorPicker
setSwatchesVisible
in interface ColorPicker
value
- tab visibility.public boolean isSwatchesVisible()
isSwatchesVisible
in interface ColorPicker
public void setRGBVisible(boolean value)
ColorPicker
setRGBVisible
in interface ColorPicker
value
- tab visibility.public boolean isRGBVisible()
isRGBVisible
in interface ColorPicker
public void setHSVVisible(boolean value)
ColorPicker
setHSVVisible
in interface ColorPicker
value
- tab visibility.public boolean isHSVVisible()
isHSVVisible
in interface ColorPicker
public void setDefaultCaptionEnabled(boolean defaultCaptionEnabled)
ColorPicker
setDefaultCaptionEnabled
in interface ColorPicker
defaultCaptionEnabled
- true if HEX color is shown as button caption.public boolean isDefaultCaptionEnabled()
isDefaultCaptionEnabled
in interface ColorPicker
public void setButtonCaption(java.lang.String value)
ColorPicker
setButtonCaption
in interface ColorPicker
value
- caption text.public java.lang.String getButtonCaption()
ColorPicker
getButtonCaption
in interface ColorPicker
@Nullable protected java.lang.String convertToModel(@Nullable com.vaadin.shared.ui.colorpicker.Color componentRawValue) throws ConversionException
convertToModel
in class AbstractValueComponent<JmixColorPickerWrapper,com.vaadin.shared.ui.colorpicker.Color,java.lang.String>
ConversionException
@Nullable protected com.vaadin.shared.ui.colorpicker.Color convertToPresentation(@Nullable java.lang.String modelValue) throws ConversionException
convertToPresentation
in class AbstractValueComponent<JmixColorPickerWrapper,com.vaadin.shared.ui.colorpicker.Color,java.lang.String>
ConversionException
public void setPopupCaption(@Nullable java.lang.String popupCaption)
ColorPicker
setPopupCaption
in interface ColorPicker
popupCaption
- caption text.@Nullable public java.lang.String getPopupCaption()
ColorPicker
getPopupCaption
in interface ColorPicker
public void setConfirmButtonCaption(@Nullable java.lang.String caption)
ColorPicker
setConfirmButtonCaption
in interface ColorPicker
caption
- caption text.@Nullable public java.lang.String getConfirmButtonCaption()
ColorPicker
getConfirmButtonCaption
in interface ColorPicker
public void setCancelButtonCaption(@Nullable java.lang.String caption)
ColorPicker
setCancelButtonCaption
in interface ColorPicker
caption
- caption text.@Nullable public java.lang.String getCancelButtonCaption()
ColorPicker
getCancelButtonCaption
in interface ColorPicker
public void setSwatchesTabCaption(@Nullable java.lang.String caption)
ColorPicker
setSwatchesTabCaption
in interface ColorPicker
caption
- caption text.@Nullable public java.lang.String getSwatchesTabCaption()
ColorPicker
getSwatchesTabCaption
in interface ColorPicker
public void setLookupAllCaption(@Nullable java.lang.String caption)
ColorPicker
setLookupAllCaption
in interface ColorPicker
caption
- caption text.@Nullable public java.lang.String getLookupAllCaption()
ColorPicker
getLookupAllCaption
in interface ColorPicker
public void setLookupRedCaption(@Nullable java.lang.String caption)
ColorPicker
setLookupRedCaption
in interface ColorPicker
caption
- caption text.@Nullable public java.lang.String getLookupRedCaption()
ColorPicker
getLookupRedCaption
in interface ColorPicker
public void setLookupGreenCaption(@Nullable java.lang.String caption)
ColorPicker
setLookupGreenCaption
in interface ColorPicker
caption
- caption text.@Nullable public java.lang.String getLookupGreenCaption()
ColorPicker
getLookupGreenCaption
in interface ColorPicker
public void setLookupBlueCaption(@Nullable java.lang.String caption)
ColorPicker
setLookupBlueCaption
in interface ColorPicker
caption
- caption text.@Nullable public java.lang.String getLookupBlueCaption()
ColorPicker
getLookupBlueCaption
in interface ColorPicker
public void setRedSliderCaption(@Nullable java.lang.String caption)
ColorPicker
setRedSliderCaption
in interface ColorPicker
caption
- caption text.@Nullable public java.lang.String getRedSliderCaption()
ColorPicker
getRedSliderCaption
in interface ColorPicker
public void setGreenSliderCaption(@Nullable java.lang.String caption)
ColorPicker
setGreenSliderCaption
in interface ColorPicker
caption
- caption text.@Nullable public java.lang.String getGreenSliderCaption()
ColorPicker
getGreenSliderCaption
in interface ColorPicker
public void setBlueSliderCaption(@Nullable java.lang.String caption)
ColorPicker
setBlueSliderCaption
in interface ColorPicker
caption
- caption text.@Nullable public java.lang.String getBlueSliderCaption()
ColorPicker
getBlueSliderCaption
in interface ColorPicker
public void setHueSliderCaption(@Nullable java.lang.String caption)
ColorPicker
setHueSliderCaption
in interface ColorPicker
caption
- caption text.@Nullable public java.lang.String getHueSliderCaption()
ColorPicker
getHueSliderCaption
in interface ColorPicker
public void setSaturationSliderCaption(@Nullable java.lang.String caption)
ColorPicker
setSaturationSliderCaption
in interface ColorPicker
caption
- caption text.@Nullable public java.lang.String getSaturationSliderCaption()
ColorPicker
getSaturationSliderCaption
in interface ColorPicker
public void setValueSliderCaption(@Nullable java.lang.String caption)
ColorPicker
setValueSliderCaption
in interface ColorPicker
caption
- caption text.@Nullable public java.lang.String getValueSliderCaption()
ColorPicker
getValueSliderCaption
in interface ColorPicker
public void setHistoryVisible(boolean historyVisible)
ColorPicker
setHistoryVisible
in interface ColorPicker
historyVisible
- pane visibility.public boolean isHistoryVisible()
isHistoryVisible
in interface ColorPicker
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 indexpublic void commit()
Buffered
commit
in interface Buffered
commit
in class AbstractValueComponent<JmixColorPickerWrapper,com.vaadin.shared.ui.colorpicker.Color,java.lang.String>
public void discard()
Buffered
discard
in interface Buffered
discard
in class AbstractValueComponent<JmixColorPickerWrapper,com.vaadin.shared.ui.colorpicker.Color,java.lang.String>
public boolean isBuffered()
isBuffered
in interface Buffered
isBuffered
in class AbstractValueComponent<JmixColorPickerWrapper,com.vaadin.shared.ui.colorpicker.Color,java.lang.String>
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<JmixColorPickerWrapper,com.vaadin.shared.ui.colorpicker.Color,java.lang.String>
buffered
- true
if buffered mode should be turned on, false
otherwisepublic boolean isModified()
Buffered
isModified
in interface Buffered
isModified
in class AbstractValueComponent<JmixColorPickerWrapper,com.vaadin.shared.ui.colorpicker.Color,java.lang.String>
true
if the value in the object has been modified
since the last data source update, false
if not.