Class ColorPickerPreview

    • Constructor Detail

      • ColorPickerPreview

        public ColorPickerPreview​(com.vaadin.shared.ui.colorpicker.Color color)
        Instantiates a new color picker preview.
    • Method Detail

      • setValue

        public void setValue​(com.vaadin.shared.ui.colorpicker.Color color)
        Sets the value of this object. If the new value is not equal to getValue(), fires a HasValue.ValueChangeEvent. Throws NullPointerException if the value is null.
        Specified by:
        setValue in interface HasValue<com.vaadin.shared.ui.colorpicker.Color>
        Parameters:
        color - the new value, not null
        Throws:
        java.lang.NullPointerException - if color is null
      • getValue

        public com.vaadin.shared.ui.colorpicker.Color getValue()
        Description copied from interface: HasValue
        Returns the current value of this object.

        Implementation note: the implementing class should document whether null values may be returned or not.

        Specified by:
        getValue in interface HasValue<com.vaadin.shared.ui.colorpicker.Color>
        Returns:
        the current value
      • addValueChangeListener

        public com.vaadin.shared.Registration addValueChangeListener​(HasValue.ValueChangeListener<com.vaadin.shared.ui.colorpicker.Color> listener)
        Description copied from interface: HasValue
        Adds a value change listener. The listener is called when the value of this HasValue is changed either by the user or programmatically.
        Specified by:
        addValueChangeListener in interface HasValue<com.vaadin.shared.ui.colorpicker.Color>
        Parameters:
        listener - the value change listener, not null
        Returns:
        a registration for the listener
      • getCss

        protected java.lang.String getCss​(Component c)
        Description copied from class: CssLayout
        Returns styles to be applied to given component. Override this method to inject custom style rules to components.

        Note that styles are injected over previous styles before actual child rendering. Previous styles are not cleared, but overridden.

        Note that one most often achieves better code style, by separating styling to theme (with custom theme and AbstractComponent.addStyleName(String). With own custom styles it is also very easy to break browser compatibility.

        Overrides:
        getCss in class CssLayout
        Parameters:
        c - the component
        Returns:
        css rules to be applied to component
      • setReadOnly

        public void setReadOnly​(boolean readOnly)
        Description copied from class: AbstractComponent
        Sets the read-only status in the state of this AbstractComponent. This method should be made public in Components that implement HasValue.
        Specified by:
        setReadOnly in interface HasValue<com.vaadin.shared.ui.colorpicker.Color>
        Overrides:
        setReadOnly in class AbstractComponent
        Parameters:
        readOnly - a boolean value specifying whether the component is put read-only mode or not
      • getUserErrorText

        protected java.lang.String getUserErrorText​(java.lang.String value)
        Get the client error message text for color input parsing error.
        Parameters:
        value - input which caused the error
        Returns:
        error message text
        Since:
        8.4