public class ColorPaletteCell extends <any> implements DisableCell
Note: the word Cell
in the class name refers to a GWT cell, not
an individual cell in a color palette.
Modifier and Type | Class and Description |
---|---|
static interface |
ColorPaletteCell.ColorPaletteAppearance
The appearance of a color palette.
|
Constructor and Description |
---|
ColorPaletteCell()
Creates a color palette cell with a default set of colors.
|
ColorPaletteCell(ColorPaletteCell.ColorPaletteAppearance appearance)
Creates a color palette cell with the specified appearance.
|
ColorPaletteCell(ColorPaletteCell.ColorPaletteAppearance appearance,
String[] colors,
String[] labels)
Creates a color palette cell with the specified appearance, colors and
labels.
|
ColorPaletteCell(String[] colors,
String[] labels)
Creates a new color palette.
|
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addSelectionHandler(<any> handler) |
protected HandlerManager |
createHandlerManager()
Creates the
HandlerManager used by this Widget. |
void |
disable(Context context,
Element parent) |
void |
enable(Context context,
Element parent) |
protected HandlerManager |
ensureHandlers()
Ensures the existence of the handler manager.
|
void |
fireEvent(<any> event) |
ColorPaletteCell.ColorPaletteAppearance |
getAppearance() |
String[] |
getColors()
Returns the colors.
|
Set<String> |
getConsumedEvents() |
String[] |
getLabels()
Returns the labels.
|
boolean |
isEditing(Context context,
Element parent,
String value) |
protected void |
onBlur(Context context,
XElement parent,
String currentValue,
NativeEvent event,
<any> valueUpdater) |
void |
onBrowserEvent(Context context,
Element parent,
String value,
NativeEvent event,
<any> valueUpdater) |
protected void |
onClick(Context context,
XElement parent,
String currentValue,
NativeEvent event,
<any> valueUpdater) |
protected void |
onFocus(Context context,
XElement parent,
String currentValue,
NativeEvent event,
<any> valueUpdater) |
protected void |
onKeyDown(Context context,
XElement parent,
String currentValue,
NativeEvent event,
<any> valueUpdater) |
protected void |
onKeyLeft(Context context,
XElement parent,
String currentValue,
NativeEvent event,
<any> valueUpdater) |
protected void |
onKeyRight(Context context,
XElement parent,
String currentValue,
NativeEvent event,
<any> valueUpdater) |
protected void |
onKeyUp(Context context,
XElement parent,
String currentValue,
NativeEvent event,
<any> valueUpdater) |
protected void |
onMouseOut(Context context,
XElement parent,
String currentValue,
NativeEvent event,
<any> valueUpdater) |
protected void |
onMouseOver(Context context,
XElement parent,
String currentValue,
NativeEvent event,
<any> valueUpdater) |
void |
render(Context context,
String value,
SafeHtmlBuilder sb) |
void |
select(XElement parent,
Context context,
String color,
String value,
<any> valueUpdater)
Selects the color.
|
void |
select(XElement parent,
Context context,
String newValue,
String currentValue,
<any> valueUpdater,
boolean suppressEvent)
Selects the color.
|
public ColorPaletteCell()
public ColorPaletteCell(ColorPaletteCell.ColorPaletteAppearance appearance)
appearance
- the color palette appearancepublic ColorPaletteCell(ColorPaletteCell.ColorPaletteAppearance appearance, String[] colors, String[] labels)
appearance
- the color palette appearancecolors
- the colors, each consisting of a six digit hex value in
RRGGBB formatlabels
- the color names, in the same order as colors
public HandlerRegistration addSelectionHandler(<any> handler)
public void disable(Context context, Element parent)
disable
in interface DisableCell
public void enable(Context context, Element parent)
enable
in interface DisableCell
public void fireEvent(<any> event)
public ColorPaletteCell.ColorPaletteAppearance getAppearance()
public String[] getColors()
public String[] getLabels()
public boolean isEditing(Context context, Element parent, String value)
public void onBrowserEvent(Context context, Element parent, String value, NativeEvent event, <any> valueUpdater)
public void render(Context context, String value, SafeHtmlBuilder sb)
public void select(XElement parent, Context context, String color, String value, <any> valueUpdater)
parent
- the parent of the color element to selectcontext
- information about the context of the cellcolor
- the color of the element to selectvalue
- the currently selected valuevalueUpdater
- the cell's value updater which will receive the new
valuepublic void select(XElement parent, Context context, String newValue, String currentValue, <any> valueUpdater, boolean suppressEvent)
parent
- the parent of the color element to selectcontext
- information about the context of the cellnewValue
- the color of the element to selectcurrentValue
- the current cell valuevalueUpdater
- the cell's value updater which will receive the new
valuesuppressEvent
- true to suppress the select eventprotected HandlerManager createHandlerManager()
HandlerManager
used by this Widget. You can override
this method to create a custom HandlerManager
.HandlerManager
you want to useprotected void onBlur(Context context, XElement parent, String currentValue, NativeEvent event, <any> valueUpdater)
protected void onClick(Context context, XElement parent, String currentValue, NativeEvent event, <any> valueUpdater)
protected void onFocus(Context context, XElement parent, String currentValue, NativeEvent event, <any> valueUpdater)
protected void onKeyDown(Context context, XElement parent, String currentValue, NativeEvent event, <any> valueUpdater)
protected void onKeyLeft(Context context, XElement parent, String currentValue, NativeEvent event, <any> valueUpdater)
protected void onKeyRight(Context context, XElement parent, String currentValue, NativeEvent event, <any> valueUpdater)
protected void onKeyUp(Context context, XElement parent, String currentValue, NativeEvent event, <any> valueUpdater)
protected void onMouseOut(Context context, XElement parent, String currentValue, NativeEvent event, <any> valueUpdater)
protected void onMouseOver(Context context, XElement parent, String currentValue, NativeEvent event, <any> valueUpdater)
protected HandlerManager ensureHandlers()
Copyright © 2018. All rights reserved.