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

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.BoxComponent
                  extended by com.extjs.gxt.ui.client.widget.Container<T>
                      extended by com.extjs.gxt.ui.client.widget.ScrollContainer<DataListItem>
                          extended by com.extjs.gxt.ui.client.widget.DataList
All Implemented Interfaces:
Observable, Selectable<DataListItem>, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener

Deprecated. see ListView

public class DataList
extends ScrollContainer<DataListItem>
implements Selectable<DataListItem>

Displays a list of list items.

Events:
BeforeAdd : DateListEvent(dataList, item, index)
Fires before an item is added or inserted. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
BeforeRemove : DateListEvent(dataList, item, index)
Fires before an item is removed. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
Add : DateListEvent(dataList, item, index)
Fires after an item has been added or inserted.
Remove : DateListEvent(dataList, item, index)
Fires after an item has been removed.
BeforeSelect : DateListEvent(dataList, item)
Fires before a item is selected. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
SelectionChange : DateListEvent(dataList, selected)
Fires after the selection changes.
ContextMenu : DateListEvent(dataList)
Fires before the list's context menu is shown. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
CheckChange : DateListEvent(dataList, item)
Fires after an item is selected.
Inherited Events:
ScrollContainer Scroll
Container BeforeAdd
Container Add
Container BeforeRemove
Container Remove
BoxComponent Move
BoxComponent Resize
Component Enable
Component Disable
Component BeforeHide
Component Hide
Component BeforeShow
Component Show
Component Attach
Component Detach
Component BeforeRender
Component Render
Component BrowserEvent
Component BeforeStateRestore
Component StateRestore
Component BeforeStateSave
Component SaveState
CSS:
.my-list (the list itself)
.my-listitem (list item)
.my-listitem .my-listitem-text (list item text)


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
static Template defaultItemTemplate
          Deprecated. The default template for data list items.
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
DataList()
          Deprecated. Creates a new single select list.
 
Method Summary
 boolean add(DataListItem component)
          Deprecated. Creates then adds an item to the list.
 DataListItem add(java.lang.String text)
          Deprecated. Creates then adds an item to the list.
 java.util.List<DataListItem> getChecked()
          Deprecated. Returns an array of checked items.
 Menu getContextMenu()
          Deprecated. Returns the component's context menu.
 El getLayoutTarget()
          Deprecated. Returns the container's layout target.
 DataListItem getSelectedItem()
          Deprecated. Returns the selected item.
 java.util.List<DataListItem> getSelectedItems()
          Deprecated. Returns the selected items.
 Style.SelectionMode getSelectionMode()
          Deprecated.  
 DataListSelectionModel getSelectionModel()
          Deprecated. Returns the list's selection model.
 boolean insert(DataListItem item, int index)
          Deprecated. Inserts an item into the list at the given index.
 boolean isCheckable()
          Deprecated. Returns true if check boxes are enabled.
 boolean isFlat()
          Deprecated. Returns true if the list is using the "flat" style.
 boolean isTrackMouseOver()
          Deprecated. Returns true if rows are highlighted on mouse over.
 void moveSelectedDown()
          Deprecated. Moves the current selections down one level.
 void moveSelectedUp()
          Deprecated. Moves the current selections up one level.
 void onComponentEvent(ComponentEvent ce)
          Deprecated. Any events a component receives will be forwarded to this method.
 void onSelectChange(DataListItem item, boolean select)
          Deprecated. Called when the visual state of a item is changed.
 boolean remove(DataListItem item)
          Deprecated. Removes the item from the list.
 boolean remove(DataListItem item, boolean force)
          Deprecated. Removes the item from the list.
 void scrollIntoView(DataListItem item)
          Deprecated. Scrolls the item into view.
 void setCheckable(boolean checkable)
          Deprecated. Sets whether items shoud have a check box (defaults to false, pre-render).
 void setContextMenu(Menu menu)
          Deprecated. Sets the component's context menu.
 void setFlatStyle(boolean flat)
          Deprecated. Sets whether the list should use a "flat" style without rounded corners (defaults to false, pre-render).
 void setItemTemplate(Template itemTemplate)
          Deprecated. Sets the optional template to be used by the data list items (pre-render).
 void setSelectedItem(DataListItem item)
          Deprecated. Selects the item.
 void setSelectedItems(java.util.List<DataListItem> items)
          Deprecated. Selects the items.
 void setSelectionMode(Style.SelectionMode mode)
          Deprecated. Sets the list's selection mode.
 void setSelectionModel(DataListSelectionModel sm)
          Deprecated. Sets the list's selection model.
 void setTrackMouseOver(boolean trackMouseOver)
          Deprecated. True to highlight items when the mouse is over (defaults to true).
 void sort(java.util.Comparator<DataListItem> comparator)
          Deprecated. Sorts the data list.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.ScrollContainer
