Class ColorPickerHistory
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.ui.AbstractComponent
-
- com.vaadin.ui.AbstractField<T>
-
- com.vaadin.ui.CustomField<Color>
-
- com.vaadin.ui.components.colorpicker.ColorPickerHistory
-
- All Implemented Interfaces:
HasValue<Color>,ContextClickEvent.ContextClickNotifier,MethodEventSource,ClientConnector,Sizeable,Connector,Component,Component.Focusable,HasComponents,Serializable,Iterable<Component>
public class ColorPickerHistory extends CustomField<Color>
A component that represents color selection history within a color picker.- Since:
- 7.0.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
-
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
-
Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListener
-
Nested classes/interfaces inherited from interface com.vaadin.data.HasValue
HasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<V>
-
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
Sizeable.Unit
-
-
Field Summary
-
Fields inherited from class com.vaadin.ui.AbstractComponent
DESIGN_ATTR_PLAIN_TEXT
-
Fields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
-
-
Constructor Summary
Constructors Constructor Description ColorPickerHistory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattach()Constructs the content and notifies it that theCustomFieldis attached to a window.voiddetach()Notifies the connector that it is detached from its VaadinSession.protected voiddoSetValue(Color color)Sets the value of this field.protected ColorPickerGridgetContent()Returns the content (UI) of the custom component.List<Color>getHistory()Gets the history.ColorgetValue()Returns the current value of this object.booleanhasColor(Color c)Checks if the history contains given color.protected ComponentinitContent()Create the content component or layout for the field.voidsetHeight(String height)Sets the height of the component using String presentation.-
Methods inherited from class com.vaadin.ui.CustomField
focus, getState, getState, getTabIndex, iterator, setFocusDelegate, setHeight, setTabIndex, setWidth
-
Methods inherited from class com.vaadin.ui.AbstractField
addValueChangeListener, createValueChange, getCustomAttributes, isDifferentValue, isReadOnly, isRequiredIndicatorVisible, readDesign, setReadOnly, setRequiredIndicatorVisible, setValue, setValue, writeDesign
-
Methods inherited from class com.vaadin.ui.AbstractComponent
addContextClickListener, addListener, addShortcutListener, addStyleName, beforeClientResponse, 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, setWidthUndefined
-
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, 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, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, beforeClientResponse, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
-
Methods inherited from interface com.vaadin.ui.Component
addListener, 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, writeDesign
-
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
-
Methods inherited from interface com.vaadin.data.HasValue
clear, getDefaultValidator, getEmptyValue, getOptionalValue, isEmpty
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidthFull, setWidthUndefined
-
-
-
-
Method Detail
-
initContent
protected Component initContent()
Description copied from class:CustomFieldCreate the content component or layout for the field. Subclasses ofCustomFieldshould implement this method. Note that this method is called when the CustomField is attached to a layout or whenCustomField.getContent()is called explicitly for the first time. It is only called once for aCustomField.- Specified by:
initContentin classCustomField<Color>- Returns:
Componentrepresenting the UI of the CustomField
-
getContent
protected ColorPickerGrid getContent()
Description copied from class:CustomFieldReturns the content (UI) of the custom component.- Overrides:
getContentin classCustomField<Color>- Returns:
- Component
-
attach
public void attach()
Description copied from class:CustomFieldConstructs the content and notifies it that theCustomFieldis attached to a window.- Specified by:
attachin interfaceClientConnector- Specified by:
attachin interfaceComponent- Overrides:
attachin classCustomField<Color>- See Also:
Component.attach()
-
detach
public void detach()
Description copied from class:AbstractClientConnectorNotifies the connector that it is detached from its VaadinSession.The caller of this method is
Component.setParent(HasComponents)if the parent is in the session. When the parent is detached from the session it is its responsibility to callClientConnector.detach()for each of its children.The
AbstractClientConnector.getSession()andAbstractClientConnector.getUI()methods might returnnullafter this method is called.- Specified by:
detachin interfaceClientConnector- Overrides:
detachin classAbstractComponent
-
setHeight
public void setHeight(String height)
Description copied from interface:SizeableSets the height of the component using String presentation. String presentation is similar to what is used in Cascading Style Sheets. Size can be length or percentage of available size. The empty string ("") or null will unset the height and set the units to pixels. See CSS specification for more details.- Specified by:
setHeightin interfaceSizeable- Overrides:
setHeightin classAbstractComponent- Parameters:
height- in CSS style string representation
-
getValue
public Color getValue()
Description copied from interface:HasValueReturns the current value of this object.Implementation note: the implementing class should document whether null values may be returned or not.
- Returns:
- the current value
-
doSetValue
protected void doSetValue(Color color)
Description copied from class:AbstractFieldSets the value of this field. May do sanitization or throwIllegalArgumentExceptionif the value is invalid. Typically saves the value to shared state.- Specified by:
doSetValuein classAbstractField<Color>- Parameters:
color- the new value of the field
-
hasColor
public boolean hasColor(Color c)
Checks if the history contains given color.- Parameters:
c- the color- Returns:
- true, if successful
-
-