com.extjs.gxt.ui.client.widget
Class DataListItem

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.DataListItem
All Implemented Interfaces:
Observable, com.google.gwt.user.client.EventListener

public class DataListItem
extends Component

A item contained in a List.

See Also:
DataList

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
DataListItem()
          Creates a new list item.
DataListItem(java.lang.String text)
          Creates a new list item.
 
Method Summary
 void addSelectionListener(SelectionListener listener)
          Adds a selection listener.
 java.lang.String getIconStyle()
          Returns the icon style.
 DataList getList()
          Returns the item's parent list.
 java.lang.String getText()
          Returns the item's text.
 java.lang.String getTextStyle()
          Returns the item's text style.
 boolean isChecked()
          Returns true if the item is checked.
 void onComponentEvent(ComponentEvent ce)
          Any events a component receives will be forwarded to this method.
 void removeSelectionListener(SelectionListener listener)
          Removes a previously added listener.
 void setChecked(boolean checked)
          Sets the item's checked state.
 void setIconStyle(java.lang.String iconStyle)
          Sets the item's icon style.
 void setText(java.lang.String text)
          Sets the item's text.
 void setTextStyle(java.lang.String textStyle)
          Sets the item's text style.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addListener, addPlugin, addStyleName, addWidgetListener, disable, disableEvents, disableTextSelection, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, getBaseStyle, getBorders, getData, getData, getElement, getId, getItemId, getModel, getState, getToolTip, hide, hideToolTip, isDisabledEvents, isEnabled, isRendered, isVisible, onBrowserEvent, recalculate, removeAllListeners, removeFromParent, removeListener, removeStyleName, removeWidgetListener, render, render, saveState, setBorders, setData, setData, setElement, setEnabled, setEnableState, setHeight, setId, setIntStyleAttribute, setItemId, setPixelSize, setSize, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, setWidth, show, sinkEvents, toString
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataListItem

public DataListItem()
Creates a new list item.


DataListItem

public DataListItem(java.lang.String text)
Creates a new list item.

Parameters:
text - the text
Method Detail

addSelectionListener

public void addSelectionListener(SelectionListener listener)
Adds a selection listener.

Parameters:
listener - the listener

getIconStyle

public java.lang.String getIconStyle()
Returns the icon style.

Returns:
the icon style

getList

public DataList getList()
Returns the item's parent list.

Returns:
the list

getText

public java.lang.String getText()
Returns the item's text.

Returns:
the text

getTextStyle

public java.lang.String getTextStyle()
Returns the item's text style.

Returns:
the text style

isChecked

public boolean isChecked()
Returns true if the item is checked.

Returns:
the checked state

onComponentEvent

public void onComponentEvent(ComponentEvent ce)
Description copied from class: Component
Any events a component receives will be forwarded to this method. Subclasses should override as needed. The Component.onBrowserEvent(com.google.gwt.user.client.Event) method should not be overridden or modified.

Overrides:
onComponentEvent in class Component
Parameters:
ce - the base event

removeSelectionListener

public void removeSelectionListener(SelectionListener listener)
Removes a previously added listener.

Parameters:
listener - the listener to be removed

setChecked

public void setChecked(boolean checked)
Sets the item's checked state.

Parameters:
checked - the check state

setIconStyle

public void setIconStyle(java.lang.String iconStyle)
Sets the item's icon style. The style name should match a CSS style that specifies a background image using the following format:

 .my-icon {
    background: url(images/icons/my-icon.png) no-repeat center left !important;
 }
 

Parameters:
iconStyle - the icon style

setText

public void setText(java.lang.String text)
Sets the item's text.

Parameters:
text - the text

setTextStyle

public void setTextStyle(java.lang.String textStyle)
Sets the item's text style.

Parameters:
textStyle - the text style name