addScrollListener, getHScrollPosition, getScrollMode, getVScrollPosition, removeScrollListener, scrollIntoView, setHScrollPosition, setScrollMode, setVScrollPosition
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Container
disable, enable, findItem, getItem, getItemByItemId, getItemCount, getItems, getWidget, indexOf, iterator, removeAll
 
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
getBounds, getHeight, getHeight, getPosition, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, isAutoHeight, isAutoWidth, isDeferHeight, isShim, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addListener, addPlugin, addStyleName, addWidgetListener, clearState, disableEvents, disableTextSelection, el, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, getBaseStyle, getBorders, getData, getElement, getHideMode, getId, getItemId, getListeners, getModel, getState, getStateId, getToolTip, hasListeners, hasListeners, hide, hideToolTip, isDisabledEvents, isEnabled, isRendered, isStateful, isVisible, mask, mask, mask, onBrowserEvent, recalculate, removeAllListeners, removeFromParent, removeListener, removeStyleName, removeSwallow, removeToolTip, removeWidgetListener, render, render, repaint, saveState, setBorders, setData, setElement, setEnabled, setHideMode, setId, setIntStyleAttribute, setItemId, setStateful, setStateId, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, setZIndex, show, sinkEvents, swallowEvent, swallowEvent, toString, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
fireEvent, 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
 

Field Detail

defaultItemTemplate

public static Template defaultItemTemplate
Deprecated. 
The default template for data list items.

Constructor Detail

DataList

public DataList()
Deprecated. 
Creates a new single select list.

Method Detail

add

public boolean add(DataListItem component)
Deprecated. 
Creates then adds an item to the list. Fires the BeforeAdd event before inserting, then fires the Add event after the widget has been inserted.

Parameters:
component - the dataListItem to add

add

public DataListItem add(java.lang.String text)
Deprecated. 
Creates then adds an item to the list. Fires the BeforeAdd event before inserting, then fires the Add event after the widget has been inserted.

Parameters:
text - the item's text
Returns:
the newly created item, or null if the add was cancelled

getChecked

public java.util.List<DataListItem> getChecked()
Deprecated. 
Returns an array of checked items.

Returns:
the checked items

getContextMenu

public Menu getContextMenu()
Deprecated. 
Description copied from class: Component
Returns the component's context menu.

Overrides:
getContextMenu in class Component
Returns:
the context menu

getLayoutTarget

public El getLayoutTarget()
Deprecated. 
Description copied from class: Container
Returns the container's layout target. Only applies to container's with layouts.

Overrides:
getLayoutTarget in class Container<DataListItem>
Returns:
the layout target

getSelectedItem

public DataListItem getSelectedItem()
Deprecated. 
Description copied from interface: Selectable
Returns the selected item.

Specified by:
getSelectedItem in interface Selectable<DataListItem>
Returns:
the selected item

getSelectedItems

public java.util.List<DataListItem> getSelectedItems()
Deprecated. 
Description copied from interface: Selectable
Returns the selected items. For single-select, the last selected item is returned.

Specified by:
getSelectedItems in interface Selectable<DataListItem>
Returns:
the selected items

getSelectionMode

public Style.SelectionMode getSelectionMode()
Deprecated. 

getSelectionModel

public DataListSelectionModel getSelectionModel()
Deprecated. 
Returns the list's selection model.

