Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.gwtext.client.widgets
Class ColorPalette

    java.lang.Object
      com.google.gwt.user.client.ui.UIObject
          com.google.gwt.user.client.ui.Widget
              com.gwtext.client.widgets.Component
                  com.gwtext.client.widgets.ColorPalette

All Implemented Interfaces:
  com.google.gwt.user.client.EventListener, Observable

    public class ColorPalette

extends Component

Simple color palette class for choosing colors.

Field Summary

Fields inherited from class com.gwtext.client.widgets.Component
`config, id`

Constructor Summary
`ColorPalette()` Create a new CollorPalette.
`ColorPalette(com.google.gwt.core.client.JavaScriptObject jsObj)`

Method Summary
`void` | `addListener(ColorPaletteListener listener)` Add a ColorPalette listener.
`protected com.google.gwt.core.client.JavaScriptObject` | `create(com.google.gwt.core.client.JavaScriptObject config)`
`java.lang.String[]` | `getColors()` An array of 6-digit color hex code strings (without the # symbol).
`protected com.google.gwt.core.client.JavaScriptObject` | `getConfigPrototype()`
`java.lang.String` | `getItemCls()`
`java.lang.String` | `getValue()` The highlighted color.
`java.lang.String` | `getXType()` Gets the xtype for this component as registered with ComponentMgr.
`boolean` | `isAllowReselect()` Return true if reselecting is allowed.
`void` | `select(java.lang.String color)` Selects the specified color in the palette (fires the select event).
`void` | `setAllowReselect(boolean allowReselect)` If set to true then reselecting a color that is already selected fires the selection event.
`void` | `setColors(java.lang.String[] colors)` Set the colors array.
`void` | `setItemCls(java.lang.String itemCls)` The CSS class to apply to the containing element (defaults to "x-color-palette").
`void` | `setValue(java.lang.String value)` The color to highlight (should be a valid 6-digit color hex code without the # symbol).

Methods inherited from class com.gwtext.client.widgets.Component
`addClass, addClassCreated, addEvent, addEvents, addListener, addListener, addListener, afterRender, beforeDestroy, check, cloneComponent, cloneComponent, cloneConfig, destroy, disable, enable, equals, error, focus, focus, focus, getApplyTo, getAttribute, getAttributeAsBoolean, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAutoShow, getCls, getComponentJS, getConfig, getCtCls, getDisabledClass, getEl, getElement, getElement, getHideMode, getHideParent, getId, getItemId, getJsObj, getOffsetHeight, getOffsetWidth, getOrCreateJsObj, getOwnerContainer, getRenderTo, getStateEvents, getStateId, getStyle, getStyleElement, getTitle, getXTypes, hashCode, hide, initComponent, isCreated, isDisabled, isHidden, isRendered, isVisible, isXType, isXType, onDestroy, removeClass, render, render, render, render, render, render, setApplyTo, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAutoEl, setAutoShow, setCls, setCtCls, setDisabled, setDisabledClass, setEl, setEl, setHeight, setHideMode, setHideParent, setId, setRenderTo, setStateEvents, setStateId, setStyle, setTitle, setVisible, setWidth, show`

Methods inherited from class com.google.gwt.user.client.ui.Widget
`doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setElement`

Methods inherited from class com.google.gwt.user.client.ui.UIObject
`addStyleDependentName, addStyleName, getAbsoluteLeft, getAbsoluteTop, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, removeStyleName, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkEvents, toString, unsinkEvents`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### ColorPalette

    public ColorPalette()

  Create a new CollorPalette.

### ColorPalette

    public ColorPalette(com.google.gwt.core.client.JavaScriptObject jsObj)

Method Detail

### getConfigPrototype

    protected com.google.gwt.core.client.JavaScriptObject getConfigPrototype()

  Specified by:
    `getConfigPrototype` in class `Component`

### getXType

    public java.lang.String getXType()

  Description copied from class: `Component`
  Gets the xtype for this component as registered with ComponentMgr. For a list of all available xtypes, see the Component javadocs.

       TextField field = new TextField();
       field.getXType() returns "textfield"

  Overrides:
    `getXType` in class `Component`
  Returns:
    the xtype

### create

    protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject config)

  Specified by:
    `create` in class `Component`

### select

    public void select(java.lang.String color)

  Selects the specified color in the palette (fires the select event).

  Parameters:
    `color` - A valid 6-digit color hex code (# will be stripped if included)

### addListener

    public void addListener(ColorPaletteListener listener)

  Add a ColorPalette listener.

  Parameters:
    `listener` - the listener

### isAllowReselect

    public boolean isAllowReselect()

  Return true if reselecting is allowed.

  Returns:
    true if reselecting is allowed

### setAllowReselect

    public void setAllowReselect(boolean allowReselect)

  If set to true then reselecting a color that is already selected fires the selection event.

  Parameters:
    `allowReselect` - true to allow reselect

### getItemCls

    public java.lang.String getItemCls()

  Returns:
    the CSS of the containing element

### setItemCls

    public void setItemCls(java.lang.String itemCls)

  The CSS class to apply to the containing element (defaults to "x-color-palette").

  Parameters:
    `itemCls` - the item CSS class

### getValue

    public java.lang.String getValue()

  The highlighted color.

  Returns:
    the color value

### setValue

    public void setValue(java.lang.String value)

  The color to highlight (should be a valid 6-digit color hex code without the # symbol). Note that the hex codes are case-sensitive.

  Parameters:
    `value` - the initial color

### getColors

    public java.lang.String[] getColors()

  An array of 6-digit color hex code strings (without the # symbol). This array can contain any number of colors, and each hex code should be unique. The width of the palette is controlled via CSS by adjusting the width property of the 'x-color-palette' class (or assigning a custom class), so you can balance the number of colors with the width setting until the box is symmetrical.

  Returns:
    the colors array

### setColors

    public void setColors(java.lang.String[] colors)
                   throws java.lang.IllegalStateException

  Set the colors array.

  Parameters:
    `colors` - the colors array
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD