/*
 * Smart GWT (GWT for SmartClient)
 * Copyright 2008 and beyond, Isomorphic Software, Inc.
 *
 * Smart GWT is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License version 3
 * as published by the Free Software Foundation.  Smart GWT is also
 * available under typical commercial license terms - see
 * http://smartclient.com/license
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 */
/* sgwtgen */
 
package com.smartgwt.client.widgets.form;


import com.smartgwt.client.event.*;
import com.smartgwt.client.core.*;
import com.smartgwt.client.types.*;
import com.smartgwt.client.data.*;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.data.events.*;
import com.smartgwt.client.browser.window.*;
import com.smartgwt.client.rpc.*;
import com.smartgwt.client.ai.*;
import com.smartgwt.client.callbacks.*;
import com.smartgwt.client.tools.*;
import com.smartgwt.client.bean.*;
import com.smartgwt.client.widgets.*;
import com.smartgwt.client.widgets.ai.*;
import com.smartgwt.client.widgets.events.*;
import com.smartgwt.client.widgets.form.*;
import com.smartgwt.client.widgets.form.validator.*;
import com.smartgwt.client.widgets.form.fields.*;
import com.smartgwt.client.widgets.tile.*;
import com.smartgwt.client.widgets.tile.events.*;
import com.smartgwt.client.widgets.grid.*;
import com.smartgwt.client.widgets.grid.events.*;
import com.smartgwt.client.widgets.chart.*;
import com.smartgwt.client.widgets.layout.*;
import com.smartgwt.client.widgets.layout.events.*;
import com.smartgwt.client.widgets.menu.*;
import com.smartgwt.client.widgets.tour.*;
import com.smartgwt.client.widgets.notify.*;
import com.smartgwt.client.widgets.rte.*;
import com.smartgwt.client.widgets.rte.events.*;
import com.smartgwt.client.widgets.ace.*;
import com.smartgwt.client.widgets.ace.events.*;
import com.smartgwt.client.widgets.tab.*;
import com.smartgwt.client.widgets.toolbar.*;
import com.smartgwt.client.widgets.tree.*;
import com.smartgwt.client.widgets.tree.events.*;
import com.smartgwt.client.widgets.tableview.*;
import com.smartgwt.client.widgets.viewer.*;
import com.smartgwt.client.widgets.calendar.*;
import com.smartgwt.client.widgets.calendar.events.*;
import com.smartgwt.client.widgets.cube.*;
import com.smartgwt.client.widgets.notify.*;
import com.smartgwt.client.widgets.drawing.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.google.gwt.event.shared.*;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.core.client.JavaScriptObject;

import com.smartgwt.client.util.*;
import com.smartgwt.client.util.events.*;
import com.smartgwt.client.util.workflow.*;
import com.smartgwt.client.util.workflow.Process; // required to override java.lang.Process
import com.smartgwt.client.util.tour.*;

import com.smartgwt.logicalstructure.core.*;
import com.smartgwt.logicalstructure.widgets.*;
import com.smartgwt.logicalstructure.widgets.drawing.*;
import com.smartgwt.logicalstructure.widgets.plugins.*;
import com.smartgwt.logicalstructure.widgets.form.*;
import com.smartgwt.logicalstructure.widgets.tile.*;
import com.smartgwt.logicalstructure.widgets.grid.*;
import com.smartgwt.logicalstructure.widgets.chart.*;
import com.smartgwt.logicalstructure.widgets.layout.*;
import com.smartgwt.logicalstructure.widgets.menu.*;
import com.smartgwt.logicalstructure.widgets.rte.*;
import com.smartgwt.logicalstructure.widgets.ace.*;
import com.smartgwt.logicalstructure.widgets.tab.*;
import com.smartgwt.logicalstructure.widgets.tableview.*;
import com.smartgwt.logicalstructure.widgets.toolbar.*;
import com.smartgwt.logicalstructure.widgets.tree.*;
import com.smartgwt.logicalstructure.widgets.viewer.*;
import com.smartgwt.logicalstructure.widgets.calendar.*;
import com.smartgwt.logicalstructure.widgets.cube.*;
import com.smartgwt.logicalstructure.widgets.tools.*;
import com.smartgwt.logicalstructure.widgets.tour.*;
import com.smartgwt.logicalstructure.widgets.ai.*;

/**
 * The ColorPicker widget allows the user to select a color from anywhere in the  color spectrum. It also supports
 * selecting the alpha (opacity) value of the  color.  The picker supports a simple mode - which allows for one-click
 * selection from a standard palette of colors - and a complex mode which allow the user to define any conceivable color.
 * It is possible for the user to switch from simple mode to complex by interacting with the widget.  In general, the
 * widget provides very similar functionality to the color picker dialogs found in graphics packages and other desktop
 * software.
 */
@BeanFactory.FrameworkClass
@BeanFactory.ScClassName("ColorPicker")
public class ColorPicker extends Window implements com.smartgwt.client.widgets.form.events.HasColorChangedHandlers, com.smartgwt.client.widgets.form.events.HasColorPickedHandlers, com.smartgwt.client.widgets.form.events.HasColorSelectedHandlers, com.smartgwt.client.widgets.form.events.HasColorUpdatedHandlers {

    public static ColorPicker getOrCreateRef(JavaScriptObject jsObj) {
        if (jsObj == null) return null;
        final BaseWidget refInstance = BaseWidget.getRef(jsObj);
        if (refInstance == null) {
            return new ColorPicker(jsObj);
        } else {
            assert refInstance instanceof ColorPicker;
            return (ColorPicker)refInstance;
        }
    }
        


    /**
     * Changes the defaults for Canvas AutoChildren named <code>autoChildName</code>.
     *
     * @param autoChildName name of an AutoChild to customize the defaults for.
     * @param defaults Canvas defaults to apply. These defaults override any existing properties
     * without destroying or wiping out non-overridden properties.  For usage tips on this
     * param, see {@link com.smartgwt.client.docs.SGWTProperties}.
     * @see com.smartgwt.client.docs.AutoChildUsage
     */
    public static native void changeAutoChildDefaults(String autoChildName, Canvas defaults) /*-{
        if (defaults.@com.smartgwt.client.widgets.BaseWidget::isCreated()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPreConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(ColorPicker.@java.lang.Object::getClass()(), "changeAutoChildDefaults", "Canvas");
        }
        defaults.@com.smartgwt.client.widgets.BaseWidget::setConfigOnly(Z)(true);
        var cleanDefaultsJS = @com.smartgwt.client.util.JSOHelper::cleanProperties(Lcom/google/gwt/core/client/JavaScriptObject;Z)(defaults.@com.smartgwt.client.widgets.BaseWidget::getConfig()(), true);
        $wnd.isc.ColorPicker.changeDefaults(autoChildName + "Defaults", cleanDefaultsJS);
    }-*/;

    /**
     * Changes the defaults for FormItem AutoChildren named <code>autoChildName</code>.
     *
     * @param autoChildName name of an AutoChild to customize the defaults for.
     * @param defaults FormItem defaults to apply. These defaults override any existing properties
     * without destroying or wiping out non-overridden properties.  For usage tips on this
     * param, see {@link com.smartgwt.client.docs.SGWTProperties}.
     * @see com.smartgwt.client.docs.AutoChildUsage
     */
    public static native void changeAutoChildDefaults(String autoChildName, FormItem defaults) /*-{
        if (defaults.@com.smartgwt.client.widgets.form.fields.FormItem::isCreated()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPreConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(ColorPicker.@java.lang.Object::getClass()(), "changeAutoChildDefaults", "FormItem");
        }
        defaults.@com.smartgwt.client.widgets.form.fields.FormItem::setConfigOnly(Z)(true);
    	var cleanDefaultsJS = defaults.@com.smartgwt.client.widgets.form.fields.FormItem::getEditorTypeConfig()();
        $wnd.isc.ColorPicker.changeDefaults(autoChildName + "Defaults", cleanDefaultsJS);
    }-*/;

    public ColorPicker(){
        scClassName = "ColorPicker";
    }

    public ColorPicker(JavaScriptObject jsObj){
        scClassName = "ColorPicker";
        setJavaScriptObject(jsObj);
    }

    protected native JavaScriptObject create()/*-{
        var config = this.@com.smartgwt.client.widgets.BaseWidget::getConfig()();
        var scClassName = this.@com.smartgwt.client.widgets.BaseWidget::scClassName;
        var widget = $wnd.isc[scClassName].create(config);
        if ($wnd.isc.keepGlobals) this.@com.smartgwt.client.widgets.BaseWidget::internalSetID(Lcom/google/gwt/core/client/JavaScriptObject;)(widget);
        this.@com.smartgwt.client.widgets.BaseWidget::doInit()();
        return widget;
    }-*/;


    // ********************* Properties / Attributes ***********************

    /**
     * Should the "complex" mode be allowed for this ColorPicker? If false, no "More" button is shown on the simple picker
     *
     * @param allowComplexMode New allowComplexMode value. Default value is true
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     */
    public ColorPicker setAllowComplexMode(Boolean allowComplexMode)  throws IllegalStateException {
        return (ColorPicker)setAttribute("allowComplexMode", allowComplexMode, false);
    }

    /**
     * Should the "complex" mode be allowed for this ColorPicker? If false, no "More" button is shown on the simple picker
     *
     * @return Current allowComplexMode value. Default value is true
     */
    public Boolean getAllowComplexMode()  {
        Boolean result = getAttributeAsBoolean("allowComplexMode");
        return result == null ? true : result;
    }
    

    /**
     * If {@link com.smartgwt.client.widgets.form.ColorPicker#getAutoPosition autoPosition} is false, this property controls
     * whether to automatically center the colorPicker every time it is redisplayed with the show() method.
     *
     * @param autoCenterOnShow New autoCenterOnShow value. Default value is true
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.widgets.form.ColorPicker#setAutoPosition
     */
    public ColorPicker setAutoCenterOnShow(Boolean autoCenterOnShow)  throws IllegalStateException {
        return (ColorPicker)setAttribute("autoCenterOnShow", autoCenterOnShow, false);
    }

    /**
     * If {@link com.smartgwt.client.widgets.form.ColorPicker#getAutoPosition autoPosition} is false, this property controls
     * whether to automatically center the colorPicker every time it is redisplayed with the show() method.
     *
     * @return Current autoCenterOnShow value. Default value is true
     * @see com.smartgwt.client.widgets.form.ColorPicker#getAutoPosition
     */
    public Boolean getAutoCenterOnShow()  {
        Boolean result = getAttributeAsBoolean("autoCenterOnShow");
        return result == null ? true : result;
    }
    

