setPrompt(CoreGUI.getMessages().widget_colorPicker_tooltip());
addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
ColorPicker picker = new ColorPicker();
picker.setAllowComplexMode(false);
if (currentColor != null) {
picker.setDefaultColor(currentColor);
}
picker.addColorSelectedHandler(new ColorSelectedHandler() {
@Override
public void onColorSelected(ColorSelectedEvent event) {
if (colorSelectedHandler != null) {
colorSelectedHandler.onColorSelected(event);
}
currentColor = event.getColor();
}
});
picker.show();
}
});
}