COLOR_PICKER
- Color picker type to wrappublic abstract class AbstractColorPickerField<COLOR_PICKER extends com.vaadin.ui.AbstractColorPicker>
extends com.vaadin.ui.CustomField<com.vaadin.shared.ui.colorpicker.Color>
implements com.vaadin.ui.components.colorpicker.ColorChangeListener
AbstractColorPicker
s that implements the Field
.com.vaadin.ui.AbstractField.FocusShortcut, com.vaadin.ui.AbstractField.ReadOnlyStatusChangeEvent
com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListener
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener
com.vaadin.server.Sizeable.Unit
com.vaadin.ui.Field.ValueChangeEvent
com.vaadin.data.Buffered.SourceException
com.vaadin.data.Property.Editor, com.vaadin.data.Property.ReadOnlyException, com.vaadin.data.Property.ReadOnlyStatusChangeListener, com.vaadin.data.Property.ReadOnlyStatusChangeNotifier, com.vaadin.data.Property.Transactional<T>, com.vaadin.data.Property.ValueChangeListener, com.vaadin.data.Property.ValueChangeNotifier, com.vaadin.data.Property.Viewer
Modifier and Type | Field and Description |
---|---|
protected static com.vaadin.shared.ui.colorpicker.Color |
DEFAULT_INITIAL_COLOR
Default initial color
|
protected static String |
DEFAULT_POPUP_CAPTION
Default popup caption
|
Constructor and Description |
---|
AbstractColorPickerField(Class<COLOR_PICKER> pickerType)
Instantiates a new color picker field.
|
AbstractColorPickerField(Class<COLOR_PICKER> pickerType,
String popupCaption)
Instantiates a new color picker field.
|
AbstractColorPickerField(Class<COLOR_PICKER> pickerType,
String popupCaption,
com.vaadin.shared.ui.colorpicker.Color initialColor)
Instantiates a new color picker.
|
Modifier and Type | Method and Description |
---|---|
void |
attach() |
void |
colorChanged(com.vaadin.ui.components.colorpicker.ColorChangeEvent event) |
String |
getCaption() |
protected com.vaadin.shared.ui.colorpicker.Color |
getClientColor(com.vaadin.shared.ui.colorpicker.Color color)
Gets the
Color that should be used for the
AbstractColorPicker . |
protected COLOR_PICKER |
getContent() |
protected Collection<String> |
getCustomAttributes() |
com.vaadin.shared.ui.colorpicker.Color |
getDefaultColor()
Gets the default
Color |
com.vaadin.shared.ui.colorpicker.Color |
getNullRepresentation()
Gets the
Color that represents a null value. |
Class<? extends com.vaadin.shared.ui.colorpicker.Color> |
getType() |
void |
hidePopup()
Hides a popup-window for color selection.
|
protected COLOR_PICKER |
initContent() |
boolean |
isContentInitialized() |
void |
readDesign(org.jsoup.nodes.Element design,
com.vaadin.ui.declarative.DesignContext designContext) |
void |
readOnlyStatusChange(com.vaadin.data.Property.ReadOnlyStatusChangeEvent event) |
void |
setCaption(String caption) |
void |
setCaptionAsHtml(boolean captionAsHtml) |
void |
setDefaultCaptionEnabled(boolean enabled)
Set true if the component should show a default caption (css-code for the
currently selected color, e.g.
|
void |
setDefaultColor(com.vaadin.shared.ui.colorpicker.Color defaultColor)
Sets the default
Color |
void |
setHistoryVisibility(boolean visible)
Sets the visibility of the Color History
|
void |
setHSVVisibility(boolean visible)
Set the visibility of the HSV Tab
|
void |
setImmediate(boolean immediate) |
protected void |
setInternalValue(com.vaadin.shared.ui.colorpicker.Color newValue) |
void |
setNullRepresentation(com.vaadin.shared.ui.colorpicker.Color nullRepresentation)
Sets the
Color that represents a null value. |
protected void |
setPopupCaption(String popupCaption)
Sets the caption of the popup window
|
void |
setPopupStyle(com.vaadin.ui.AbstractColorPicker.PopupStyle style)
The style for the popup window
|
void |
setPosition(int x,
int y)
Sets the position of the popup window
|
void |
setRGBVisibility(boolean visible)
Set the visibility of the RGB Tab
|
void |
setSwatchesVisibility(boolean visible)
Set the visibility of the Swatches Tab
|
void |
setTextfieldVisibility(boolean visible)
Sets the visibility of the CSS color code text field
|
void |
showPopup()
Shows a popup-window for color selection.
|
void |
writeDesign(org.jsoup.nodes.Element design,
com.vaadin.ui.declarative.DesignContext designContext) |
addListener, addListener, addReadOnlyStatusChangeListener, addValidator, addValueChangeListener, beforeClientResponse, clear, commit, detach, discard, fireReadOnlyStatusChange, fireValueChange, focus, getConversionError, getConversionError, getConvertedValue, getConverter, getCurrentBufferedSourceException, getErrorMessage, getInternalValue, getModelType, getPropertyDataSource, getRequiredError, getState, getState, getTabIndex, getValidators, getValue, isBuffered, isEmpty, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isRequired, isValid, isValidationVisible, removeAllValidators, removeListener, removeListener, removeReadOnlyStatusChangeListener, removeValidator, removeValueChangeListener, setBuffered, setConversionError, setConvertedValue, setConverter, setConverter, setCurrentBufferedSourceException, setInvalidAllowed, setInvalidCommitted, setLocale, setPropertyDataSource, setReadOnly, setRequired, setRequiredError, setTabIndex, setValidationVisible, setValue, setValue, shouldHideErrors, toString, validate, validate, valueChange
addListener, addShortcutListener, addStyleName, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getComponentError, getData, getDebugId, getDescription, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isImmediate, isOrHasAncestor, isVisible, removeListener, removeShortcutListener, removeStyleName, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeightUndefined, setIcon, setId, setParent, setPrimaryStyleName, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidthUndefined
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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addListener, addStyleName, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidthUndefined
forEach, spliterator
protected static final String DEFAULT_POPUP_CAPTION
protected static final com.vaadin.shared.ui.colorpicker.Color DEFAULT_INITIAL_COLOR
public AbstractColorPickerField(Class<COLOR_PICKER> pickerType)
pickerType
- Type of the wrapped color pickerpublic AbstractColorPickerField(Class<COLOR_PICKER> pickerType, String popupCaption)
pickerType
- Type of the wrapped color pickerpopupCaption
- The caption of the popup windowpublic AbstractColorPickerField(Class<COLOR_PICKER> pickerType, String popupCaption, com.vaadin.shared.ui.colorpicker.Color initialColor)
pickerType
- Type of the wrapped color pickerpopupCaption
- The caption of the popup windowinitialColor
- The initial colorprotected COLOR_PICKER initContent()
initContent
in class com.vaadin.ui.CustomField<com.vaadin.shared.ui.colorpicker.Color>
public void attach()
attach
in interface com.vaadin.server.ClientConnector
attach
in interface com.vaadin.ui.Component
attach
in class com.vaadin.ui.CustomField<com.vaadin.shared.ui.colorpicker.Color>
protected COLOR_PICKER getContent()
getContent
in class com.vaadin.ui.CustomField<com.vaadin.shared.ui.colorpicker.Color>
public Class<? extends com.vaadin.shared.ui.colorpicker.Color> getType()
getType
in interface com.vaadin.data.Property<com.vaadin.shared.ui.colorpicker.Color>
getType
in class com.vaadin.ui.AbstractField<com.vaadin.shared.ui.colorpicker.Color>
public void colorChanged(com.vaadin.ui.components.colorpicker.ColorChangeEvent event)
colorChanged
in interface com.vaadin.ui.components.colorpicker.ColorChangeListener
public void readOnlyStatusChange(com.vaadin.data.Property.ReadOnlyStatusChangeEvent event)
readOnlyStatusChange
in interface com.vaadin.data.Property.ReadOnlyStatusChangeListener
readOnlyStatusChange
in class com.vaadin.ui.AbstractField<com.vaadin.shared.ui.colorpicker.Color>
protected void setInternalValue(com.vaadin.shared.ui.colorpicker.Color newValue)
setInternalValue
in class com.vaadin.ui.AbstractField<com.vaadin.shared.ui.colorpicker.Color>
public void setImmediate(boolean immediate)
setImmediate
in class com.vaadin.ui.AbstractComponent
public void setCaptionAsHtml(boolean captionAsHtml)
setCaptionAsHtml
in class com.vaadin.ui.AbstractComponent
public void setCaption(String caption)
setCaption
in interface com.vaadin.ui.Component
setCaption
in class com.vaadin.ui.AbstractComponent
public String getCaption()
getCaption
in interface com.vaadin.ui.Component
getCaption
in class com.vaadin.ui.AbstractComponent
public boolean isContentInitialized()
protected Collection<String> getCustomAttributes()
getCustomAttributes
in class com.vaadin.ui.AbstractField<com.vaadin.shared.ui.colorpicker.Color>
public void readDesign(org.jsoup.nodes.Element design, com.vaadin.ui.declarative.DesignContext designContext)
readDesign
in interface com.vaadin.ui.Component
readDesign
in class com.vaadin.ui.AbstractField<com.vaadin.shared.ui.colorpicker.Color>
public void writeDesign(org.jsoup.nodes.Element design, com.vaadin.ui.declarative.DesignContext designContext)
writeDesign
in interface com.vaadin.ui.Component
writeDesign
in class com.vaadin.ui.AbstractField<com.vaadin.shared.ui.colorpicker.Color>
protected com.vaadin.shared.ui.colorpicker.Color getClientColor(com.vaadin.shared.ui.colorpicker.Color color)
Color
that should be used for the
AbstractColorPicker
. Returns the given Color
or a default
value if the given Color
is null null
. The default value
is eighter nullRepresentation
or defaultColor
color
- Color
valueColor
that is never nullpublic com.vaadin.shared.ui.colorpicker.Color getDefaultColor()
Color
Color
public void setDefaultColor(com.vaadin.shared.ui.colorpicker.Color defaultColor)
Color
defaultColor
- The default Color
public void setNullRepresentation(com.vaadin.shared.ui.colorpicker.Color nullRepresentation)
Color
that represents a null
value.nullRepresentation
- Color
that represents a null
value.public com.vaadin.shared.ui.colorpicker.Color getNullRepresentation()
Color
that represents a null
value.Color
that represents a null
value.public void setDefaultCaptionEnabled(boolean enabled)
enabled
- Default caption enabledpublic void setPosition(int x, int y)
x
- the x-coordinatey
- the y-coordinatepublic void setPopupStyle(com.vaadin.ui.AbstractColorPicker.PopupStyle style)
style
- The stylepublic void setRGBVisibility(boolean visible)
visible
- The visibilitypublic void setHSVVisibility(boolean visible)
visible
- The visibilitypublic void setSwatchesVisibility(boolean visible)
visible
- The visibilitypublic void setHistoryVisibility(boolean visible)
visible
- The visibilitypublic void setTextfieldVisibility(boolean visible)
visible
- The visibilitypublic void showPopup()
public void hidePopup()
protected void setPopupCaption(String popupCaption)
popupCaption
- The caption of the popup windowCopyright © 2015 Max Schuster. All Rights Reserved.