    /**
     * When this property is set to true, the <code>ColorPicker</code> will automatically hide when a color has been selected
     * using the swatch picker, even in "complex" mode. By default it will only hide the <code>ColorPicker</code> in "simple"
     * defaultPickMode. <p> Set this property to false to disable the <code>ColorPicker</code> from automatically hiding, this
     * can be especially useful when for instance embedding this component inside another component.
     *
     * @param autoHide New autoHide value. Default value is null
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.widgets.form.ColorPicker#setDefaultPickMode
     */
    public ColorPicker setAutoHide(Boolean autoHide)  throws IllegalStateException {
        return (ColorPicker)setAttribute("autoHide", autoHide, false);
    }

    /**
     * When this property is set to true, the <code>ColorPicker</code> will automatically hide when a color has been selected
     * using the swatch picker, even in "complex" mode. By default it will only hide the <code>ColorPicker</code> in "simple"
     * defaultPickMode. <p> Set this property to false to disable the <code>ColorPicker</code> from automatically hiding, this
     * can be especially useful when for instance embedding this component inside another component.
     *
     * @return Current autoHide value. Default value is null
     * @see com.smartgwt.client.widgets.form.ColorPicker#getDefaultPickMode
     */
    public Boolean getAutoHide()  {
        return getAttributeAsBoolean("autoHide");
    }
    

    /**
     * If true, causes the ColorPicker to appear near where the mouse was last clicked. If false, the ColorPicker is centered
     * on first show; depending on the value of  {@link com.smartgwt.client.widgets.form.ColorPicker#getAutoCenterOnShow
     * autoCenterOnShow}, it either reappears wherever it was last shown after hide/show(),  or centered regardless of where it
     * was last shown.
     *
     * @param autoPosition New autoPosition value. Default value is true
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.widgets.form.ColorPicker#setAutoCenterOnShow
     */
    public ColorPicker setAutoPosition(Boolean autoPosition)  throws IllegalStateException {
        return (ColorPicker)setAttribute("autoPosition", autoPosition, false);
    }

    /**
     * If true, causes the ColorPicker to appear near where the mouse was last clicked. If false, the ColorPicker is centered
     * on first show; depending on the value of  {@link com.smartgwt.client.widgets.form.ColorPicker#getAutoCenterOnShow
     * autoCenterOnShow}, it either reappears wherever it was last shown after hide/show(),  or centered regardless of where it
     * was last shown.
     *
     * @return Current autoPosition value. Default value is true
     * @see com.smartgwt.client.widgets.form.ColorPicker#getAutoCenterOnShow
     */
    public Boolean getAutoPosition()  {
        Boolean result = getAttributeAsBoolean("autoPosition");
        return result == null ? true : result;
    }
    

    /**
     * The label shown above the basic color blocks.
     *
     * @param basicColorLabel New basicColorLabel value. Default value is "Basic Colors:"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setBasicColorLabel(String basicColorLabel)  throws IllegalStateException {
        return (ColorPicker)setAttribute("basicColorLabel", basicColorLabel, false);
    }

    /**
     * The label shown above the basic color blocks.
     *
     * @return Current basicColorLabel value. Default value is "Basic Colors:"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getBasicColorLabel()  {
        return getAttributeAsString("basicColorLabel");
    }
    

    /**
     * The text to show when the mouse hovers over the 'Blue' field in the complex chooser.
     *
     * @param blueFieldPrompt New blueFieldPrompt value. Default value is "Blue (0-255)"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setBlueFieldPrompt(String blueFieldPrompt)  throws IllegalStateException {
        return (ColorPicker)setAttribute("blueFieldPrompt", blueFieldPrompt, false);
    }

    /**
     * The text to show when the mouse hovers over the 'Blue' field in the complex chooser.
     *
     * @return Current blueFieldPrompt value. Default value is "Blue (0-255)"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getBlueFieldPrompt()  {
        return getAttributeAsString("blueFieldPrompt");
    }
    

    /**
     * 
     *
     * @param blueFieldTitle New blueFieldTitle value. Default value is "Blue"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     * @deprecated No longer displayed. The RGB row now shows {@link com.smartgwt.client.widgets.form.ColorPicker#getRgbItemTitle
     * rgbItemTitle} as a combined     title for all three fields.
     */
    public ColorPicker setBlueFieldTitle(String blueFieldTitle)  throws IllegalStateException {
        return (ColorPicker)setAttribute("blueFieldTitle", blueFieldTitle, false);
    }

    /**
     * 
     *
     * @return Current blueFieldTitle value. Default value is "Blue"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     * @deprecated No longer displayed. The RGB row now shows {@link com.smartgwt.client.widgets.form.ColorPicker#getRgbItemTitle
     * rgbItemTitle} as a combined     title for all three fields.
     */
    public String getBlueFieldTitle()  {
        return getAttributeAsString("blueFieldTitle");
    }
    

    /**
     * Cancel button for the ColorPicker
     * <p>
     * This component is an AutoChild named "cancelButton".  For an overview of how to use and
     * configure AutoChildren, see {@link com.smartgwt.client.docs.AutoChildUsage Using AutoChildren}.
     *
     * @return Current cancelButton value. Default value is null
     * @throws IllegalStateException if this widget has not yet been rendered.
     */
    public IButton getCancelButton() throws IllegalStateException {
        errorIfNotCreated("cancelButton");
        return (IButton)IButton.getByJSObject(getAttributeAsJavaScriptObject("cancelButton"));
    }
    
    

    /**
     * The title for the 'Cancel' button.
     *
     * @param cancelButtonTitle New cancelButtonTitle value. Default value is "Cancel"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setCancelButtonTitle(String cancelButtonTitle)  throws IllegalStateException {
        return (ColorPicker)setAttribute("cancelButtonTitle", cancelButtonTitle, false);
    }

    /**
     * The title for the 'Cancel' button.
     *
     * @return Current cancelButtonTitle value. Default value is "Cancel"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getCancelButtonTitle()  {
        return getAttributeAsString("cancelButtonTitle");
    }
    

    /**
     * The current color of the picker.  Accepts a CSS color string in any {@link com.smartgwt.client.types.ColorFormat}
     * (including {@link com.smartgwt.client.util.Colors#colorNames named colors}) or an existing {@link
     * com.smartgwt.client.util.Color} object.  When not set, the picker initializes to {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getDefaultColor defaultColor}. <P> Use {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getColor getColor()} to retrieve the current color as a {@link
     * com.smartgwt.client.util.Color} object, or {@link com.smartgwt.client.widgets.form.ColorPicker#getColorString
     * getColorString()} to retrieve it as a CSS string in any {@link com.smartgwt.client.types.ColorFormat}.
     *
     * <br><br>If this method is called after the component has been drawn/initialized:
     * Sets the currently-selected color.  Accepts any value that {@link com.smartgwt.client.util.Colors#getColor Colors.getColor()} accepts: a CSS color string, a structured <code>{r,g,b}</code> / <code>{h,s,l}</code> / <code>{L,C,h}</code> object, or an existing {@link com.smartgwt.client.util.Color}.
     *
     * @param color new color value. Default value is null
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @see com.smartgwt.client.widgets.form.ColorPicker#getColor
     * @see com.smartgwt.client.widgets.form.ColorPicker#getColorString
     */
    public ColorPicker setColor(String color) {
        return (ColorPicker)setAttribute("color", color, true);
    }

    /**
     * The current color of the picker.  Accepts a CSS color string in any {@link com.smartgwt.client.types.ColorFormat}
     * (including {@link com.smartgwt.client.util.Colors#colorNames named colors}) or an existing {@link
     * com.smartgwt.client.util.Color} object.  When not set, the picker initializes to {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getDefaultColor defaultColor}. <P> Use {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getColor getColor()} to retrieve the current color as a {@link
     * com.smartgwt.client.util.Color} object, or {@link com.smartgwt.client.widgets.form.ColorPicker#getColorString
     * getColorString()} to retrieve it as a CSS string in any {@link com.smartgwt.client.types.ColorFormat}.
     *
     * @return Returns the currently-selected color as an {@link com.smartgwt.client.util.Color} object.  If {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getSupportsTransparency supportsTransparency} is true the returned Color
     * includes the selected alpha; otherwise alpha is 1. Default value is null
     * @see com.smartgwt.client.widgets.form.ColorPicker#getColor
     * @see com.smartgwt.client.widgets.form.ColorPicker#getColorString
     */
    public String getColor()  {
        return getAttributeAsString("color");
    }

    /**
     * The current color of the picker.  Accepts a CSS color string in any {@link com.smartgwt.client.types.ColorFormat}
     * (including {@link com.smartgwt.client.util.Colors#colorNames named colors}) or an existing {@link
     * com.smartgwt.client.util.Color} object.  When not set, the picker initializes to {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getDefaultColor defaultColor}. <P> Use {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getColor getColor()} to retrieve the current color as a {@link
     * com.smartgwt.client.util.Color} object, or {@link com.smartgwt.client.widgets.form.ColorPicker#getColorString
     * getColorString()} to retrieve it as a CSS string in any {@link com.smartgwt.client.types.ColorFormat}.
     *
     * <br><br>If this method is called after the component has been drawn/initialized:
     * Sets the currently-selected color.  Accepts any value that {@link com.smartgwt.client.util.Colors#getColor Colors.getColor()} accepts: a CSS color string, a structured <code>{r,g,b}</code> / <code>{h,s,l}</code> / <code>{L,C,h}</code> object, or an existing {@link com.smartgwt.client.util.Color}.
     *
     * @param color new color value. Default value is null
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @see com.smartgwt.client.widgets.form.ColorPicker#getColor
     * @see com.smartgwt.client.widgets.form.ColorPicker#getColorString
     */
    public ColorPicker setColor(Color color) {
        return (ColorPicker)setAttribute("color", color == null ? null : color.getJsObj(), true);
    }

    /**
     * The current color of the picker.  Accepts a CSS color string in any {@link com.smartgwt.client.types.ColorFormat}
     * (including {@link com.smartgwt.client.util.Colors#colorNames named colors}) or an existing {@link
     * com.smartgwt.client.util.Color} object.  When not set, the picker initializes to {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getDefaultColor defaultColor}. <P> Use {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getColor getColor()} to retrieve the current color as a {@link
     * com.smartgwt.client.util.Color} object, or {@link com.smartgwt.client.widgets.form.ColorPicker#getColorString
     * getColorString()} to retrieve it as a CSS string in any {@link com.smartgwt.client.types.ColorFormat}.
     *
     * @return Returns the currently-selected color as an {@link com.smartgwt.client.util.Color} object.  If {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getSupportsTransparency supportsTransparency} is true the returned Color
     * includes the selected alpha; otherwise alpha is 1. Default value is null
     * @see com.smartgwt.client.widgets.form.ColorPicker#getColor
     * @see com.smartgwt.client.widgets.form.ColorPicker#getColorString
     */
    public Color getColorAsColor()  {
        return new Color(getAttributeAsJavaScriptObject("color"));
    }
    

