|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractColorPicker
public abstract class AbstractColorPicker
An abstract class that defines default implementation for a color picker component.
Nested Class Summary | |
---|---|
static interface |
AbstractColorPicker.Coordinates2Color
Interface for converting 2d-coordinates to a Color |
static class |
AbstractColorPicker.PopupStyle
|
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 | |
---|---|
protected com.vaadin.shared.ui.colorpicker.Color |
color
The color. |
protected boolean |
historyVisible
|
protected boolean |
hsvVisible
|
protected java.lang.String |
popupCaption
|
protected AbstractColorPicker.PopupStyle |
popupStyle
|
protected boolean |
rgbVisible
|
protected static java.lang.String |
STYLENAME_AREA
|
protected static java.lang.String |
STYLENAME_BUTTON
|
protected static java.lang.String |
STYLENAME_DEFAULT
|
protected boolean |
swatchesVisible
|
protected boolean |
textfieldVisible
|
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 | |
---|---|
AbstractColorPicker()
Instantiates a new color picker. |
|
AbstractColorPicker(java.lang.String popupCaption)
Instantiates a new color picker. |
|
AbstractColorPicker(java.lang.String popupCaption,
com.vaadin.shared.ui.colorpicker.Color initialColor)
Instantiates a new color picker. |
Method Summary | |
---|---|
void |
addColorChangeListener(ColorChangeListener listener)
Adds a ColorChangeListener to the component. |
protected void |
colorChanged(ColorChangeEvent event)
Fired when a color change event occurs |
void |
fireColorChanged()
Notifies the listeners that the selected color has changed |
com.vaadin.shared.ui.colorpicker.Color |
getColor()
Gets the color. |
protected java.util.Collection<java.lang.String> |
getCustomAttributes()
Returns a collection of attributes that should not be handled by the basic implementation of the readDesign and writeDesign
methods. |
boolean |
getHistoryVisibility()
Gets the visibility of the Color History |
boolean |
getHSVVisibility()
Gets the visibility of the HSV Tab |
AbstractColorPicker.PopupStyle |
getPopupStyle()
Gets the style for the popup window |
boolean |
getRGBVisibility()
Gets the visibility of the RGB Tab |
protected com.vaadin.shared.ui.colorpicker.ColorPickerState |
getState()
Returns the shared state bean with information to be sent from the server to the client. |
protected com.vaadin.shared.ui.colorpicker.ColorPickerState |
getState(boolean markAsDirty)
Returns the shared state for this connector. |
boolean |
getSwatchesVisibility()
Gets the visibility of the Swatches Tab |
boolean |
getTextfieldVisibility()
Gets the visibility of CSS color code text field |
void |
hidePopup()
Hides a popup-window for color selection. |
boolean |
isDefaultCaptionEnabled()
Returns true if the component shows the default caption (css-code for the currently selected color, e.g. |
boolean |
isHtmlContentAllowed()
Deprecated. as of , use AbstractComponent.isCaptionAsHtml() instead |
void |
readDesign(org.jsoup.nodes.Element design,
DesignContext designContext)
Reads the component state from the given design. |
void |
removeColorChangeListener(ColorChangeListener listener)
Removes a ColorChangeListener from the component. |
void |
setColor(com.vaadin.shared.ui.colorpicker.Color color)
Sets the color. |
void |
setDefaultCaptionEnabled(boolean enabled)
Set true if the component should show a default caption (css-code for the currently selected color, e.g. |
protected abstract void |
setDefaultStyles()
Sets the default styles of the component |
void |
setHistoryVisibility(boolean visible)
Sets the visibility of the Color History |
void |
setHSVVisibility(boolean visible)
Set the visibility of the HSV Tab |
void |
setHtmlContentAllowed(boolean htmlContentAllowed)
Deprecated. as of , use AbstractComponent.setCaptionAsHtml(boolean) instead |
void |
setPopupStyle(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. |
protected void |
showPopup(boolean open)
Shows or hides popup-window depending on the given parameter. |
void |
windowClose(Window.CloseEvent e)
Called when the user closes a window. |
void |
writeDesign(org.jsoup.nodes.Element design,
DesignContext designContext)
Writes the component state to the given design. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.vaadin.ui.Component |
---|
getUI |
Methods inherited from interface com.vaadin.server.ClientConnector |
---|
addAttachListener, addDetachListener, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler |
Methods inherited from interface com.vaadin.shared.Connector |
---|
getConnectorId |
Field Detail |
---|
protected static final java.lang.String STYLENAME_DEFAULT
protected static final java.lang.String STYLENAME_BUTTON
protected static final java.lang.String STYLENAME_AREA
protected AbstractColorPicker.PopupStyle popupStyle
protected com.vaadin.shared.ui.colorpicker.Color color
protected java.lang.String popupCaption
protected boolean rgbVisible
protected boolean hsvVisible
protected boolean swatchesVisible
protected boolean historyVisible
protected boolean textfieldVisible
Constructor Detail |
---|
public AbstractColorPicker()
public AbstractColorPicker(java.lang.String popupCaption)
popupCaption
- the caption of the popup windowpublic AbstractColorPicker(java.lang.String popupCaption, com.vaadin.shared.ui.colorpicker.Color initialColor)
popupCaption
- the caption of the popup windowinitialColor
- the initial colorMethod Detail |
---|
public void setColor(com.vaadin.shared.ui.colorpicker.Color color)
ColorSelector
setColor
in interface ColorSelector
color
- the new colorpublic com.vaadin.shared.ui.colorpicker.Color getColor()
ColorSelector
getColor
in interface ColorSelector
public void setDefaultCaptionEnabled(boolean enabled)
enabled
- public boolean isDefaultCaptionEnabled()
public void setPosition(int x, int y)
x
- the x-coordinatey
- the y-coordinatepublic void addColorChangeListener(ColorChangeListener listener)
HasColorChangeListener
ColorChangeListener
to the component.
addColorChangeListener
in interface HasColorChangeListener
public void removeColorChangeListener(ColorChangeListener listener)
HasColorChangeListener
ColorChangeListener
from the component.
removeColorChangeListener
in interface HasColorChangeListener
public void windowClose(Window.CloseEvent e)
Window.CloseListener
Window.CloseEvent.getWindow()
to get a reference to the
Window
that was closed.
windowClose
in interface Window.CloseListener
e
- Event containingprotected void colorChanged(ColorChangeEvent event)
event
- The color change eventpublic void fireColorChanged()
public void setPopupStyle(AbstractColorPicker.PopupStyle style)
style
- The stylepublic AbstractColorPicker.PopupStyle getPopupStyle()
public void setRGBVisibility(boolean visible)
visible
- The visibilitypublic boolean getRGBVisibility()
public void setHSVVisibility(boolean visible)
visible
- The visibilitypublic boolean getHSVVisibility()
public void setSwatchesVisibility(boolean visible)
visible
- The visibilitypublic boolean getSwatchesVisibility()
public void setHistoryVisibility(boolean visible)
visible
- The visibilitypublic boolean getHistoryVisibility()
public void setTextfieldVisibility(boolean visible)
visible
- The visibilitypublic boolean getTextfieldVisibility()
protected com.vaadin.shared.ui.colorpicker.ColorPickerState getState()
AbstractComponent
getState
in class AbstractComponent
protected com.vaadin.shared.ui.colorpicker.ColorPickerState getState(boolean markAsDirty)
AbstractClientConnector
getState
in class AbstractComponent
markAsDirty
- true if the connector should automatically be marked dirty,
false otherwise
AbstractClientConnector.getState()
protected abstract void setDefaultStyles()
public void showPopup()
public void hidePopup()
protected void showPopup(boolean open)
open
- @Deprecated public void setHtmlContentAllowed(boolean htmlContentAllowed)
AbstractComponent.setCaptionAsHtml(boolean)
instead
htmlContentAllowed
- true
if caption is rendered as HTML,
false
otherwise@Deprecated public boolean isHtmlContentAllowed()
AbstractComponent.isCaptionAsHtml()
instead
true
if the caption text is to be rendered as HTML,
false
otherwisepublic void readDesign(org.jsoup.nodes.Element design, DesignContext designContext)
Component
The component is responsible not only for updating its own state but also for ensuring that its children update their state based on the design.
It is assumed that the component is in its default state when this method is called. Reading should only take into consideration attributes specified in the design and not reset any unspecified attributes to their defaults.
This method must not modify the design.
readDesign
in interface Component
readDesign
in class AbstractComponent
design
- The element to obtain the state fromdesignContext
- The DesignContext instance used for parsing the designpublic void writeDesign(org.jsoup.nodes.Element design, DesignContext designContext)
Component
The component is responsible not only for writing its own state but also for ensuring that its children write their state to the design.
This method must not modify the component state.
writeDesign
in interface Component
writeDesign
in class AbstractComponent
design
- The element to write the component state to. Any previous
attributes or child nodes are not cleared.designContext
- The DesignContext instance used for writing the designprotected java.util.Collection<java.lang.String> getCustomAttributes()
AbstractComponent
readDesign
and writeDesign
methods. Typically these are handled in a custom way in the overridden
versions of the above methods
getCustomAttributes
in class AbstractComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |