com.gwtext.client.widgets.menu
Class CheckItem

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.gwtext.client.widgets.Component
              extended by com.gwtext.client.widgets.menu.BaseItem
                  extended by com.gwtext.client.widgets.menu.Item
                      extended by com.gwtext.client.widgets.menu.CheckItem
All Implemented Interfaces:
com.google.gwt.user.client.EventListener, Observable

public class CheckItem
extends Item

Adds a menu item that contains a checkbox by default, but can also be part of a radio group.


Field Summary
 
Fields inherited from class com.gwtext.client.widgets.Component
config, id
 
Constructor Summary
CheckItem()
          Create a new CheckItem.
CheckItem(com.google.gwt.core.client.JavaScriptObject jsObj)
           
CheckItem(java.lang.String text)
          Create a new CheckItem.
CheckItem(java.lang.String text, boolean checked)
          Create a new CheckItem.
 
Method Summary
 void addListener(CheckItemListener listener)
          Add a CheckItemListener.
protected  com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject jsObj)
           
protected  com.google.gwt.core.client.JavaScriptObject getConfigPrototype()
           
 boolean isChecked()
          True if checked.
 void setChecked(boolean checked)
          True to mark the checkbox as checked (defaults to false).
 void setGroup(java.lang.String group)
          All check items with the same group name will automatically be grouped into a single-select radio button group (defaults to '').
 void setGroupClass(java.lang.String groupClass)
          The default CSS class to use for radio group check items (defaults to "x-menu-group-item").
 void setItemCls(java.lang.String itemCls)
          The default CSS class to use for check items (defaults to "x-menu-item x-menu-check-item").
 
Methods inherited from class com.gwtext.client.widgets.menu.Item
getHref, getHrefTarget, getIconCls, getItemCls, getText, getXType, setHref, setHrefTarget, setIcon, setIconCls, setText
 
Methods inherited from class com.gwtext.client.widgets.menu.BaseItem
addListener, getActiveClass, getHideDelay, getShowDelay, isCanActivate, isHideOnClick, setActiveClass, setCanActivate, setHideDelay, setHideOnClick, setShowDelay
 
Methods inherited from class com.gwtext.client.widgets.Component
addClass, addClassCreated, addEvent, addEvents, addListener, addListener, addListener, addPlugin, addStyleDependentName, addStyleName, afterRender, beforeDestroy, check, checkExtVer, cloneComponent, cloneComponent, cloneConfig, destroy, disable, enable, equals, error, findParentBy, findParentByType, fireEvent, focus, focus, focus, getApplyTo, getAttribute, getAttributeAsBoolean, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAutoShow, getCls, getComponentJS, getConfig, getConfigAsString, getCtCls, getDisabledClass, getEl, getElement, getElement, getElement, getHideMode, getHideParent, getId, getItemId, getJsObj, getOffsetHeight, getOffsetWidth, getOrCreateJsObj, getOwnerContainer, getRenderTo, getStateEvents, getStateId, getTitle, getXTypes, hashCode, hide, initComponent, isCreated, isDisabled, isHidden, isRendered, isVisible, isXType, isXType, onDestroy, purgeListeners, removeClass, removeStyleDependentName, removeStyleName, render, render, render, render, render, render, resumeEvents, setApplyTo, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAutoEl, setAutoEl, setAutoShow, setCls, setCtCls, setDisabled, setDisabledClass, setEl, setEl, setElement, setHeight, setHideMode, setHideParent, setId, setRenderTo, setRenderToID, setStateEvents, setStateId, setStyle, setStyle, setStyleName, setStylePrimaryName, setTitle, setVisible, setWidth, show, suspendEvents, toString
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
getAbsoluteLeft, getAbsoluteTop, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, setPixelSize, setSize, setStyleName, setStyleName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CheckItem

public CheckItem()
Create a new CheckItem.


CheckItem

public CheckItem(java.lang.String text)
Create a new CheckItem.

Parameters:
text - the CheckItem text

CheckItem

public CheckItem(java.lang.String text,
                 boolean checked)
Create a new CheckItem.

Parameters:
text - the CheckItem text
checked - true for checked

CheckItem

public CheckItem(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail

getConfigPrototype

protected com.google.gwt.core.client.JavaScriptObject getConfigPrototype()
Overrides:
getConfigPrototype in class Item

create

protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject jsObj)
Overrides:
create in class Item

addListener

public void addListener(CheckItemListener listener)
Add a CheckItemListener.

Parameters:
listener - the listener

setChecked

public void setChecked(boolean checked)
True to mark the checkbox as checked (defaults to false). Note that if this checkbox is part of a radio group (group = true) only the last item in the group that is initialized with checked = true will be rendered as checked.

Parameters:
checked - true to set as checked

isChecked

public boolean isChecked()
True if checked.

Returns:
true if checked

setGroup

public void setGroup(java.lang.String group)
              throws java.lang.IllegalStateException
All check items with the same group name will automatically be grouped into a single-select radio button group (defaults to '').

Parameters:
group - the group name
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setGroupClass

public void setGroupClass(java.lang.String groupClass)
                   throws java.lang.IllegalStateException
The default CSS class to use for radio group check items (defaults to "x-menu-group-item").

Parameters:
groupClass - the group CSS class
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setItemCls

public void setItemCls(java.lang.String itemCls)
                throws java.lang.IllegalArgumentException
The default CSS class to use for check items (defaults to "x-menu-item x-menu-check-item").

Overrides:
setItemCls in class Item
Parameters:
itemCls - the default CSS class to use for check items
Throws:
java.lang.IllegalArgumentException