01: /*
02: * GWT-Ext Widget Library
03: * Copyright(c) 2007-2008, GWT-Ext.
04: * licensing@gwt-ext.com
05: *
06: * http://www.gwt-ext.com/license
07: */
08:
09: package com.gwtext.client.widgets.menu;
10:
11: import com.google.gwt.core.client.JavaScriptObject;
12: import com.gwtext.client.widgets.ColorPalette;
13:
14: /**
15: * A menu item that wraps the {@link ColorPalette} component.
16: *
17: */
18: public class ColorItem extends Item {
19:
20: private static JavaScriptObject configPrototype;
21:
22: static {
23: init();
24: }
25:
26: private static native void init()/*-{
27: var c = new $wnd.Ext.menu.ColorItem();
28: @com.gwtext.client.widgets.menu.ColorItem::configPrototype = c.initialConfig;
29: }-*/;
30:
31: protected JavaScriptObject getConfigPrototype() {
32: return configPrototype;
33: }
34:
35: /**
36: * Create a new ColorItem.
37: */
38: public ColorItem() {
39: }
40:
41: protected native JavaScriptObject create(JavaScriptObject config) /*-{
42: return new $wnd.Ext.menu.ColorItem(config);
43: }-*/;
44:
45: /**
46: * Return the CollorPalette associated with the menu item.
47: *
48: * @return the ColorPalette
49: */
50: public native ColorPalette getPalette() /*-{
51: var ci = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
52: return @com.gwtext.client.widgets.ColorPalette::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(ci.palette);
53: }-*/;
54: }
|