Class ColorPickerImpl

All Implemented Interfaces:
AttachNotifier, Buffered, ColorPicker, Component, Component.BelongToFrame, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper, HasValueSource<String>, Field<String>, HasContextHelp, HasDebugId, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer, HasValidator<String>, HasValue<String>, Requirable, Validatable, org.springframework.beans.factory.InitializingBean

public class ColorPickerImpl extends AbstractField<JmixColorPickerWrapper,com.vaadin.shared.ui.colorpicker.Color,String> implements ColorPicker, org.springframework.beans.factory.InitializingBean
  • Field Details

    • messages

      protected Messages messages
  • Constructor Details

    • ColorPickerImpl

      public ColorPickerImpl()
  • Method Details

    • createComponent

      protected JmixColorPickerWrapper createComponent()
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • initComponent

      protected void initComponent(JmixColorPickerWrapper component)
    • setMessages

      @Autowired public void setMessages(Messages messages)
    • setCaptions

      protected void setCaptions(Messages messages)
    • setSwatchesVisible

      public void setSwatchesVisible(boolean value)
      Description copied from interface: ColorPicker
      Sets visibility for swatches tab
      Specified by:
      setSwatchesVisible in interface ColorPicker
      Parameters:
      value - tab visibility.
    • isSwatchesVisible

      public boolean isSwatchesVisible()
      Specified by:
      isSwatchesVisible in interface ColorPicker
      Returns:
      true if swatches tab is visible.
    • setRGBVisible

      public void setRGBVisible(boolean value)
      Description copied from interface: ColorPicker
      Sets visibility for RGB tab
      Specified by:
      setRGBVisible in interface ColorPicker
      Parameters:
      value - tab visibility.
    • isRGBVisible

      public boolean isRGBVisible()
      Specified by:
      isRGBVisible in interface ColorPicker
      Returns:
      true if RGB tab is visible.
    • setHSVVisible

      public void setHSVVisible(boolean value)
      Description copied from interface: ColorPicker
      Sets visibility for HSV tab
      Specified by:
      setHSVVisible in interface ColorPicker
      Parameters:
      value - tab visibility.
    • isHSVVisible

      public boolean isHSVVisible()
      Specified by:
      isHSVVisible in interface ColorPicker
      Returns:
      true if HSV tab is visible.
    • setDefaultCaptionEnabled

      public void setDefaultCaptionEnabled(boolean defaultCaptionEnabled)
      Description copied from interface: ColorPicker
      Sets HEX value as button caption.
      Specified by:
      setDefaultCaptionEnabled in interface ColorPicker
      Parameters:
      defaultCaptionEnabled - true if HEX color is shown as button caption.
    • isDefaultCaptionEnabled

      public boolean isDefaultCaptionEnabled()
      Specified by:
      isDefaultCaptionEnabled in interface ColorPicker
      Returns:
      true if caption is shown as HTML.
    • setButtonCaption

      public void setButtonCaption(String value)
      Description copied from interface: ColorPicker
      Sets caption for color picker button.
      Specified by:
      setButtonCaption in interface ColorPicker
      Parameters:
      value - caption text.
    • getButtonCaption

      public String getButtonCaption()
      Description copied from interface: ColorPicker
      Returns caption of color picker button.
      Specified by:
      getButtonCaption in interface ColorPicker
      Returns:
      caption text.
    • convertToModel

      @Nullable protected String convertToModel(@Nullable com.vaadin.shared.ui.colorpicker.Color componentRawValue) throws ConversionException
      Overrides:
      convertToModel in class AbstractValueComponent<JmixColorPickerWrapper,com.vaadin.shared.ui.colorpicker.Color,String>
      Throws:
      ConversionException
    • convertToPresentation

      @Nullable protected com.vaadin.shared.ui.colorpicker.Color convertToPresentation(@Nullable String modelValue) throws ConversionException
      Overrides:
      convertToPresentation in class AbstractValueComponent<JmixColorPickerWrapper,com.vaadin.shared.ui.colorpicker.Color,String>
      Throws:
      ConversionException
    • setPopupCaption

      public void setPopupCaption(@Nullable String popupCaption)
      Description copied from interface: ColorPicker
      Sets caption for the popup window.
      Specified by:
      setPopupCaption in interface ColorPicker
      Parameters:
      popupCaption - caption text.
    • getPopupCaption

      @Nullable public String getPopupCaption()
      Description copied from interface: ColorPicker
      Returns caption of the popup window.
      Specified by:
      getPopupCaption in interface ColorPicker
      Returns:
      caption text.
    • setConfirmButtonCaption

      public void setConfirmButtonCaption(@Nullable String caption)
      Description copied from interface: ColorPicker
      Sets caption for the confirm button.
      Specified by:
      setConfirmButtonCaption in interface ColorPicker
      Parameters:
      caption - caption text.
    • getConfirmButtonCaption

      @Nullable public String getConfirmButtonCaption()
      Description copied from interface: ColorPicker
      Returns caption of the confirm button.
      Specified by:
      getConfirmButtonCaption in interface ColorPicker
      Returns:
      caption text.
    • setCancelButtonCaption

      public void setCancelButtonCaption(@Nullable String caption)
      Description copied from interface: ColorPicker
      Sets caption for the cancel button.
      Specified by:
      setCancelButtonCaption in interface ColorPicker
      Parameters:
      caption - caption text.
    • getCancelButtonCaption

      @Nullable public String getCancelButtonCaption()
      Description copied from interface: ColorPicker
      Returns caption of the cancel button.
      Specified by:
      getCancelButtonCaption in interface ColorPicker
      Returns:
      caption text.
    • setSwatchesTabCaption

      public void setSwatchesTabCaption(@Nullable String caption)
      Description copied from interface: ColorPicker
      Sets caption for the swatches tab.
      Specified by:
      setSwatchesTabCaption in interface ColorPicker
      Parameters:
      caption - caption text.
    • getSwatchesTabCaption

      @Nullable public String getSwatchesTabCaption()
      Description copied from interface: ColorPicker
      Returns caption of the swatches tab.
      Specified by:
      getSwatchesTabCaption in interface ColorPicker
      Returns:
      caption text.
    • setLookupAllCaption

      public void setLookupAllCaption(@Nullable String caption)
      Description copied from interface: ColorPicker
      Sets caption for the all colors in lookup.
      Specified by:
      setLookupAllCaption in interface ColorPicker
      Parameters:
      caption - caption text.
    • getLookupAllCaption

      @Nullable public String getLookupAllCaption()
      Description copied from interface: ColorPicker
      Returns caption of the all colors in lookup.
      Specified by:
      getLookupAllCaption in interface ColorPicker
      Returns:
      caption text.
    • setLookupRedCaption

      public void setLookupRedCaption(@Nullable String caption)
      Description copied from interface: ColorPicker
      Sets caption for the red colors in lookup.
      Specified by:
      setLookupRedCaption in interface ColorPicker
      Parameters:
      caption - caption text.
    • getLookupRedCaption

      @Nullable public String getLookupRedCaption()
      Description copied from interface: ColorPicker
      Returns caption of the red colors in lookup.
      Specified by:
      getLookupRedCaption in interface ColorPicker
      Returns:
      caption text.
    • setLookupGreenCaption

      public void setLookupGreenCaption(@Nullable String caption)
      Description copied from interface: ColorPicker
      Sets caption for the green colors in lookup.
      Specified by:
      setLookupGreenCaption in interface ColorPicker
      Parameters:
      caption - caption text.
    • getLookupGreenCaption

      @Nullable public String getLookupGreenCaption()
      Description copied from interface: ColorPicker
      Returns caption of the green colors in lookup.
      Specified by:
      getLookupGreenCaption in interface ColorPicker
      Returns:
      caption text.
    • setLookupBlueCaption

      public void setLookupBlueCaption(@Nullable String caption)
      Description copied from interface: ColorPicker
      Sets caption for the blue colors in lookup.
      Specified by:
      setLookupBlueCaption in interface ColorPicker
      Parameters:
      caption - caption text.
    • getLookupBlueCaption

      @Nullable public String getLookupBlueCaption()
      Description copied from interface: ColorPicker
      Returns caption of the blue colors in lookup.
      Specified by:
      getLookupBlueCaption in interface ColorPicker
      Returns:
      caption text.
    • setRedSliderCaption

      public void setRedSliderCaption(@Nullable String caption)
      Description copied from interface: ColorPicker
      Sets caption for the slider of red color.
      Specified by:
      setRedSliderCaption in interface ColorPicker
      Parameters:
      caption - caption text.
    • getRedSliderCaption

      @Nullable public String getRedSliderCaption()
      Description copied from interface: ColorPicker
      Returns caption of the slider for red color.
      Specified by:
      getRedSliderCaption in interface ColorPicker
      Returns:
      caption text.
    • setGreenSliderCaption

      public void setGreenSliderCaption(@Nullable String caption)
      Description copied from interface: ColorPicker
      Sets caption for the slider of green color.
      Specified by:
      setGreenSliderCaption in interface ColorPicker
      Parameters:
      caption - caption text.
    • getGreenSliderCaption

      @Nullable public String getGreenSliderCaption()
      Description copied from interface: ColorPicker
      Returns caption of the slider for green color.
      Specified by:
      getGreenSliderCaption in interface ColorPicker
      Returns:
      caption text.
    • setBlueSliderCaption

      public void setBlueSliderCaption(@Nullable String caption)
      Description copied from interface: ColorPicker
      Sets caption for the slider of blue color.
      Specified by:
      setBlueSliderCaption in interface ColorPicker
      Parameters:
      caption - caption text.
    • getBlueSliderCaption

      @Nullable public String getBlueSliderCaption()
      Description copied from interface: ColorPicker
      Returns caption of the slider for blue color.
      Specified by:
      getBlueSliderCaption in interface ColorPicker
      Returns:
      caption text.
    • setHueSliderCaption

      public void setHueSliderCaption(@Nullable String caption)
      Description copied from interface: ColorPicker
      Sets caption for the HUE slider.
      Specified by:
      setHueSliderCaption in interface ColorPicker
      Parameters:
      caption - caption text.
    • getHueSliderCaption

      @Nullable public String getHueSliderCaption()
      Description copied from interface: ColorPicker
      Returns caption of the slider for HUE.
      Specified by:
      getHueSliderCaption in interface ColorPicker
      Returns:
      caption text.
    • setSaturationSliderCaption

      public void setSaturationSliderCaption(@Nullable String caption)
      Description copied from interface: ColorPicker
      Sets caption for the saturation slider.
      Specified by:
      setSaturationSliderCaption in interface ColorPicker
      Parameters:
      caption - caption text.
    • getSaturationSliderCaption

      @Nullable public String getSaturationSliderCaption()
      Description copied from interface: ColorPicker
      Returns caption of the slider for saturation.
      Specified by:
      getSaturationSliderCaption in interface ColorPicker
      Returns:
      caption text.
    • setValueSliderCaption

      public void setValueSliderCaption(@Nullable String caption)
      Description copied from interface: ColorPicker
      Sets caption for the value slider.
      Specified by:
      setValueSliderCaption in interface ColorPicker
      Parameters:
      caption - caption text.
    • getValueSliderCaption

      @Nullable public String getValueSliderCaption()
      Description copied from interface: ColorPicker
      Returns caption of the slider for value.
      Specified by:
      getValueSliderCaption in interface ColorPicker
      Returns:
      caption text.
    • setHistoryVisible

      public void setHistoryVisible(boolean historyVisible)
      Description copied from interface: ColorPicker
      Sets visibility for history pane
      Specified by:
      setHistoryVisible in interface ColorPicker
      Parameters:
      historyVisible - pane visibility.
    • isHistoryVisible

      public boolean isHistoryVisible()
      Specified by:
      isHistoryVisible in interface ColorPicker
      Returns:
      true if history pane is visible.
    • focus

      public void focus()
      Description copied from interface: Component.Focusable
      Sets focus to this component
      Specified by:
      focus in interface Component.Focusable
    • getTabIndex

      public int getTabIndex()
      Description copied from interface: Component.Focusable
      Gets the tabulator index of the HasTabIndex component.
      Specified by:
      getTabIndex in interface Component.Focusable
      Returns:
      tab index set for the HasTabIndex component
    • setTabIndex

      public void setTabIndex(int tabIndex)
      Description copied from interface: Component.Focusable
      Sets the tabulator index of the 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.
      Specified by:
      setTabIndex in interface Component.Focusable
      Parameters:
      tabIndex - tab index
    • commit

      public void commit()
      Description copied from interface: Buffered
      Updates all changes since the previous commit to the data source.
      Specified by:
      commit in interface Buffered
      Overrides:
      commit in class AbstractValueComponent<JmixColorPickerWrapper,com.vaadin.shared.ui.colorpicker.Color,String>
    • discard

      public void discard()
      Description copied from interface: Buffered
      Discards all changes since last commit. The object updates its value from the data source.
      Specified by:
      discard in interface Buffered
      Overrides:
      discard in class AbstractValueComponent<JmixColorPickerWrapper,com.vaadin.shared.ui.colorpicker.Color,String>
    • isBuffered

      public boolean isBuffered()
      Specified by:
      isBuffered in interface Buffered
      Overrides:
      isBuffered in class AbstractValueComponent<JmixColorPickerWrapper,com.vaadin.shared.ui.colorpicker.Color,String>
      Returns:
      true if buffered mode is on, false otherwise
    • setBuffered

      public void setBuffered(boolean buffered)
      Description copied from interface: Buffered
      Sets the buffered mode.

      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.

      Specified by:
      setBuffered in interface Buffered
      Overrides:
      setBuffered in class AbstractValueComponent<JmixColorPickerWrapper,com.vaadin.shared.ui.colorpicker.Color,String>
      Parameters:
      buffered - true if buffered mode should be turned on, false otherwise
    • isModified

      public boolean isModified()
      Description copied from interface: Buffered
      Tests if the value stored in the object has been modified since it was last updated from the data source.
      Specified by:
      isModified in interface Buffered
      Overrides:
      isModified in class AbstractValueComponent<JmixColorPickerWrapper,com.vaadin.shared.ui.colorpicker.Color,String>
      Returns:
      true if the value in the object has been modified since the last data source update, false if not.