com.extjs.gxt.ui.client.widget
クラス 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
すべての実装インターフェース:
Observable, Selectable<DataListItem>, com.google.gwt.user.client.EventListener

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 set the doit field to false to cancel the action.
BeforeRemove : DateListEvent(dataList, item)
Fires before an item is removed. Listeners can set the doit field to false to cancel the action.
Add : DateListEvent(dataList, item, index)
Fires after an item has been added or inserted.
Remove : DateListEvent(dataList, item)
Fires after an item has been removed.
SelectionChange : DateListEvent(dataList, selected)
Fires after the selection changes.
ContextMenu : DateListEvent(dataList)
Fires before the list's context menu is shown. Listeners can set the doit field to false to cancel the action.
CheckChange : DateListEvent(dataList, item)
Fires after an item is selected.
CSS:
.my-list (the list itself)
.my-listitem (list item)
.my-listitem .my-listitem-text (list item text)


入れ子クラス 概要
 
クラス com.google.gwt.user.client.ui.UIObject から継承された入れ子クラス/インタフェース
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field 概要
static Template defaultItemTemplate
          The default template for data list items.
 
クラス com.google.gwt.user.client.ui.UIObject から継承されたフィールド(Fields)
DEBUG_ID_PREFIX
 
コンストラクタ 概要
DataList()
          Creates a new single select list.
 
メソッド 概要
 boolean add(DataListItem component)
          Creates then adds an item to the list.
 DataListItem add(java.lang.String text)
          Creates then adds an item to the list.
 java.util.List<DataListItem> getChecked()
          Returns an array of checked items.
 Menu getContextMenu()
          Returns the component's context menu.
 DataListItem getSelectedItem()
          Returns the selected item.
 java.util.List<DataListItem> getSelectedItems()
          Returns the selected items.
 Style.SelectionMode getSelectionMode()
           
 DataListSelectionModel getSelectionModel()
          Returns the list's selection model.
 boolean insert(DataListItem item, int index)
          Inserts an item into the list at the given index.
 boolean isCheckable()
          Returns true if check boxes are enabled.
 boolean isFlat()
          Returns true if the list is using the "flat" style.
 void moveSelectedDown()
          Moves the current selections down one level.
 void moveSelectedUp()
          Moves the current selections up one level.
 void onComponentEvent(ComponentEvent ce)
          Any events a component receives will be forwarded to this method.
 void onSelectChange(DataListItem item, boolean select)
          Called when the visual state of a item is changed.
 boolean remove(DataListItem item)
          Removes the item from the list.
 void scrollIntoView(DataListItem item)
          Scrolls the item into view.
 void setCheckable(boolean checkable)
          Sets whether items shoud have a check box (defaults to false, pre-render).
 void setContextMenu(Menu menu)
          Sets the component's context menu.
 void setFlatStyle(boolean flat)
          Sets whether the list should use a "flat" style without rounded corners (defaults to false, pre-render).
 void setItemTemplate(Template itemTemplate)
          Sets the optional template to be used by the data list items (pre-render).
 void setSelectedItem(DataListItem item)
          Selects the item.
 void setSelectedItems(java.util.List<DataListItem> items)
          Selects the items.
 void setSelectionMode(Style.SelectionMode mode)
          Sets the list's selection mode.
 void setSelectionModel(DataListSelectionModel sm)
          Sets the list's selection model.
 void sort(java.util.Comparator<DataListItem> comparator)
          Sorts the data list.
 
クラス com.extjs.gxt.ui.client.widget.ScrollContainer から継承されたメソッド
addScrollListener, getHScrollPosition, getScrollMode, getVScrollPosition, removeScrollListener, scrollIntoView, setHScrollPosition, setScrollMode, setVScrollPosition
 
クラス com.extjs.gxt.ui.client.widget.Container から継承されたメソッド
findItem, getItem, getItemByItemId, getItemCount, getItems, getWidget, indexOf, iterator, removeAll
 
クラス com.extjs.gxt.ui.client.widget.BoxComponent から継承されたメソッド
getBounds, getHeight, getHeight, getPosition, getShadow, getSize, getWidth, getWidth, isAutoHeight, isAutoWidth, isDeferHeight, isShim, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShim, setSize, setSize, setWidth, setWidth
 
クラス com.extjs.gxt.ui.client.widget.Component から継承されたメソッド
addListener, 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, isEnabled, isRendered, isVisible, onBrowserEvent, recalculate, removeAllListeners, removeFromParent, removeListener, removeStyleName, removeWidgetListener, render, render, saveState, setBorders, setData, setData, setElement, setEnabled, setEnableState, setId, setIntStyleAttribute, setItemId, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, show, toString
 
クラス com.google.gwt.user.client.ui.Widget から継承されたメソッド
getParent, isAttached
 
クラス com.google.gwt.user.client.ui.UIObject から継承されたメソッド
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールド 詳細

defaultItemTemplate

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

コンストラクタ 詳細

DataList

public DataList()
Creates a new single select list.

メソッド 詳細

add

public boolean add(DataListItem component)
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.

パラメータ:
component - the dataListItem to add

add

public DataListItem add(java.lang.String text)
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.

パラメータ:
text - the item's text
戻り値:
the newly created item, or null if the add was cancelled

getChecked

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

戻り値:
the checked items

getContextMenu

public Menu getContextMenu()
Description copied from class: Component
Returns the component's context menu. This method is marked protected, subclasses can change access to public to expose the contenxt menu.

戻り値:
the context menu

getSelectedItem

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

Specified by:
getSelectedItem in interface Selectable<DataListItem>
戻り値:
the selected item

getSelectedItems

public java.util.List<DataListItem> getSelectedItems()
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>
戻り値:
the selected items

getSelectionMode

public Style.SelectionMode getSelectionMode()

getSelectionModel

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

戻り値:
the selection model

insert

public boolean insert(DataListItem item,
                      int index)
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.

パラメータ:
item - the item
index - the insert location

isCheckable

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

戻り値:
the check box state

isFlat

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

戻り値:
the flat state

moveSelectedDown

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


moveSelectedUp

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


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.

オーバーライド:
onComponentEvent in class ScrollContainer<DataListItem>
パラメータ:
ce - the base event

onSelectChange

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

Specified by:
onSelectChange in interface Selectable<DataListItem>
パラメータ:
item - the item
select - the select state

remove

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

パラメータ:
item - the item to be removed
戻り値:
true if the item was removed

scrollIntoView

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

オーバーライド:
scrollIntoView in class Container<DataListItem>
パラメータ:
item - the item

setCheckable

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

パラメータ:
checkable - true to enable checbox

setContextMenu

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

パラメータ:
menu - the context menu

setFlatStyle

public void setFlatStyle(boolean flat)
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.

パラメータ:
flat - the flat state

setItemTemplate

public void setItemTemplate(Template itemTemplate)
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.

パラメータ:
itemTemplate - the template

setSelectedItem

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

Specified by:
setSelectedItem in interface Selectable<DataListItem>
パラメータ:
item - the item to select

setSelectedItems

public void setSelectedItems(java.util.List<DataListItem> items)
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>
パラメータ:
items - the items to select

setSelectionMode

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

パラメータ:
mode - the selection mode

setSelectionModel

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

パラメータ:
sm - the selection model

sort

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

パラメータ:
comparator - the comparator