    /**
     * Array of 40 HTML color strings, used to render the basic color selection boxes.
     *
     * @param colorArray New colorArray value. Default value is [...]
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     */
    public ColorPicker setColorArray(String[] colorArray)  throws IllegalStateException {
        return (ColorPicker)setAttribute("colorArray", colorArray, false);
    }

    /**
     * Array of 40 HTML color strings, used to render the basic color selection boxes.
     *
     * @return Current colorArray value. Default value is [...]
     */
    public String[] getColorArray()  {
        return com.smartgwt.client.util.ConvertTo.arrayOfString(getAttributeAsJavaScriptObject("colorArray"));
    }
    

    /**
     * Base CSS style applied to the basic color boxes
     *
     * @param colorButtonBaseStyle New colorButtonBaseStyle value. Default value is "ColorChooserCell"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.CSSStyleName CSSStyleName 
     */
    public ColorPicker setColorButtonBaseStyle(String colorButtonBaseStyle)  throws IllegalStateException {
        return (ColorPicker)setAttribute("colorButtonBaseStyle", colorButtonBaseStyle, false);
    }

    /**
     * Base CSS style applied to the basic color boxes
     *
     * @return Current colorButtonBaseStyle value. Default value is "ColorChooserCell"
     * @see com.smartgwt.client.docs.CSSStyleName CSSStyleName 
     */
    public String getColorButtonBaseStyle()  {
        return getAttributeAsString("colorButtonBaseStyle");
    }
    

    /**
     * Width and height of the basic color boxes (they are always square, and they are all the same size).
     *
     * @param colorButtonSize New colorButtonSize value. Default value is 20
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     */
    public ColorPicker setColorButtonSize(int colorButtonSize)  throws IllegalStateException {
        return (ColorPicker)setAttribute("colorButtonSize", colorButtonSize, false);
    }

    /**
     * Width and height of the basic color boxes (they are always square, and they are all the same size).
     *
     * @return Current colorButtonSize value. Default value is 20
     */
    public int getColorButtonSize()  {
        return getAttributeAsInt("colorButtonSize");
    }
    

    /**
     * The location of the crosshair image file
     *
     * @param crosshairImageURL New crosshairImageURL value. Default value is "[SKIN]ColorPicker/crosshair.png"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.SCImgURL SCImgURL 
     */
    public ColorPicker setCrosshairImageURL(String crosshairImageURL)  throws IllegalStateException {
        return (ColorPicker)setAttribute("crosshairImageURL", crosshairImageURL, false);
    }

    /**
     * The location of the crosshair image file
     *
     * @return Current crosshairImageURL value. Default value is "[SKIN]ColorPicker/crosshair.png"
     * @see com.smartgwt.client.docs.SCImgURL SCImgURL 
     */
    public String getCrosshairImageURL()  {
        return getAttributeAsString("crosshairImageURL");
    }
    

    /**
     * The default color.  This is the color selected when the picker first loads if no {@link com.smartgwt.client.util.Color}
     * is specified, and the color to which the picker reverts when {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getSharedColorPicker getSharedColorPicker()} is called without
     * <code>keepCurrentState</code>.
     *
     * @param defaultColor New defaultColor value. Default value is #808080
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.util.Color
     */
    public ColorPicker setDefaultColor(String defaultColor)  throws IllegalStateException {
        return (ColorPicker)setAttribute("defaultColor", defaultColor, false);
    }

    /**
     * The default color.  This is the color selected when the picker first loads if no {@link com.smartgwt.client.util.Color}
     * is specified, and the color to which the picker reverts when {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getSharedColorPicker getSharedColorPicker()} is called without
     * <code>keepCurrentState</code>.
     *
     * @return Current defaultColor value. Default value is #808080
     * @see com.smartgwt.client.util.Color
     */
    public String getDefaultColor()  {
        return getAttributeAsString("defaultColor");
    }
    

    /**
     * The initial opacity value for the component, as a percentage value between 0 and 100
     *
     * @param defaultOpacity New defaultOpacity value. Default value is 100
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     */
    public ColorPicker setDefaultOpacity(int defaultOpacity)  throws IllegalStateException {
        return (ColorPicker)setAttribute("defaultOpacity", defaultOpacity, false);
    }

    /**
     * The initial opacity value for the component, as a percentage value between 0 and 100
     *
     * @return Current defaultOpacity value. Default value is 100
     */
    public int getDefaultOpacity()  {
        return getAttributeAsInt("defaultOpacity");
    }
    

    /**
     * The <code>ColorPicker</code> can operate in either a "simple" mode (where it displays just the 40 basic colors and
     * allows the user to click one), or a "complex" mode (where the user can specify a color from anywhere in the spectrum,
     * with an optional alpha element). The <code>defaultPickMode</code> attribute specifies which of these two modes is in
     * force when the picker first loads.
     *
     * <br><br>If this method is called after the component has been drawn/initialized:
     * Changes the pick mode of this <code>ColorPicker</code> to <code>pickMode</code>. <p> Note: It is not allowed to set the pick mode to  {@link com.smartgwt.client.types.ColorPickerMode#COMPLEX} if {@link com.smartgwt.client.widgets.form.ColorPicker#getAllowComplexMode allowComplexMode} is <code>false</code>.
     *
     * @param defaultPickMode the new pick mode. Default value is "simple"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.widgets.form.ColorPicker#setAllowComplexMode
     */
    public ColorPicker setDefaultPickMode(ColorPickerMode defaultPickMode)  throws IllegalStateException {
        return (ColorPicker)setAttribute("defaultPickMode", defaultPickMode == null ? null : defaultPickMode.getValue(), false);
    }

    /**
     * The <code>ColorPicker</code> can operate in either a "simple" mode (where it displays just the 40 basic colors and
     * allows the user to click one), or a "complex" mode (where the user can specify a color from anywhere in the spectrum,
     * with an optional alpha element). The <code>defaultPickMode</code> attribute specifies which of these two modes is in
     * force when the picker first loads.
     *
     * @return Current defaultPickMode value. Default value is "simple"
     * @see com.smartgwt.client.widgets.form.ColorPicker#getAllowComplexMode
     */
    public ColorPickerMode getDefaultPickMode()  {
        return EnumUtil.getEnum(ColorPickerMode.values(), getAttribute("defaultPickMode"));
    }
    

    /**
     * The text to show when the mouse hovers over the 'Green' field in the complex chooser.
     *
     * @param greenFieldPrompt New greenFieldPrompt value. Default value is "Green (0-255)"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setGreenFieldPrompt(String greenFieldPrompt)  throws IllegalStateException {
        return (ColorPicker)setAttribute("greenFieldPrompt", greenFieldPrompt, false);
    }

    /**
     * The text to show when the mouse hovers over the 'Green' field in the complex chooser.
     *
     * @return Current greenFieldPrompt value. Default value is "Green (0-255)"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getGreenFieldPrompt()  {
        return getAttributeAsString("greenFieldPrompt");
    }
    

    /**
     * 
     *
     * @param greenFieldTitle New greenFieldTitle value. Default value is "Green"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     * @deprecated No longer displayed. The RGB row now shows {@link com.smartgwt.client.widgets.form.ColorPicker#getRgbItemTitle
     * rgbItemTitle} as a combined     title for all three fields.
     */
    public ColorPicker setGreenFieldTitle(String greenFieldTitle)  throws IllegalStateException {
        return (ColorPicker)setAttribute("greenFieldTitle", greenFieldTitle, false);
    }

    /**
     * 
     *
     * @return Current greenFieldTitle value. Default value is "Green"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     * @deprecated No longer displayed. The RGB row now shows {@link com.smartgwt.client.widgets.form.ColorPicker#getRgbItemTitle
     * rgbItemTitle} as a combined     title for all three fields.
     */
    public String getGreenFieldTitle()  {
        return getAttributeAsString("greenFieldTitle");
    }
    

    /**
     * Row of clickable swatches showing oklch-computed color harmonies (analogous, triadic, complement) of the
     * currently-selected color.  Visible only in {@link com.smartgwt.client.types.ColorPickerMode complex mode}.
     * <p>
     * This component is an AutoChild named "harmonyRow".  For an overview of how to use and
     * configure AutoChildren, see {@link com.smartgwt.client.docs.AutoChildUsage Using AutoChildren}.
     *
     * @return Current harmonyRow value. Default value is null
     * @throws IllegalStateException if this widget has not yet been rendered.
     */
    public HLayout getHarmonyRow() throws IllegalStateException {
        errorIfNotCreated("harmonyRow");
        return (HLayout)HLayout.getByJSObject(getAttributeAsJavaScriptObject("harmonyRow"));
    }
    

    /**
     * Hover text shown when the mouse is over the HSL form row title.
     *
     * @param hslItemHover New hslItemHover value. Default value is "Hue, Saturation, Lightness"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setHslItemHover(String hslItemHover)  throws IllegalStateException {
        return (ColorPicker)setAttribute("hslItemHover", hslItemHover, false);
    }

    /**
     * Hover text shown when the mouse is over the HSL form row title.
     *
     * @return Current hslItemHover value. Default value is "Hue, Saturation, Lightness"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getHslItemHover()  {
        return getAttributeAsString("hslItemHover");
    }
    

    /**
     * Title shown on the HSL form row in the complex chooser.
     *
     * @param hslItemTitle New hslItemTitle value. Default value is "HSL"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setHslItemTitle(String hslItemTitle)  throws IllegalStateException {
        return (ColorPicker)setAttribute("hslItemTitle", hslItemTitle, false);
    }

    /**
     * Title shown on the HSL form row in the complex chooser.
     *
     * @return Current hslItemTitle value. Default value is "HSL"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getHslItemTitle()  {
        return getAttributeAsString("hslItemTitle");
    }
    

    /**
     * The text to show when the mouse hovers over the hex field in the complex chooser.
     *
     * @param htmlFieldPrompt New htmlFieldPrompt value. Default value is "Hex color code (#RRGGBB or #RRGGBBAA)"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setHtmlFieldPrompt(String htmlFieldPrompt)  throws IllegalStateException {
        return (ColorPicker)setAttribute("htmlFieldPrompt", htmlFieldPrompt, false);
    }

    /**
     * The text to show when the mouse hovers over the hex field in the complex chooser.
     *
     * @return Current htmlFieldPrompt value. Default value is "Hex color code (#RRGGBB or #RRGGBBAA)"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getHtmlFieldPrompt()  {
        return getAttributeAsString("htmlFieldPrompt");
    }
    

    /**
     * The title for the hex color field in the complex chooser.
     *
     * @param htmlFieldTitle New htmlFieldTitle value. Default value is "Hex"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setHtmlFieldTitle(String htmlFieldTitle)  throws IllegalStateException {
        return (ColorPicker)setAttribute("htmlFieldTitle", htmlFieldTitle, false);
    }

    /**
     * The title for the hex color field in the complex chooser.
     *
     * @return Current htmlFieldTitle value. Default value is "Hex"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getHtmlFieldTitle()  {
        return getAttributeAsString("htmlFieldTitle");
    }
    

    /**
     * The text to show when the mouse hovers over the 'Hue' field in the complex chooser.
     *
     * @param hueFieldPrompt New hueFieldPrompt value. Default value is "Hue - base tone (0-360)"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setHueFieldPrompt(String hueFieldPrompt)  throws IllegalStateException {
        return (ColorPicker)setAttribute("hueFieldPrompt", hueFieldPrompt, false);
    }

    /**
     * The text to show when the mouse hovers over the 'Hue' field in the complex chooser.
     *
     * @return Current hueFieldPrompt value. Default value is "Hue - base tone (0-360)"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getHueFieldPrompt()  {
        return getAttributeAsString("hueFieldPrompt");
    }
    

    /**
     * 
     *
     * @param hueFieldTitle New hueFieldTitle value. Default value is "Hue"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     * @deprecated No longer displayed. The HSL row now shows {@link com.smartgwt.client.widgets.form.ColorPicker#getHslItemTitle
     * hslItemTitle} as a combined     title for all three fields.
     */
    public ColorPicker setHueFieldTitle(String hueFieldTitle)  throws IllegalStateException {
        return (ColorPicker)setAttribute("hueFieldTitle", hueFieldTitle, false);
    }

