PRESENTATION
- The presentation type. Must be compatible with what
AbstractColorConverter.getPresentationType()
returns.MODEL
- The model type. Must be compatible with what
AbstractColorConverter.getModelType()
returns.public abstract class AbstractHexColorConverter<PRESENTATION,MODEL> extends AbstractColorConverter<PRESENTATION,MODEL>
Converter
s that convert between CSS hex color and Color
Constructor and Description |
---|
AbstractHexColorConverter(Class<PRESENTATION> presentationType,
Class<MODEL> modelType) |
Modifier and Type | Method and Description |
---|---|
protected String |
serializeColor(com.vaadin.shared.ui.colorpicker.Color color)
Serializes the given
Color as a String . |
protected com.vaadin.shared.ui.colorpicker.Color |
unserializeColor(String string)
Unserializes the given
String as a Color . |
getModelType, getPresentationType
public AbstractHexColorConverter(Class<PRESENTATION> presentationType, Class<MODEL> modelType)
protected String serializeColor(com.vaadin.shared.ui.colorpicker.Color color) throws com.vaadin.data.util.converter.Converter.ConversionException
AbstractColorConverter
Color
as a String
. The String must
be unserialize by AbstractColorConverter.unserializeColor(java.lang.String)
serializeColor
in class AbstractColorConverter<PRESENTATION,MODEL>
color
- The Color
to serialize. Never null
.Color
serialized as String
com.vaadin.data.util.converter.Converter.ConversionException
protected com.vaadin.shared.ui.colorpicker.Color unserializeColor(String string) throws com.vaadin.data.util.converter.Converter.ConversionException
AbstractColorConverter
String
as a Color
.unserializeColor
in class AbstractColorConverter<PRESENTATION,MODEL>
string
- The String
to unserialize. Never null
.String
unserialized as Color
com.vaadin.data.util.converter.Converter.ConversionException
Copyright © 2015 Max Schuster. All Rights Reserved.