public class ColorPaletteCell extends AbstractEditableCell<String,String>
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.
|
Cell.Context| 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 |
|---|---|
String[] |
getColors()
Returns the colors.
|
String[] |
getLabels()
Returns the labels.
|
boolean |
isEditing(Cell.Context context,
Element parent,
String value) |
void |
onBrowserEvent(Cell.Context context,
Element parent,
String value,
NativeEvent event,
ValueUpdater<String> valueUpdater) |
void |
render(Cell.Context context,
String value,
SafeHtmlBuilder sb) |
void |
select(XElement parent,
Cell.Context context,
String color,
String value,
ValueUpdater<String> valueUpdater)
Selects the color.
|
void |
select(XElement parent,
Cell.Context context,
String newValue,
String currentValue,
ValueUpdater<String> valueUpdater,
boolean suppressEvent)
Selects the color.
|
clearViewData, getViewData, setViewDatadependsOnSelection, getConsumedEvents, handlesSelection, resetFocus, setValuepublic 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 colorspublic String[] getColors()
public String[] getLabels()
public boolean isEditing(Cell.Context context, Element parent, String value)
public void onBrowserEvent(Cell.Context context, Element parent, String value, NativeEvent event, ValueUpdater<String> valueUpdater)
onBrowserEvent in interface Cell<String>onBrowserEvent in class AbstractCell<String>public void render(Cell.Context context, String value, SafeHtmlBuilder sb)
public void select(XElement parent, Cell.Context context, String color, String value, ValueUpdater<String> 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, Cell.Context context, String newValue, String currentValue, ValueUpdater<String> 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 eventCopyright © 2012. All Rights Reserved.