    /**
     * 
     *
     * @return Current hueFieldTitle value. Default value is "Hue"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     * @deprecated No longer displayed. The HSL row now shows {@link com.smartgwt.client.widgets.form.ColorPicker#getHslItemTitle
     * hslItemTitle} as a combined     title for all three fields.
     */
    public String getHueFieldTitle()  {
        return getAttributeAsString("hueFieldTitle");
    }
    

    /**
     * The title for the button that switches to a less complex view.
     *
     * @param lessButtonTitle New lessButtonTitle value. Default value is "&lt;&lt; Less"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setLessButtonTitle(String lessButtonTitle)  throws IllegalStateException {
        return (ColorPicker)setAttribute("lessButtonTitle", lessButtonTitle, false);
    }

    /**
     * The title for the button that switches to a less complex view.
     *
     * @return Current lessButtonTitle value. Default value is "&lt;&lt; Less"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getLessButtonTitle()  {
        return getAttributeAsString("lessButtonTitle");
    }
    

    /**
     * The text to show when the mouse hovers over the 'Lightness' field in the complex chooser.
     *
     * @param lumFieldPrompt New lumFieldPrompt value. Default value is "Lightness - 0 black, 50 full color, 100 white (0-100%)"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setLumFieldPrompt(String lumFieldPrompt)  throws IllegalStateException {
        return (ColorPicker)setAttribute("lumFieldPrompt", lumFieldPrompt, false);
    }

    /**
     * The text to show when the mouse hovers over the 'Lightness' field in the complex chooser.
     *
     * @return Current lumFieldPrompt value. Default value is "Lightness - 0 black, 50 full color, 100 white (0-100%)"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getLumFieldPrompt()  {
        return getAttributeAsString("lumFieldPrompt");
    }
    

    /**
     * 
     *
     * @param lumFieldTitle New lumFieldTitle value. Default value is "Light"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     * @deprecated No longer displayed. The HSL row now shows {@link com.smartgwt.client.widgets.form.ColorPicker#getHslItemTitle
     * hslItemTitle} as a combined     title for all three fields.
     */
    public ColorPicker setLumFieldTitle(String lumFieldTitle)  throws IllegalStateException {
        return (ColorPicker)setAttribute("lumFieldTitle", lumFieldTitle, false);
    }

    /**
     * 
     *
     * @return Current lumFieldTitle value. Default value is "Light"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     * @deprecated No longer displayed. The HSL row now shows {@link com.smartgwt.client.widgets.form.ColorPicker#getHslItemTitle
     * hslItemTitle} as a combined     title for all three fields.
     */
    public String getLumFieldTitle()  {
        return getAttributeAsString("lumFieldTitle");
    }
    

    /**
     * Width of the lightness bar
     *
     * @param lumWidth New lumWidth value. Default value is 15
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     */
    public ColorPicker setLumWidth(int lumWidth)  throws IllegalStateException {
        return (ColorPicker)setAttribute("lumWidth", lumWidth, false);
    }

    /**
     * Width of the lightness bar
     *
     * @return Current lumWidth value. Default value is 15
     */
    public int getLumWidth()  {
        return getAttributeAsInt("lumWidth");
    }
    

    /**
     * "More"/"Less" button for the ColorPicker
     * <p>
     * This component is an AutoChild named "modeToggleButton".  For an overview of how to use and
     * configure AutoChildren, see {@link com.smartgwt.client.docs.AutoChildUsage Using AutoChildren}.
     *
     * @return Current modeToggleButton value. Default value is null
     * @throws IllegalStateException if this widget has not yet been rendered.
     */
    public IButton getModeToggleButton() throws IllegalStateException {
        errorIfNotCreated("modeToggleButton");
        return (IButton)IButton.getByJSObject(getAttributeAsJavaScriptObject("modeToggleButton"));
    }
    
    

    /**
     * The title for the button that switches to a more complex view.
     *
     * @param moreButtonTitle New moreButtonTitle value. Default value is "More &gt;&gt;"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setMoreButtonTitle(String moreButtonTitle)  throws IllegalStateException {
        return (ColorPicker)setAttribute("moreButtonTitle", moreButtonTitle, false);
    }

    /**
     * The title for the button that switches to a more complex view.
     *
     * @return Current moreButtonTitle value. Default value is "More &gt;&gt;"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getMoreButtonTitle()  {
        return getAttributeAsString("moreButtonTitle");
    }
    

    /**
     * "OK" button for the ColorPicker
     * <p>
     * This component is an AutoChild named "okButton".  For an overview of how to use and
     * configure AutoChildren, see {@link com.smartgwt.client.docs.AutoChildUsage Using AutoChildren}.
     *
     * @return Current okButton value. Default value is null
     * @throws IllegalStateException if this widget has not yet been rendered.
     */
    public IButton getOkButton() throws IllegalStateException {
        errorIfNotCreated("okButton");
        return (IButton)IButton.getByJSObject(getAttributeAsJavaScriptObject("okButton"));
    }
    
    

    /**
     * The title for the 'OK' button.
     *
     * @param okButtonTitle New okButtonTitle value. Default value is "OK"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setOkButtonTitle(String okButtonTitle)  throws IllegalStateException {
        return (ColorPicker)setAttribute("okButtonTitle", okButtonTitle, false);
    }

    /**
     * The title for the 'OK' button.
     *
     * @return Current okButtonTitle value. Default value is "OK"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getOkButtonTitle()  {
        return getAttributeAsString("okButtonTitle");
    }
    

    /**
     * The label shown next to the opacity slider. Ignored if  {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getSupportsTransparency supportsTransparency} is false.
     *
     * @param opacitySliderLabel New opacitySliderLabel value. Default value is "Opacity:"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setOpacitySliderLabel(String opacitySliderLabel)  throws IllegalStateException {
        return (ColorPicker)setAttribute("opacitySliderLabel", opacitySliderLabel, false);
    }

    /**
     * The label shown next to the opacity slider. Ignored if  {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getSupportsTransparency supportsTransparency} is false.
     *
     * @return Current opacitySliderLabel value. Default value is "Opacity:"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getOpacitySliderLabel()  {
        return getAttributeAsString("opacitySliderLabel");
    }
    

    /**
     * The text to show underneath the selected color box, so that it can  be seen through semi-transparent colors. If you do
     * not want such text, set  this value to blank. This value is irrelevant if  {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getSupportsTransparency supportsTransparency} is false.
     *
     * @param opacityText New opacityText value. Default value is "Lorem ipsum"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setOpacityText(String opacityText)  throws IllegalStateException {
        return (ColorPicker)setAttribute("opacityText", opacityText, false);
    }

    /**
     * The text to show underneath the selected color box, so that it can  be seen through semi-transparent colors. If you do
     * not want such text, set  this value to blank. This value is irrelevant if  {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getSupportsTransparency supportsTransparency} is false.
     *
     * @return Current opacityText value. Default value is "Lorem ipsum"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getOpacityText()  {
        return getAttributeAsString("opacityText");
    }
    

    /**
     * Controls which palette visualization is shown in complex mode. <ul> <li><code>"square"</code> - Hue x Saturation grid
     * (X=hue 0-360,     Y=saturation 100-0), fixed at L=50. Best for precise color     selection.</li>
     * <li><code>"wheel"</code> - Oklch color wheel (angle=hue,     radius=chroma). Perceptually uniform hue spacing; lightness
     *     tracks the current lightness slider value.</li> </ul>
     *
     * @param paletteMode New paletteMode value. Default value is "square"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     */
    public ColorPicker setPaletteMode(String paletteMode) {
        return (ColorPicker)setAttribute("paletteMode", paletteMode, true);
    }

    /**
     * Controls which palette visualization is shown in complex mode. <ul> <li><code>"square"</code> - Hue x Saturation grid
     * (X=hue 0-360,     Y=saturation 100-0), fixed at L=50. Best for precise color     selection.</li>
     * <li><code>"wheel"</code> - Oklch color wheel (angle=hue,     radius=chroma). Perceptually uniform hue spacing; lightness
     *     tracks the current lightness slider value.</li> </ul>
     *
     * @return Current paletteMode value. Default value is "square"
     */
    public String getPaletteMode()  {
        return getAttributeAsString("paletteMode");
    }
    

    /**
     * The text to show when the mouse hovers over the 'Red' field in the complex chooser.
     *
     * @param redFieldPrompt New redFieldPrompt value. Default value is "Red (0-255)"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setRedFieldPrompt(String redFieldPrompt)  throws IllegalStateException {
        return (ColorPicker)setAttribute("redFieldPrompt", redFieldPrompt, false);
    }

    /**
     * The text to show when the mouse hovers over the 'Red' field in the complex chooser.
     *
     * @return Current redFieldPrompt value. Default value is "Red (0-255)"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getRedFieldPrompt()  {
        return getAttributeAsString("redFieldPrompt");
    }
    

    /**
     * 
     *
     * @param redFieldTitle New redFieldTitle value. Default value is "Red"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     * @deprecated No longer displayed. The RGB row now shows {@link com.smartgwt.client.widgets.form.ColorPicker#getRgbItemTitle
     * rgbItemTitle} as a combined     title for all three fields.
     */
    public ColorPicker setRedFieldTitle(String redFieldTitle)  throws IllegalStateException {
        return (ColorPicker)setAttribute("redFieldTitle", redFieldTitle, false);
    }