Returns:
the selection model

insert

public boolean insert(DataListItem item,
                      int index)
Deprecated. 
Inserts an item into the list at the given index. Fires the BeforeAdd event before inserting, then fires the Add event after the widget has been inserted.

Parameters:
item - the item
index - the insert location

isCheckable

public boolean isCheckable()
Deprecated. 
Returns true if check boxes are enabled.

Returns:
the check box state

isFlat

public boolean isFlat()
Deprecated. 
Returns true if the list is using the "flat" style.

Returns:
the flat state

isTrackMouseOver

public boolean isTrackMouseOver()
Deprecated. 
Returns true if rows are highlighted on mouse over.

Returns:
the track mouse state

moveSelectedDown

public void moveSelectedDown()
Deprecated. 
Moves the current selections down one level.


moveSelectedUp

public void moveSelectedUp()
Deprecated. 
Moves the current selections up one level.


onComponentEvent

public void onComponentEvent(ComponentEvent ce)
Deprecated. 
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 ScrollContainer<DataListItem>
Parameters:
ce - the base event

onSelectChange

public void onSelectChange(DataListItem item,
                           boolean select)
Deprecated. 
Description copied from interface: Selectable
Called when the visual state of a item is changed.

Specified by:
onSelectChange in interface Selectable<DataListItem>
Parameters:
item - the item
select - the select state

remove

public boolean remove(DataListItem item)
Deprecated. 
Removes the item from the list.

Parameters:
item - the item to be removed
Returns:
true if the item was removed

remove

public boolean remove(DataListItem item,
                      boolean force)
Deprecated. 
Removes the item from the list.

Parameters:
item - the item to be removed
force - true to force
Returns:
true if the item was removed

scrollIntoView

public void scrollIntoView(DataListItem item)
Deprecated. 
Scrolls the item into view.

Overrides:
scrollIntoView in class Container<DataListItem>
Parameters:
item - the item

setCheckable

public void setCheckable(boolean checkable)
Deprecated. 
Sets whether items shoud have a check box (defaults to false, pre-render).

Parameters:
checkable - true to enable checbox

setContextMenu

public void setContextMenu(Menu menu)
Deprecated. 
Description copied from class: Component
Sets the component's context menu.

Overrides:
setContextMenu in class Component
Parameters:
menu - the context menu

setFlatStyle

public void setFlatStyle(boolean flat)
Deprecated. 
Sets whether the list should use a "flat" style without rounded corners (defaults to false, pre-render). The flat style supports variable height list items.

Parameters:
flat - the flat state

setItemTemplate

public void setItemTemplate(Template itemTemplate)
Deprecated. 
Sets the optional template to be used by the data list items (pre-render). The custom template will be rendered with the following parameters: id, style, iconStyle, text.

Parameters:
itemTemplate - the template

setSelectedItem

public void setSelectedItem(DataListItem item)
Deprecated. 
Description copied from interface: Selectable
Selects the item. Any existing selections are cleared.

Specified by:
setSelectedItem in interface Selectable<DataListItem>
Parameters:
item - the item to select

setSelectedItems

public void setSelectedItems(java.util.List<DataListItem> items)
Deprecated. 
Description copied from interface: Selectable
Selects the items. Only the first item is selected for single-select. Any existing selections are cleared.

Specified by:
setSelectedItems in interface Selectable<DataListItem>
Parameters:
items - the items to select

setSelectionMode

public void setSelectionMode(Style.SelectionMode mode)
Deprecated. 
Sets the list's selection mode.

Parameters:
mode - the selection mode

setSelectionModel

public void setSelectionModel(DataListSelectionModel sm)
Deprecated. 
Sets the list's selection model.

Parameters:
sm - the selection model

setTrackMouseOver

public void setTrackMouseOver(boolean trackMouseOver)
Deprecated. 
True to highlight items when the mouse is over (defaults to true).

Parameters:
trackMouseOver - true to highlight items on mouse over

sort

public void sort(java.util.Comparator<DataListItem> comparator)
Deprecated. 
Sorts the data list.

Parameters:
comparator - the comparator