public class ColorPickerPreview extends CssLayout implements HasValue<Color>
HasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<V>Layout.AlignmentHandler, Layout.MarginHandler, Layout.SpacingHandlerHasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListenerComponent.ErrorEvent, Component.Event, Component.Focusable, Component.ListenerClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListenerSizeable.UnitcomponentsDESIGN_ATTR_PLAIN_TEXTSIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS| Constructor and Description |
|---|
ColorPickerPreview(Color color)
Instantiates a new color picker preview.
|
| Modifier and Type | Method and Description |
|---|---|
Registration |
addValueChangeListener(HasValue.ValueChangeListener<Color> listener)
Adds a value change listener.
|
protected String |
getCss(Component c)
Returns styles to be applied to given component.
|
protected String |
getUserErrorText(String value)
Get the client error message text for color input parsing error.
|
Color |
getValue()
Returns the current value of this object.
|
boolean |
isReadOnly()
Returns the read-only status from the state of this
AbstractComponent. |
boolean |
isRequiredIndicatorVisible()
Checks whether the required indicator is visible or not.
|
void |
setReadOnly(boolean readOnly)
Sets the read-only status in the state of this
AbstractComponent. |
void |
setRequiredIndicatorVisible(boolean visible)
Sets the visibility of the required indicator.
|
void |
setValue(Color color)
Sets the value of this object.
|
addComponent, addComponent, addComponentAsFirst, addLayoutClickListener, beforeClientResponse, getComponent, getComponentCount, getComponentIndex, getState, getState, iterator, readDesign, removeComponent, removeLayoutClickListener, replaceComponent, writeDesignreadMargin, writeMarginaddComponentAttachListener, addComponentDetachListener, addComponents, fireComponentAttachEvent, fireComponentDetachEvent, getComponentIterator, moveComponentsFrom, removeAllComponents, removeComponentAttachListener, removeComponentDetachListener, setHeight, setWidthaddContextClickListener, addListener, addShortcutListener, addStyleName, attach, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeightFull, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidthFull, setWidthUndefinedaddAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstateclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitclear, getDefaultValidator, getEmptyValue, getOptionalValue, isEmptyaddComponents, getComponentIterator, moveComponentsFrom, removeAllComponentsaddListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisibleaddAttachListener, addDetachListener, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlergetConnectorIdgetHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefinedforEach, spliteratoraddComponentAttachListener, addComponentDetachListener, removeComponentAttachListener, removeComponentDetachListenerpublic ColorPickerPreview(Color color)
public void setValue(Color color)
getValue(), fires a ValueChangeEvent. Throws
NullPointerException if the value is null.setValue in interface HasValue<Color>color - the new value, not nullNullPointerException - if color is nullpublic Color getValue()
HasValueImplementation note: the implementing class should document whether null values may be returned or not.
public Registration addValueChangeListener(HasValue.ValueChangeListener<Color> listener)
HasValueHasValue is changed either by the user or programmatically.addValueChangeListener in interface HasValue<Color>listener - the value change listener, not nullprotected String getCss(Component c)
CssLayoutNote 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.
public void setRequiredIndicatorVisible(boolean visible)
AbstractComponent
If the component supports the required indicator (state extends
AbstractFieldState), then expose this method and
AbstractComponent.isRequiredIndicatorVisible() as public in the component
and call this method.
This method will throw a IllegalStateException if the component
state (returned by AbstractComponent.getState()) does not inherit
AbstractFieldState.
setRequiredIndicatorVisible in interface HasValue<Color>setRequiredIndicatorVisible in class AbstractComponentvisible - true to make the required indicator visible,
false if notpublic boolean isRequiredIndicatorVisible()
AbstractComponent
This method will throw a IllegalStateException if the component
state (returned by AbstractComponent.getState()) does not inherit
AbstractFieldState.
isRequiredIndicatorVisible in interface HasValue<Color>isRequiredIndicatorVisible in class AbstractComponenttrue if visible, false if notAbstractComponent.setRequiredIndicatorVisible(boolean)public void setReadOnly(boolean readOnly)
AbstractComponentAbstractComponent.
This method should be made public in Components that
implement HasValue.setReadOnly in interface HasValue<Color>setReadOnly in class AbstractComponentreadOnly - a boolean value specifying whether the component is put
read-only mode or notpublic boolean isReadOnly()
AbstractComponentAbstractComponent. This method should be made public in
Components that implement HasValue.isReadOnly in interface HasValue<Color>isReadOnly in class AbstractComponenttrue if state has read-only on; false if notAbstractComponent.setReadOnly(boolean)Copyright © 2020 Vaadin Ltd. All rights reserved.