    /**
     * 
     *
     * @return Current redFieldTitle value. Default value is "Red"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     * @deprecated No longer displayed. The RGB row now shows {@link com.smartgwt.client.widgets.form.ColorPicker#getRgbItemTitle
     * rgbItemTitle} as a combined     title for all three fields.
     */
    public String getRedFieldTitle()  {
        return getAttributeAsString("redFieldTitle");
    }
    

    /**
     * Hover text shown when the mouse is over the RGB form row title.
     *
     * @param rgbItemHover New rgbItemHover value. Default value is "Red, Green, Blue (0-255 each)"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setRgbItemHover(String rgbItemHover)  throws IllegalStateException {
        return (ColorPicker)setAttribute("rgbItemHover", rgbItemHover, false);
    }

    /**
     * Hover text shown when the mouse is over the RGB form row title.
     *
     * @return Current rgbItemHover value. Default value is "Red, Green, Blue (0-255 each)"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getRgbItemHover()  {
        return getAttributeAsString("rgbItemHover");
    }
    

    /**
     * Title shown on the RGB form row in the complex chooser.
     *
     * @param rgbItemTitle New rgbItemTitle value. Default value is "RGB"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setRgbItemTitle(String rgbItemTitle)  throws IllegalStateException {
        return (ColorPicker)setAttribute("rgbItemTitle", rgbItemTitle, false);
    }

    /**
     * Title shown on the RGB form row in the complex chooser.
     *
     * @return Current rgbItemTitle value. Default value is "RGB"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getRgbItemTitle()  {
        return getAttributeAsString("rgbItemTitle");
    }
    

    /**
     * The text to show when the mouse hovers over the 'Saturation' field in the complex chooser.
     *
     * @param satFieldPrompt New satFieldPrompt value. Default value is "Saturation - color purity (0-100%)"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setSatFieldPrompt(String satFieldPrompt)  throws IllegalStateException {
        return (ColorPicker)setAttribute("satFieldPrompt", satFieldPrompt, false);
    }

    /**
     * The text to show when the mouse hovers over the 'Saturation' field in the complex chooser.
     *
     * @return Current satFieldPrompt value. Default value is "Saturation - color purity (0-100%)"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getSatFieldPrompt()  {
        return getAttributeAsString("satFieldPrompt");
    }
    

    /**
     * 
     *
     * @param satFieldTitle New satFieldTitle value. Default value is "Sat"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     * @deprecated No longer displayed. The HSL row now shows {@link com.smartgwt.client.widgets.form.ColorPicker#getHslItemTitle
     * hslItemTitle} as a combined     title for all three fields.
     */
    public ColorPicker setSatFieldTitle(String satFieldTitle)  throws IllegalStateException {
        return (ColorPicker)setAttribute("satFieldTitle", satFieldTitle, false);
    }

    /**
     * 
     *
     * @return Current satFieldTitle value. Default value is "Sat"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     * @deprecated No longer displayed. The HSL row now shows {@link com.smartgwt.client.widgets.form.ColorPicker#getHslItemTitle
     * hslItemTitle} as a combined     title for all three fields.
     */
    public String getSatFieldTitle()  {
        return getAttributeAsString("satFieldTitle");
    }
    

    /**
     * The label shown next to the selected color box.
     *
     * @param selectedColorLabel New selectedColorLabel value. Default value is "Selected Color:"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public ColorPicker setSelectedColorLabel(String selectedColorLabel)  throws IllegalStateException {
        return (ColorPicker)setAttribute("selectedColorLabel", selectedColorLabel, false);
    }

    /**
     * The label shown next to the selected color box.
     *
     * @return Current selectedColorLabel value. Default value is "Selected Color:"
     * @see com.smartgwt.client.docs.HTMLString HTMLString 
     */
    public String getSelectedColorLabel()  {
        return getAttributeAsString("selectedColorLabel");
    }
    

    /**
     * Should the Cancel button be visible. Set to false to hide the Cancel button.
     * <p><b>Note : </b> This is an advanced setting</p>
     *
     * @param showCancelButton New showCancelButton value. Default value is true
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     */
    public ColorPicker setShowCancelButton(Boolean showCancelButton)  throws IllegalStateException {
        return (ColorPicker)setAttribute("showCancelButton", showCancelButton, false);
    }

    /**
     * Should the Cancel button be visible. Set to false to hide the Cancel button.
     *
     * @return Current showCancelButton value. Default value is true
     */
    public Boolean getShowCancelButton()  {
        Boolean result = getAttributeAsBoolean("showCancelButton");
        return result == null ? true : result;
    }
    

    /**
     * Whether to show the {@link com.smartgwt.client.widgets.form.ColorPicker#getHarmonyRow harmonyRow} of color harmonies
     * below the palette in complex mode.
     *
     * @param showHarmonyRow New showHarmonyRow value. Default value is true
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     */
    public ColorPicker setShowHarmonyRow(Boolean showHarmonyRow)  throws IllegalStateException {
        return (ColorPicker)setAttribute("showHarmonyRow", showHarmonyRow, false);
    }

    /**
     * Whether to show the {@link com.smartgwt.client.widgets.form.ColorPicker#getHarmonyRow harmonyRow} of color harmonies
     * below the palette in complex mode.
     *
     * @return Current showHarmonyRow value. Default value is true
     */
    public Boolean getShowHarmonyRow()  {
        Boolean result = getAttributeAsBoolean("showHarmonyRow");
        return result == null ? true : result;
    }
    

    /**
     * Should the Mode Toggle button be visible. Set to false to hide the Mode Toggle button.
     * <p><b>Note : </b> This is an advanced setting</p>
     *
     * @param showModeToggleButton New showModeToggleButton value. Default value is true
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     */
    public ColorPicker setShowModeToggleButton(Boolean showModeToggleButton)  throws IllegalStateException {
        return (ColorPicker)setAttribute("showModeToggleButton", showModeToggleButton, false);
    }

    /**
     * Should the Mode Toggle button be visible. Set to false to hide the Mode Toggle button.
     *
     * @return Current showModeToggleButton value. Default value is true
     */
    public Boolean getShowModeToggleButton()  {
        Boolean result = getAttributeAsBoolean("showModeToggleButton");
        return result == null ? true : result;
    }
    

    /**
     * Should the OK button be visible. Set to false to hide the OK button.
     * <p><b>Note : </b> This is an advanced setting</p>
     *
     * @param showOkButton New showOkButton value. Default value is true
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     */
    public ColorPicker setShowOkButton(Boolean showOkButton)  throws IllegalStateException {
        return (ColorPicker)setAttribute("showOkButton", showOkButton, false);
    }

    /**
     * Should the OK button be visible. Set to false to hide the OK button.
     *
     * @return Current showOkButton value. Default value is true
     */
    public Boolean getShowOkButton()  {
        Boolean result = getAttributeAsBoolean("showOkButton");
        return result == null ? true : result;
    }
    

    /**
     * Determines whether to show the opacity slider. This allows the user to select colors with an alpha element (ie,
     * semi-transparent colors). If this attribute is set to false, no opacity slider is shown, and all colors are completely
     * opaque.
     *
     * <br><br>If this method is called after the component has been drawn/initialized:
     * Set the {@link com.smartgwt.client.widgets.form.ColorPicker#getSupportsTransparency supportsTransparency} flag.
     *
     * @param supportsTransparency Set to true to enable transparency/opacity. Default value is true
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     */
    public ColorPicker setSupportsTransparency(Boolean supportsTransparency)  throws IllegalStateException {
        return (ColorPicker)setAttribute("supportsTransparency", supportsTransparency, false);
    }

    /**
     * Determines whether to show the opacity slider. This allows the user to select colors with an alpha element (ie,
     * semi-transparent colors). If this attribute is set to false, no opacity slider is shown, and all colors are completely
     * opaque.
     *
     * @return Current supportsTransparency value. Default value is true
     */
    public Boolean getSupportsTransparency()  {
        Boolean result = getAttributeAsBoolean("supportsTransparency");
        return result == null ? true : result;
    }
    

    /**
     * Displayed height of the color swatch image. The default height is approximately that used by the Windows&#174; XP color
     * picking window
     *
     * @param swatchHeight New swatchHeight value. Default value is 170
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     */
    public ColorPicker setSwatchHeight(int swatchHeight)  throws IllegalStateException {
        return (ColorPicker)setAttribute("swatchHeight", swatchHeight, false);
    }

    /**
     * Displayed height of the color swatch image. The default height is approximately that used by the Windows&#174; XP color
     * picking window
     *
     * @return Current swatchHeight value. Default value is 170
     */
    public int getSwatchHeight()  {
        return getAttributeAsInt("swatchHeight");
    }
    

    /**
     * The location of the color swatch image file
     *
     * @param swatchImageURL New swatchImageURL value. Default value is "[SKIN]ColorPicker/spectrum.png"
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     * @see com.smartgwt.client.docs.SCImgURL SCImgURL 
     */
    public ColorPicker setSwatchImageURL(String swatchImageURL)  throws IllegalStateException {
        return (ColorPicker)setAttribute("swatchImageURL", swatchImageURL, false);
    }

    /**
     * The location of the color swatch image file
     *
     * @return Current swatchImageURL value. Default value is "[SKIN]ColorPicker/spectrum.png"
     * @see com.smartgwt.client.docs.SCImgURL SCImgURL 
     */
    public String getSwatchImageURL()  {
        return getAttributeAsString("swatchImageURL");
    }
    

    /**
     * Displayed width of the color swatch image. The default width is approximately that used by the Windows&#174; XP color
     * picking window
     *
     * @param swatchWidth New swatchWidth value. Default value is 170
     * @return {@link com.smartgwt.client.widgets.form.ColorPicker ColorPicker} instance, for chaining setter calls
     * @throws IllegalStateException this property cannot be changed after the component has been created
     */
    public ColorPicker setSwatchWidth(int swatchWidth)  throws IllegalStateException {
        return (ColorPicker)setAttribute("swatchWidth", swatchWidth, false);
    }

    /**
     * Displayed width of the color swatch image. The default width is approximately that used by the Windows&#174; XP color
     * picking window
     *
     * @return Current swatchWidth value. Default value is 170
     */
    public int getSwatchWidth()  {
        return getAttributeAsInt("swatchWidth");
    }
    

