com.vaadin.ui.components.colorpicker
Class ColorPickerHistory

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.ui.AbstractComponent
          extended by com.vaadin.ui.CustomComponent
              extended by com.vaadin.ui.components.colorpicker.ColorPickerHistory
All Implemented Interfaces:
MethodEventSource, ClientConnector, Sizeable, com.vaadin.shared.Connector, Component, ColorChangeListener, ColorSelector, HasColorChangeListener, HasComponents, java.io.Serializable, java.lang.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.ui.HasComponents
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListener
 
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.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
 
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
Sizeable.Unit
 
Field Summary
 
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
ColorPickerHistory()
          Instantiates a new color picker history.
 
Method Summary
 void addColorChangeListener(ColorChangeListener listener)
          Adds a color change listener
 void attach()
          Notifies the connector that it is connected to a VaadinSession (and therefore also to a UI).
 void colorChanged(ColorChangeEvent event)
          Called when a new color has been selected.
 com.vaadin.shared.ui.colorpicker.Color getColor()
          Gets the color.
 java.util.List<com.vaadin.shared.ui.colorpicker.Color> getHistory()
          Gets the history.
 boolean hasColor(com.vaadin.shared.ui.colorpicker.Color c)
          Checks if the history contains given color.
 void removeColorChangeListener(ColorChangeListener listener)
          Removes a color change listener
 void setColor(com.vaadin.shared.ui.colorpicker.Color color)
          Sets the color.
 void setHeight(java.lang.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
addListener, addShortcutListener, addStyleName, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getState, getState, getStyleName, getWidth, getWidthUnits, isConnectorEnabled, isEnabled, isImmediate, isReadOnly, isVisible, removeListener, removeShortcutListener, removeStyleName, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth
 
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hasListeners, isAttached, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible
 
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.shared.Connector
getConnectorId
 
Methods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setSizeFull, setSizeUndefined, setWidth, setWidth
 

Constructor Detail

ColorPickerHistory

public ColorPickerHistory()
Instantiates a new color picker history.

Method Detail

attach

public void attach()
Description copied from interface: ClientConnector
Notifies 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 the ClientConnector.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:
attach in interface ClientConnector
Specified by:
attach in interface Component
Overrides:
attach in class AbstractComponent

setHeight

public void setHeight(java.lang.String height)
Description copied from interface: Sizeable
Sets 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:
setHeight in interface Sizeable
Overrides:
setHeight in class AbstractComponent
Parameters:
height - in CSS style string representation

setColor

public void setColor(com.vaadin.shared.ui.colorpicker.Color color)
Description copied from interface: ColorSelector
Sets the color.

Specified by:
setColor in interface ColorSelector
Parameters:
color - the new color

getColor

public com.vaadin.shared.ui.colorpicker.Color getColor()
Description copied from interface: ColorSelector
Gets the color.

Specified by:
getColor in interface ColorSelector
Returns:
the color

getHistory

public java.util.List<com.vaadin.shared.ui.colorpicker.Color> getHistory()
Gets the history.

Returns:
the history

hasColor

public boolean hasColor(com.vaadin.shared.ui.colorpicker.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:
addColorChangeListener in interface HasColorChangeListener
Parameters:
listener - The listener

removeColorChangeListener

public void removeColorChangeListener(ColorChangeListener listener)
Removes a color change listener

Specified by:
removeColorChangeListener in interface HasColorChangeListener
Parameters:
listener - The listener

colorChanged

public void colorChanged(ColorChangeEvent event)
Description copied from interface: ColorChangeListener
Called when a new color has been selected.

Specified by:
colorChanged in interface ColorChangeListener
Parameters:
event - An event containing information about the color change.


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.