Class ColorPickerHistory
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.ui.AbstractComponent
-
- com.vaadin.ui.CustomComponent
-
- com.vaadin.ui.components.colorpicker.ColorPickerHistory
-
- All Implemented Interfaces:
ContextClickEvent.ContextClickNotifier,MethodEventSource,ClientConnector,Sizeable,Connector,Component,ColorChangeListener,ColorSelector,HasColorChangeListener,HasComponents,Serializable,Iterable<Component>
public class ColorPickerHistory extends CustomComponent implements ColorSelector, ColorChangeListener
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.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()Instantiates a new color picker history.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColorChangeListener(ColorChangeListener listener)Adds a color change listenervoidattach()Notifies the connector that it is connected to a VaadinSession (and therefore also to a UI).voidcolorChanged(ColorChangeEvent event)Called when a new color has been selected.ColorgetColor()Gets the color.List<Color>getHistory()Gets the history.booleanhasColor(Color c)Checks if the history contains given color.voidremoveColorChangeListener(ColorChangeListener listener)Removes a color change listenervoidsetColor(Color color)Sets the color.voidsetHeight(String height)Sets the height of the component using String presentation.-
Methods inherited from class com.vaadin.ui.CustomComponent
getComponentCount, getCompositionRoot, iterator, setCompositionRoot
-
Methods inherited from class com.vaadin.ui.AbstractComponent
addContextClickListener, addListener, addShortcutListener, addStyleName, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getExplicitImmediateValue, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getState, getState, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isImmediate, isOrHasAncestor, isReadOnly, isResponsive, isVisible, readDesign, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeightUndefined, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidth, setWidthUndefined, writeDesign
-
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, 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
-
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, detach, 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, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, readDesign, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible, writeDesign
-
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined
-
-
-
-
Method Detail
-
attach
public void attach()
Description copied from interface:ClientConnectorNotifies the connector that it is connected to a VaadinSession (and therefore also to a UI).The caller of this method is
#setParent(ClientConnector)if the parent is itself already attached to the session. If not, the parent will call theClientConnector.attach()for all its children when it is attached to the session. This method is always called before the connector's data is sent to the client-side for the first time.The attachment logic is implemented in
AbstractClientConnector.- Specified by:
attachin interfaceClientConnector- Specified by:
attachin interfaceComponent- Overrides:
attachin 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
-
setColor
public void setColor(Color color)
Description copied from interface:ColorSelectorSets the color.- Specified by:
setColorin interfaceColorSelector- Parameters:
color- the new color
-
getColor
public Color getColor()
Description copied from interface:ColorSelectorGets the color.- Specified by:
getColorin interfaceColorSelector- Returns:
- the color
-
hasColor
public boolean hasColor(Color c)
Checks if the history contains given color.- Parameters:
c- the color- Returns:
- true, if successful
-
addColorChangeListener
public void addColorChangeListener(ColorChangeListener listener)
Adds a color change listener- Specified by:
addColorChangeListenerin interfaceHasColorChangeListener- Parameters:
listener- The listener
-
removeColorChangeListener
public void removeColorChangeListener(ColorChangeListener listener)
Removes a color change listener- Specified by:
removeColorChangeListenerin interfaceHasColorChangeListener- Parameters:
listener- The listener
-
colorChanged
public void colorChanged(ColorChangeEvent event)
Description copied from interface:ColorChangeListenerCalled when a new color has been selected.- Specified by:
colorChangedin interfaceColorChangeListener- Parameters:
event- An event containing information about the color change.
-
-