    // ********************* Methods ***********************
    /**
     * Add a colorChanged handler.
     * <p>
     * Override this method to be kept informed when the ColorPicker changes in real-time (for example, if you need to update
     * your own GUI accordingly). Then use the getXxxx() methods (for example, {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getBlue getBlue()} or {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getLuminosity getLuminosity()}) to obtain current state as required.
     *
     * @param handler the colorChanged handler
     * @return {@link HandlerRegistration} used to remove this handler
     */
    public HandlerRegistration addColorChangedHandler(com.smartgwt.client.widgets.form.events.ColorChangedHandler handler) {
        if(getHandlerCount(com.smartgwt.client.widgets.form.events.ColorChangedEvent.getType()) == 0) setupColorChangedEvent();
        return doAddHandler(handler, com.smartgwt.client.widgets.form.events.ColorChangedEvent.getType());
    }

    private native void setupColorChangedEvent() /*-{
        var obj;
        var selfJ = this;
        var hasDefaultHandler;
        var colorChanged = $entry(function(){
            var param = {"_this": this};
            var event = @com.smartgwt.client.widgets.form.events.ColorChangedEvent::new(Lcom/google/gwt/core/client/JavaScriptObject;)(param);
            selfJ.@com.smartgwt.client.widgets.BaseWidget::fireEvent(Lcom/google/gwt/event/shared/GwtEvent;)(event);
            selfJ.@com.smartgwt.client.widgets.form.ColorPicker::handleTearDownColorChangedEvent()();
            if (hasDefaultHandler) this.Super("colorChanged", arguments);
        });
        if(this.@com.smartgwt.client.widgets.BaseWidget::isCreated()()) {
            obj = this.@com.smartgwt.client.widgets.BaseWidget::getJsObj()();
            hasDefaultHandler = $wnd.isc.isA.Function(obj.getProperty("colorChanged"));
            obj.addProperties({colorChanged:  colorChanged              });
        } else {
            obj = this.@com.smartgwt.client.widgets.BaseWidget::getConfig()();
            var scClassName = this.@com.smartgwt.client.widgets.BaseWidget::scClassName;
            hasDefaultHandler = $wnd.isc.isA.Function($wnd.isc[scClassName].getInstanceProperty("colorChanged"));
            obj.colorChanged =  colorChanged             ;
        }
    }-*/;

    private void handleTearDownColorChangedEvent() {
        if (getHandlerCount(com.smartgwt.client.widgets.form.events.ColorChangedEvent.getType()) == 0) tearDownColorChangedEvent();
    }

    private native void tearDownColorChangedEvent() /*-{
        var obj;
        if(this.@com.smartgwt.client.widgets.BaseWidget::isCreated()()) {
            obj = this.@com.smartgwt.client.widgets.BaseWidget::getJsObj()();
        } else {
            obj = this.@com.smartgwt.client.widgets.BaseWidget::getConfig()();
        }
        if (obj && obj.hasOwnProperty("colorChanged")) delete obj.colorChanged;
    }-*/;

    /**
     * Add a colorPicked handler.
     * <p>
     * Notification fired when the user commits a color selection - either by clicking a swatch in {@link
     * com.smartgwt.client.types.ColorPickerMode simple mode} or clicking OK in complex mode. The <code>color</code> parameter
     * is an {@link com.smartgwt.client.util.Color} object; when {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getSupportsTransparency ColorPicker.supportsTransparency} is true it
     * carries the selected alpha, otherwise alpha is always 1. <P> This is the preferred replacement for {@link
     * com.smartgwt.client.widgets.form.ColorPicker#addColorSelectedHandler ColorPicker.colorSelected()}, which passes color
     * and opacity as separate parameters. <P> The <code>ColorPicker</code> may automatically hide itself after calling this
     * method depending on {@link com.smartgwt.client.widgets.form.ColorPicker#getAutoHide ColorPicker.autoHide} and {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getDefaultPickMode ColorPicker.defaultPickMode}.
     *
     * @param handler the colorPicked handler
     * @return {@link HandlerRegistration} used to remove this handler
     */
    public HandlerRegistration addColorPickedHandler(com.smartgwt.client.widgets.form.events.ColorPickedHandler handler) {
        if(getHandlerCount(com.smartgwt.client.widgets.form.events.ColorPickedEvent.getType()) == 0) setupColorPickedEvent();
        return doAddHandler(handler, com.smartgwt.client.widgets.form.events.ColorPickedEvent.getType());
    }

    private native void setupColorPickedEvent() /*-{
        var obj;
        var selfJ = this;
        var hasDefaultHandler;
        var colorPicked = $entry(function(){
            var param = {"_this": this, "color" : arguments[0]};
            var event = @com.smartgwt.client.widgets.form.events.ColorPickedEvent::new(Lcom/google/gwt/core/client/JavaScriptObject;)(param);
            selfJ.@com.smartgwt.client.widgets.BaseWidget::fireEvent(Lcom/google/gwt/event/shared/GwtEvent;)(event);
            selfJ.@com.smartgwt.client.widgets.form.ColorPicker::handleTearDownColorPickedEvent()();
            if (hasDefaultHandler) this.Super("colorPicked", arguments);
        });
        if(this.@com.smartgwt.client.widgets.BaseWidget::isCreated()()) {
            obj = this.@com.smartgwt.client.widgets.BaseWidget::getJsObj()();
            hasDefaultHandler = $wnd.isc.isA.Function(obj.getProperty("colorPicked"));
            obj.addProperties({colorPicked:  colorPicked              });
        } else {
            obj = this.@com.smartgwt.client.widgets.BaseWidget::getConfig()();
            var scClassName = this.@com.smartgwt.client.widgets.BaseWidget::scClassName;
            hasDefaultHandler = $wnd.isc.isA.Function($wnd.isc[scClassName].getInstanceProperty("colorPicked"));
            obj.colorPicked =  colorPicked             ;
        }
    }-*/;

    private void handleTearDownColorPickedEvent() {
        if (getHandlerCount(com.smartgwt.client.widgets.form.events.ColorPickedEvent.getType()) == 0) tearDownColorPickedEvent();
    }

    private native void tearDownColorPickedEvent() /*-{
        var obj;
        if(this.@com.smartgwt.client.widgets.BaseWidget::isCreated()()) {
            obj = this.@com.smartgwt.client.widgets.BaseWidget::getJsObj()();
        } else {
            obj = this.@com.smartgwt.client.widgets.BaseWidget::getConfig()();
        }
        if (obj && obj.hasOwnProperty("colorPicked")) delete obj.colorPicked;
    }-*/;

    /**
     * Add a colorSelected handler.
     * <p>
     * Override this method to be notified when the user selects a color either by clicking a basic color box in simple mode,
     * or by clicking the OK button in complex mode. It is not intended that client code call this method. The
     * <code>ColorPicker</code> may automatically hide itself after calling this method depending on {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getAutoHide ColorPicker.autoHide} and {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getDefaultPickMode ColorPicker.defaultPickMode}.
     *
     * @param handler the colorSelected handler
     * @return {@link HandlerRegistration} used to remove this handler
     */
    public HandlerRegistration addColorSelectedHandler(com.smartgwt.client.widgets.form.events.ColorSelectedHandler handler) {
        if(getHandlerCount(com.smartgwt.client.widgets.form.events.ColorSelectedEvent.getType()) == 0) setupColorSelectedEvent();
        return doAddHandler(handler, com.smartgwt.client.widgets.form.events.ColorSelectedEvent.getType());
    }

    private native void setupColorSelectedEvent() /*-{
        var obj;
        var selfJ = this;
        var hasDefaultHandler;
        var colorSelected = $entry(function(){
            var param = {"_this": this, "color" : arguments[0], "opacity" : arguments[1]};
            var event = @com.smartgwt.client.widgets.form.events.ColorSelectedEvent::new(Lcom/google/gwt/core/client/JavaScriptObject;)(param);
            selfJ.@com.smartgwt.client.widgets.BaseWidget::fireEvent(Lcom/google/gwt/event/shared/GwtEvent;)(event);
            selfJ.@com.smartgwt.client.widgets.form.ColorPicker::handleTearDownColorSelectedEvent()();
            if (hasDefaultHandler) this.Super("colorSelected", arguments);
        });
        if(this.@com.smartgwt.client.widgets.BaseWidget::isCreated()()) {
            obj = this.@com.smartgwt.client.widgets.BaseWidget::getJsObj()();
            hasDefaultHandler = $wnd.isc.isA.Function(obj.getProperty("colorSelected"));
            obj.addProperties({colorSelected:  colorSelected              });
        } else {
            obj = this.@com.smartgwt.client.widgets.BaseWidget::getConfig()();
            var scClassName = this.@com.smartgwt.client.widgets.BaseWidget::scClassName;
            hasDefaultHandler = $wnd.isc.isA.Function($wnd.isc[scClassName].getInstanceProperty("colorSelected"));
            obj.colorSelected =  colorSelected             ;
        }
    }-*/;

    private void handleTearDownColorSelectedEvent() {
        if (getHandlerCount(com.smartgwt.client.widgets.form.events.ColorSelectedEvent.getType()) == 0) tearDownColorSelectedEvent();
    }

    private native void tearDownColorSelectedEvent() /*-{
        var obj;
        if(this.@com.smartgwt.client.widgets.BaseWidget::isCreated()()) {
            obj = this.@com.smartgwt.client.widgets.BaseWidget::getJsObj()();
        } else {
            obj = this.@com.smartgwt.client.widgets.BaseWidget::getConfig()();
        }
        if (obj && obj.hasOwnProperty("colorSelected")) delete obj.colorSelected;
    }-*/;

    /**
     * Add a colorUpdated handler.
     * <p>
     * Notification fired in real-time as the user manipulates the color picker (dragging the crosshair, adjusting sliders,
     * typing in fields). The <code>color</code> parameter is an {@link com.smartgwt.client.util.Color} object; when {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getSupportsTransparency ColorPicker.supportsTransparency} is true it
     * carries the current alpha, otherwise alpha is always 1. <P> This is the preferred replacement for {@link
     * com.smartgwt.client.widgets.form.ColorPicker#addColorChangedHandler ColorPicker.colorChanged()}, which passes no
     * parameters and requires the caller to use getter methods.
     *
     * @param handler the colorUpdated handler
     * @return {@link HandlerRegistration} used to remove this handler
     */
    public HandlerRegistration addColorUpdatedHandler(com.smartgwt.client.widgets.form.events.ColorUpdatedHandler handler) {
        if(getHandlerCount(com.smartgwt.client.widgets.form.events.ColorUpdatedEvent.getType()) == 0) setupColorUpdatedEvent();
        return doAddHandler(handler, com.smartgwt.client.widgets.form.events.ColorUpdatedEvent.getType());
    }

