public class ColorPickerHistory extends CustomField<Color>
HasComponents.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.UnitHasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<V>DESIGN_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 |
|---|
ColorPickerHistory() |
| Modifier and Type | Method and Description |
|---|---|
void |
attach()
Constructs the content and notifies it that the
CustomField is
attached to a window. |
protected void |
doSetValue(Color color)
Sets the value of this field.
|
protected ColorPickerGrid |
getContent()
Returns the content (UI) of the custom component.
|
List<Color> |
getHistory()
Gets the history.
|
Color |
getValue()
Returns the current value of this object.
|
boolean |
hasColor(Color c)
Checks if the history contains given color.
|
protected Component |
initContent()
Create the content component or layout for the field.
|
void |
setHeight(String height)
Sets the height of the component using String presentation.
|
focus, getState, getState, getTabIndex, iterator, setFocusDelegate, setHeight, setTabIndex, setWidthaddValueChangeListener, createValueChange, getCustomAttributes, isDifferentValue, isReadOnly, isRequiredIndicatorVisible, readDesign, setReadOnly, setRequiredIndicatorVisible, setValue, setValue, writeDesignaddContextClickListener, addListener, addShortcutListener, addStyleName, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, 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, 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, waitaddListener, addStyleName, addStyleNames, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, readDesign, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible, writeDesignaddAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlergetConnectorIdgetHeight, getHeightUnits, getWidth, getWidthUnits, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidthFull, setWidthUndefinedforEach, spliteratorclear, getDefaultValidator, getEmptyValue, getOptionalValue, isEmptyprotected Component initContent()
CustomFieldCustomField should implement this method.
Note that this method is called when the CustomField is attached to a
layout or when CustomField.getContent() is called explicitly for the first
time. It is only called once for a CustomField.initContent in class CustomField<Color>Component representing the UI of the CustomFieldprotected ColorPickerGrid getContent()
CustomFieldgetContent in class CustomField<Color>public void attach()
CustomFieldCustomField is
attached to a window.attach in interface ClientConnectorattach in interface Componentattach in class CustomField<Color>Component.attach()public void setHeight(String height)
SizeablesetHeight in interface SizeablesetHeight in class AbstractComponentheight - in CSS style string representationpublic Color getValue()
HasValueImplementation note: the implementing class should document whether null values may be returned or not.
protected void doSetValue(Color color)
AbstractFieldIllegalArgumentException if the value is invalid. Typically saves
the value to shared state.doSetValue in class AbstractField<Color>color - the new value of the fieldpublic boolean hasColor(Color c)
c - the colorCopyright © 2020 Vaadin Ltd. All rights reserved.