public class ColorPalette extends com.google.gwt.user.client.ui.Composite implements com.google.gwt.event.logical.shared.HasSelectionHandlers<String>, com.google.gwt.event.dom.client.ClickHandler
| Constructor and Description |
|---|
ColorPalette(String[] colors,
int columnCount)
Creates a new color palette using the specified color codes to fill the color grid.
|
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addSelectionHandler(com.google.gwt.event.logical.shared.SelectionHandler<String> handler) |
protected com.google.gwt.user.client.ui.Grid |
getColorGrid() |
String |
getSelectedColor() |
void |
onClick(com.google.gwt.event.dom.client.ClickEvent event) |
void |
setSelectedColor(String color)
Selects a color in the color grid by its color code.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidgetaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringpublic ColorPalette(String[] colors, int columnCount)
colors - the array of color codes that are used to fill the color grid.columnCount - the maximum number of columns the color grid can have.public com.google.gwt.event.shared.HandlerRegistration addSelectionHandler(com.google.gwt.event.logical.shared.SelectionHandler<String> handler)
addSelectionHandler in interface com.google.gwt.event.logical.shared.HasSelectionHandlers<String>protected com.google.gwt.user.client.ui.Grid getColorGrid()
public void onClick(com.google.gwt.event.dom.client.ClickEvent event)
onClick in interface com.google.gwt.event.dom.client.ClickHandlerpublic String getSelectedColor()
null if no cell has been selectedpublic void setSelectedColor(String color)
color - the code of the color to be selectedCopyright © 2004–2016 XWiki. All rights reserved.