    private native void setupColorUpdatedEvent() /*-{
        var obj;
        var selfJ = this;
        var hasDefaultHandler;
        var colorUpdated = $entry(function(){
            var param = {"_this": this, "color" : arguments[0]};
            var event = @com.smartgwt.client.widgets.form.events.ColorUpdatedEvent::new(Lcom/google/gwt/core/client/JavaScriptObject;)(param);
            selfJ.@com.smartgwt.client.widgets.BaseWidget::fireEvent(Lcom/google/gwt/event/shared/GwtEvent;)(event);
            selfJ.@com.smartgwt.client.widgets.form.ColorPicker::handleTearDownColorUpdatedEvent()();
            if (hasDefaultHandler) this.Super("colorUpdated", arguments);
        });
        if(this.@com.smartgwt.client.widgets.BaseWidget::isCreated()()) {
            obj = this.@com.smartgwt.client.widgets.BaseWidget::getJsObj()();
            hasDefaultHandler = $wnd.isc.isA.Function(obj.getProperty("colorUpdated"));
            obj.addProperties({colorUpdated:  colorUpdated              });
        } else {
            obj = this.@com.smartgwt.client.widgets.BaseWidget::getConfig()();
            var scClassName = this.@com.smartgwt.client.widgets.BaseWidget::scClassName;
            hasDefaultHandler = $wnd.isc.isA.Function($wnd.isc[scClassName].getInstanceProperty("colorUpdated"));
            obj.colorUpdated =  colorUpdated             ;
        }
    }-*/;

    private void handleTearDownColorUpdatedEvent() {
        if (getHandlerCount(com.smartgwt.client.widgets.form.events.ColorUpdatedEvent.getType()) == 0) tearDownColorUpdatedEvent();
    }

    private native void tearDownColorUpdatedEvent() /*-{
        var obj;
        if(this.@com.smartgwt.client.widgets.BaseWidget::isCreated()()) {
            obj = this.@com.smartgwt.client.widgets.BaseWidget::getJsObj()();
        } else {
            obj = this.@com.smartgwt.client.widgets.BaseWidget::getConfig()();
        }
        if (obj && obj.hasOwnProperty("colorUpdated")) delete obj.colorUpdated;
    }-*/;

