public class ColorPaletteCell extends AbstractEditableCell<String,String> implements HasSelectionHandlers<String>, 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.
|
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 |
---|---|
HandlerRegistration |
addSelectionHandler(SelectionHandler<String> handler) |
void |
disable(Cell.Context context,
Element parent) |
void |
enable(Cell.Context context,
Element parent) |
void |
fireEvent(GwtEvent<?> event) |
ColorPaletteCell.ColorPaletteAppearance |
getAppearance() |
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, setViewData
dependsOnSelection, getConsumedEvents, handlesSelection, resetFocus, setValue
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(SelectionHandler<String> handler)
addSelectionHandler
in interface HasSelectionHandlers<String>
public void disable(Cell.Context context, Element parent)
disable
in interface DisableCell
public void enable(Cell.Context context, Element parent)
enable
in interface DisableCell
public void fireEvent(GwtEvent<?> event)
fireEvent
in interface HasHandlers
public ColorPaletteCell.ColorPaletteAppearance getAppearance()
public 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 © 2015. All rights reserved.