	/**
     * Returns the Blue element of the currently-selected color, as an integer from 0-255.
     *
     * @return blue color component
     * @see com.smartgwt.client.widgets.form.ColorPicker#setBlue
     * @deprecated Use <code>getColor().b</code> instead.
     */
    public native int getBlue() /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "getBlue", "");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        var ret = self.getBlue();
        return ret;
    }-*/;

	/**
     * Returns the currently-selected color as a CSS string in any {@link com.smartgwt.client.types.ColorFormat}.  Equivalent
     * to <code>getColor().getString(format)</code>. When {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getSupportsTransparency supportsTransparency} is false or the color is
     * fully opaque, the alpha channel is omitted from the output.
     *
     * @return CSS color string
     * @see com.smartgwt.client.widgets.form.ColorPicker#getColor
     */
    public native String getColorString() /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "getColorString", "");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        var ret = self.getColorString();
        return ret;
    }-*/;

	/**
     * Returns the currently-selected color as a CSS string in any {@link com.smartgwt.client.types.ColorFormat}.  Equivalent
     * to <code>getColor().getString(format)</code>. When {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getSupportsTransparency supportsTransparency} is false or the color is
     * fully opaque, the alpha channel is omitted from the output.
     * @param format output format (defaults to "hex")
     *
     * @return CSS color string
     * @see com.smartgwt.client.widgets.form.ColorPicker#getColor
     */
    public native String getColorString(ColorFormat format) /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "getColorString", "ColorFormat");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        var ret = self.getColorString(format == null ? null : format.@com.smartgwt.client.types.ColorFormat::getValue()());
        return ret;
    }-*/;
	
	/**
     * Returns the Green element of the currently-selected color, as an integer from 0-255.
     *
     * @return green color component
     * @see com.smartgwt.client.widgets.form.ColorPicker#setGreen
     * @deprecated Use <code>getColor().g</code> instead.
     */
    public native int getGreen() /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "getGreen", "");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        var ret = self.getGreen();
        return ret;
    }-*/;

	/**
     * Returns the currently-selected color as a hex string. When {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getSupportsTransparency supportsTransparency} is true and the color has
     * alpha &lt; 1, the string includes the alpha channel as two additional hex digits (e.g. <code>"#F17F1D80"</code>);
     * otherwise it is a standard 6-digit hex string (e.g. <code>"#F17F1D"</code>).
     *
     * @return HTML color value
     * @see com.smartgwt.client.widgets.form.ColorPicker#setHtmlColor
     * @deprecated Use {@link com.smartgwt.client.widgets.form.ColorPicker#getColorString getColorString()} instead, which supports any    
     * {@link com.smartgwt.client.types.ColorFormat}.  For the full {@link com.smartgwt.client.util.Color} object, use    
     * {@link com.smartgwt.client.widgets.form.ColorPicker#getColor getColor()}.
     */
    public native String getHtmlColor() /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "getHtmlColor", "");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        var ret = self.getHtmlColor();
        return ret;
    }-*/;

	/**
     * Returns the Hue of the currently-selected color, as an integer from 0-360 (CSS-standard HSL hue wheel).
     *
     * @return hue value
     * @see com.smartgwt.client.widgets.form.ColorPicker#setHue
     * @deprecated Use <code>getColor().h</code> instead.
     */
    public native int getHue() /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "getHue", "");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        var ret = self.getHue();
        return ret;
    }-*/;

	/**
     * Returns the Lightness of the currently-selected color, as an integer from 0-100 (CSS-standard HSL percentage).  0 is
     * black, 50 is full chroma, 100 is white.
     *
     * @return lightness value
     * @see com.smartgwt.client.widgets.form.ColorPicker#setLightness
     * @deprecated Use <code>getColor().l</code> instead.
     */
    public native int getLightness() /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "getLightness", "");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        var ret = self.getLightness();
        return ret;
    }-*/;

	/**
     * 
     *
     * @return lightness value (0-100)
     * @deprecated Use {@link com.smartgwt.client.widgets.form.ColorPicker#getLightness getLightness()} instead.  This method now returns
     * the CSS-standard lightness value (0-100), not the legacy 0-240 scale.
     */
    public native int getLuminosity() /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "getLuminosity", "");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        var ret = self.getLuminosity();
        return ret;
    }-*/;

	/**
     * Returns the Red element of the currently-selected color, as an integer from 0-255.
     *
     * @return red color component
     * @see com.smartgwt.client.widgets.form.ColorPicker#setRed
     * @deprecated Use <code>getColor().r</code> instead.
     */
    public native int getRed() /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "getRed", "");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        var ret = self.getRed();
        return ret;
    }-*/;

	/**
     * Returns the Saturation of the currently-selected color, as an integer from 0-100 (CSS-standard HSL percentage).
     *
     * @return saturation value
     * @see com.smartgwt.client.widgets.form.ColorPicker#setSaturation
     * @deprecated Use <code>getColor().s</code> instead.
     */
    public native int getSaturation() /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "getSaturation", "");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        var ret = self.getSaturation();
        return ret;
    }-*/;

	/**
     * Sets the Blue element of the selected color.
     * @param newValue An integer between 0 and 255
     * @see com.smartgwt.client.widgets.form.ColorPicker#getBlue
     */
    public native void setBlue(int newValue) /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "setBlue", "int");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        self.setBlue(newValue);
    }-*/;

	/**
     * Changes the pick mode of this <code>ColorPicker</code> to <code>pickMode</code>. <p> Note: It is not allowed to set the
     * pick mode to  {@link com.smartgwt.client.types.ColorPickerMode#COMPLEX} if {@link
     * com.smartgwt.client.widgets.form.ColorPicker#getAllowComplexMode allowComplexMode} is <code>false</code>.
     * @param pickMode the new pick mode.
     */
    public native void setCurrentPickMode(ColorPickerMode pickMode) /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "setCurrentPickMode", "ColorPickerMode");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        self.setCurrentPickMode(pickMode.@com.smartgwt.client.types.ColorPickerMode::getValue()());
    }-*/;

	/**
     * Sets the Green element of the selected color.
     * @param newValue An integer between 0 and 255
     * @see com.smartgwt.client.widgets.form.ColorPicker#getGreen
     */
    public native void setGreen(int newValue) /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "setGreen", "int");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        self.setGreen(newValue);
    }-*/;

	/**
     * Changes the selected color to the one represented by the supplied HTML color string.  Accepts any valid CSS color string
     * (hex, rgb(), hsl(), named colors, "transparent").  Invalid values are ignored.
     * @param newValue a CSS color string
     * @see com.smartgwt.client.widgets.form.ColorPicker#getHtmlColor
     * @deprecated Use {@link com.smartgwt.client.widgets.form.ColorPicker#setColor setColor()} instead, which accepts CSS strings,    
     * structured objects, and {@link com.smartgwt.client.util.Color} objects.
     */
    public native void setHtmlColor(String newValue) /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "setHtmlColor", "String");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        self.setHtmlColor(newValue);
    }-*/;

	/**
     * Sets the Hue of the selected color.
     * @param newValue An integer between 0 and 360
     * @see com.smartgwt.client.widgets.form.ColorPicker#getHue
     */
    public native void setHue(int newValue) /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "setHue", "int");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        self.setHue(newValue);
    }-*/;

	/**
     * Sets the Lightness of the selected color (CSS-standard HSL: 0 is black, 50 is full chroma, 100 is white).
     * @param newValue An integer between 0 and 100
     * @see com.smartgwt.client.widgets.form.ColorPicker#getLightness
     */
    public native void setLightness(int newValue) /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "setLightness", "int");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        self.setLightness(newValue);
    }-*/;

	/**
     * 
     * @param newValue An integer between 0 and 100
     * @deprecated Use {@link com.smartgwt.client.widgets.form.ColorPicker#setLightness setLightness()} instead.  This method now accepts
     * CSS-standard lightness (0-100), not the legacy 0-240 scale.
     */
    public native void setLuminosity(int newValue) /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "setLuminosity", "int");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        self.setLuminosity(newValue);
    }-*/;

	/**
     * Sets the Opacity of the selected color.  Ignored if opacity is switched off.
     * @param newValue An integer between 0 and 100
     * @see com.smartgwt.client.widgets.form.ColorPicker#getOpacity
     */
    public native void setOpacity(int newValue) /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "setOpacity", "int");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        self.setOpacity(newValue);
    }-*/;

	/**
     * Sets the Red element of the selected color.
     * @param newValue An integer between 0 and 255
     * @see com.smartgwt.client.widgets.form.ColorPicker#getRed
     */
    public native void setRed(int newValue) /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "setRed", "int");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        self.setRed(newValue);
    }-*/;

	/**
     * Sets the Saturation of the selected color.
     * @param newValue An integer between 0 and 100
     * @see com.smartgwt.client.widgets.form.ColorPicker#getSaturation
     */
    public native void setSaturation(int newValue) /*-{
        if (this.@com.smartgwt.client.widgets.BaseWidget::isConfigOnly()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPostConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)(this.@java.lang.Object::getClass()(), "setSaturation", "int");
        }
        var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
        self.setSaturation(newValue);
    }-*/;


    // ********************* Static Methods ***********************


    /** 
     * Class level method to set the default properties of this class.  If set, then all
     * existing and subsequently created instances of this class will automatically have
     * default properties corresponding to
     * the properties set on the SmartGWT class instance passed to this function before its
     * underlying SmartClient JS object was created.
     * This is a powerful feature that eliminates the need for users to create a separate
     * hierarchy of subclasses that only alter the default properties of this class. Can also
     * be used for skinning / styling purposes.  <P> <b>Note:</b> This method is intended for
     * setting default attributes only and will affect all instances of the underlying class
     * (including those automatically generated in JavaScript).  This method should not be used
     * to apply standard EventHandlers or override methods for a class - use a custom subclass
     * instead.  Calling this method after instances have been created can result in undefined
     * behavior, since it bypasses any setters and a class instance may have already examined 
     * a particular property and not be expecting any changes through this route.
     *
     * @param colorPickerProperties properties that should be used as new defaults when instances of this class are created
     * @see com.smartgwt.client.docs.SGWTProperties
     */
    public static native void setDefaultProperties(ColorPicker colorPickerProperties) /*-{
        if (colorPickerProperties.@com.smartgwt.client.widgets.BaseWidget::isCreated()()) {
            @com.smartgwt.client.util.ConfigUtil::warnOfPreConfigInstantiation(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Class;)(ColorPicker.@java.lang.Object::getClass()(), "setDefaultProperties", colorPickerProperties.@java.lang.Object::getClass()());
        }
        colorPickerProperties.@com.smartgwt.client.widgets.BaseWidget::setConfigOnly(Z)(true);
    	var properties = colorPickerProperties.@com.smartgwt.client.widgets.BaseWidget::getConfig()();
        properties = @com.smartgwt.client.util.JSOHelper::cleanProperties(Lcom/google/gwt/core/client/JavaScriptObject;Z)(properties,true);
        $wnd.isc.ColorPicker.addProperties(properties);
    }-*/;

    // ***********************************************************

    /**
     * Setter implementing the {@link com.smartgwt.client.core.LogicalStructure} interface,
     * which supports Eclipse's logical structure debugging facility.
     */
    public LogicalStructureObject setLogicalStructure(ColorPickerLogicalStructure s) {
        super.setLogicalStructure(s);
        try {
            s.allowComplexMode = getAttributeAsString("allowComplexMode");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.allowComplexMode:" + t.getMessage() + "\n";
        }
        try {
            s.autoCenterOnShow = getAttributeAsString("autoCenterOnShow");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.autoCenterOnShow:" + t.getMessage() + "\n";
        }
        try {
            s.autoHide = getAttributeAsString("autoHide");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.autoHide:" + t.getMessage() + "\n";
        }
        try {
            s.autoPosition = getAttributeAsString("autoPosition");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.autoPosition:" + t.getMessage() + "\n";
        }
        try {
            s.basicColorLabel = getAttributeAsString("basicColorLabel");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.basicColorLabel:" + t.getMessage() + "\n";
        }
        try {
            s.blueFieldPrompt = getAttributeAsString("blueFieldPrompt");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.blueFieldPrompt:" + t.getMessage() + "\n";
        }
        try {
            s.blueFieldTitle = getAttributeAsString("blueFieldTitle");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.blueFieldTitle:" + t.getMessage() + "\n";
        }
        try {
            s.cancelButtonTitle = getAttributeAsString("cancelButtonTitle");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.cancelButtonTitle:" + t.getMessage() + "\n";
        }
        try {
            s.colorAsString = getAttributeAsString("color");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.colorAsString:" + t.getMessage() + "\n";
        }
        try {
            s.colorAsColor = getColorAsColor();
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.colorAsColor:" + t.getMessage() + "\n";
        }
        try {
            s.colorArray = getAttributeAsStringArray("colorArray");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.colorArrayArray:" + t.getMessage() + "\n";
        }
        try {
            s.colorButtonBaseStyle = getAttributeAsString("colorButtonBaseStyle");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.colorButtonBaseStyle:" + t.getMessage() + "\n";
        }
        try {
            s.colorButtonSize = getAttributeAsString("colorButtonSize");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.colorButtonSize:" + t.getMessage() + "\n";
        }
        try {
            s.crosshairImageURL = getAttributeAsString("crosshairImageURL");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.crosshairImageURL:" + t.getMessage() + "\n";
        }
        try {
            s.defaultColor = getAttributeAsString("defaultColor");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.defaultColor:" + t.getMessage() + "\n";
        }
        try {
            s.defaultOpacity = getAttributeAsString("defaultOpacity");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.defaultOpacity:" + t.getMessage() + "\n";
        }
        try {
            s.defaultPickMode = getAttributeAsString("defaultPickMode");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.defaultPickMode:" + t.getMessage() + "\n";
        }
        try {
            s.greenFieldPrompt = getAttributeAsString("greenFieldPrompt");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.greenFieldPrompt:" + t.getMessage() + "\n";
        }
        try {
            s.greenFieldTitle = getAttributeAsString("greenFieldTitle");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.greenFieldTitle:" + t.getMessage() + "\n";
        }
        try {
            s.hslItemHover = getAttributeAsString("hslItemHover");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.hslItemHover:" + t.getMessage() + "\n";
        }
        try {
            s.hslItemTitle = getAttributeAsString("hslItemTitle");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.hslItemTitle:" + t.getMessage() + "\n";
        }
        try {
            s.htmlFieldPrompt = getAttributeAsString("htmlFieldPrompt");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.htmlFieldPrompt:" + t.getMessage() + "\n";
        }
        try {
            s.htmlFieldTitle = getAttributeAsString("htmlFieldTitle");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.htmlFieldTitle:" + t.getMessage() + "\n";
        }
        try {
            s.hueFieldPrompt = getAttributeAsString("hueFieldPrompt");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.hueFieldPrompt:" + t.getMessage() + "\n";
        }
        try {
            s.hueFieldTitle = getAttributeAsString("hueFieldTitle");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.hueFieldTitle:" + t.getMessage() + "\n";
        }
        try {
            s.lessButtonTitle = getAttributeAsString("lessButtonTitle");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.lessButtonTitle:" + t.getMessage() + "\n";
        }
        try {
            s.lumFieldPrompt = getAttributeAsString("lumFieldPrompt");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.lumFieldPrompt:" + t.getMessage() + "\n";
        }
        try {
            s.lumFieldTitle = getAttributeAsString("lumFieldTitle");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.lumFieldTitle:" + t.getMessage() + "\n";
        }
        try {
            s.lumWidth = getAttributeAsString("lumWidth");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.lumWidth:" + t.getMessage() + "\n";
        }
        try {
            s.moreButtonTitle = getAttributeAsString("moreButtonTitle");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.moreButtonTitle:" + t.getMessage() + "\n";
        }
        try {
            s.okButtonTitle = getAttributeAsString("okButtonTitle");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.okButtonTitle:" + t.getMessage() + "\n";
        }
        try {
            s.opacitySliderLabel = getAttributeAsString("opacitySliderLabel");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.opacitySliderLabel:" + t.getMessage() + "\n";
        }
        try {
            s.opacityText = getAttributeAsString("opacityText");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.opacityText:" + t.getMessage() + "\n";
        }
        try {
            s.paletteMode = getAttributeAsString("paletteMode");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.paletteMode:" + t.getMessage() + "\n";
        }
        try {
            s.redFieldPrompt = getAttributeAsString("redFieldPrompt");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.redFieldPrompt:" + t.getMessage() + "\n";
        }
        try {
            s.redFieldTitle = getAttributeAsString("redFieldTitle");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.redFieldTitle:" + t.getMessage() + "\n";
        }
        try {
            s.rgbItemHover = getAttributeAsString("rgbItemHover");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.rgbItemHover:" + t.getMessage() + "\n";
        }
        try {
            s.rgbItemTitle = getAttributeAsString("rgbItemTitle");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.rgbItemTitle:" + t.getMessage() + "\n";
        }
        try {
            s.satFieldPrompt = getAttributeAsString("satFieldPrompt");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.satFieldPrompt:" + t.getMessage() + "\n";
        }
        try {
            s.satFieldTitle = getAttributeAsString("satFieldTitle");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.satFieldTitle:" + t.getMessage() + "\n";
        }
        try {
            s.selectedColorLabel = getAttributeAsString("selectedColorLabel");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.selectedColorLabel:" + t.getMessage() + "\n";
        }
        try {
            s.showCancelButton = getAttributeAsString("showCancelButton");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.showCancelButton:" + t.getMessage() + "\n";
        }
        try {
            s.showHarmonyRow = getAttributeAsString("showHarmonyRow");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.showHarmonyRow:" + t.getMessage() + "\n";
        }
        try {
            s.showModeToggleButton = getAttributeAsString("showModeToggleButton");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.showModeToggleButton:" + t.getMessage() + "\n";
        }
        try {
            s.showOkButton = getAttributeAsString("showOkButton");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.showOkButton:" + t.getMessage() + "\n";
        }
        try {
            s.supportsTransparency = getAttributeAsString("supportsTransparency");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.supportsTransparency:" + t.getMessage() + "\n";
        }
        try {
            s.swatchHeight = getAttributeAsString("swatchHeight");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.swatchHeight:" + t.getMessage() + "\n";
        }
        try {
            s.swatchImageURL = getAttributeAsString("swatchImageURL");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.swatchImageURL:" + t.getMessage() + "\n";
        }
        try {
            s.swatchWidth = getAttributeAsString("swatchWidth");
        } catch (Throwable t) {
            s.logicalStructureErrors += "ColorPicker.swatchWidth:" + t.getMessage() + "\n";
        }
        return s;
    }

    /**
     * Getter implementing the {@link com.smartgwt.client.core.LogicalStructure} interface,
     * which supports Eclipse's logical structure debugging facility.
     */
    public LogicalStructureObject getLogicalStructure() {
        ColorPickerLogicalStructure s = new ColorPickerLogicalStructure();
        setLogicalStructure(s);
        return s;
    }
}
