|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.extjs.gxt.ui.client.widget.Component
com.extjs.gxt.ui.client.widget.BoxComponent
com.extjs.gxt.ui.client.widget.ListView<M>
public class ListView<M extends ModelData>
A mechanism for displaying data using custom layout templates. ListView uses
an XTemplate
as its internal templating mechanism.
setItemSelector(String)
must
be provided for the ListView to determine what nodes it will be working
with.
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 | |
---|---|
protected int |
rowSelectorDepth
|
protected ListStore<M> |
store
|
Fields inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
---|
adjustSize, cacheSizes, ensureVisibilityOnSizing, height, lastSize, layer, shim, width |
Fields inherited from class com.extjs.gxt.ui.client.widget.Component |
---|
afterRender, attachables, baseStyle, disabled, disabledStyle, disableTextSelection, dummy, focusable, hidden, mask, maskMessage, maskMessageStyleName, monitorWindowResize, rendered, resizeHandler, setElementRender, stateId, swallowEvents, toolTip, windowResizeDelay, windowResizeTask |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
ListView()
Creates a new view. |
|
ListView(ListStore<M> store)
Creates a new view. |
|
ListView(ListStore<M> store,
XTemplate template)
Creates a new template list. |
Method Summary | |
---|---|
protected void |
afterRender()
Called after the component has been rendered and is attached for the first time. |
protected java.util.List<M> |
collectData(java.util.List<M> models,
int startIndex)
|
protected ComponentEvent |
createComponentEvent(com.google.gwt.user.client.Event event)
|
com.google.gwt.user.client.Element |
findElement(com.google.gwt.user.client.Element element)
Returns the matching element. |
int |
findElementIndex(com.google.gwt.user.client.Element element)
Returns the element's index. |
protected void |
focusItem(int index)
|
java.lang.String |
getDisplayProperty()
Returns the display property. |
com.google.gwt.user.client.Element |
getElement(int index)
Returns the element at the given index. |
java.util.List<com.google.gwt.user.client.Element> |
getElements()
Returns all of the child elements. |
int |
getItemCount()
Returns the number of models in the view. |
java.lang.String |
getItemSelector()
Returns the item selector. |
java.lang.String |
getLoadingText()
Returns the view's loading text. |
ModelProcessor<M> |
getModelProcessor()
Returns the model processor. |
java.lang.String |
getOverStyle()
Returns the over style. |
QuickTip |
getQuickTip()
Returns the view's quick tip instance. |
ListViewSelectionModel<M> |
getSelectionModel()
Returns the view's selection model. |
boolean |
getSelectOnOver()
Returns true if select on hover is enabled. |
java.lang.String |
getSelectStyle()
Returns the select style. |
ListStore<M> |
getStore()
Returns the combo's store. |
XTemplate |
getTemplate()
Returns the list's template. |
int |
indexOf(com.google.gwt.user.client.Element element)
Returns the index of the element. |
protected void |
initComponent()
|
boolean |
isEnableQuickTips()
Returns true if quicktips are enabled. |
void |
moveSelectedDown()
Moves the current selections down one level. |
void |
moveSelectedUp()
Moves the current selections up one level. |
protected void |
onAdd(java.util.List<M> models,
int index)
|
protected void |
onBeforeLoad()
|
protected void |
onClick(ListViewEvent<M> e)
|
void |
onComponentEvent(ComponentEvent ce)
Any events a component receives will be forwarded to this method. |
protected void |
onDoubleClick(ListViewEvent<M> e)
|
protected void |
onFocus(ComponentEvent ce)
|
protected void |
onHighlightRow(int index,
boolean highLight)
|
protected void |
onMouseDown(ListViewEvent<M> e)
|
protected void |
onMouseOut(ListViewEvent<M> ce)
|
protected void |
onMouseOver(ListViewEvent<M> ce)
|
protected void |
onRemove(M data,
int index)
|
protected void |
onRender(com.google.gwt.user.client.Element target,
int index)
Subclasses must override and ensure setElement is called for lazy rendered components. |
protected void |
onSelectChange(M model,
boolean select)
|
protected void |
onUpdate(M model,
int index)
|
protected M |
prepareData(M model)
|
void |
refresh()
Refreshes the view by reloading the data from the store and re-rendering the template. |
void |
refreshNode(int index)
Refreshes an individual node's data from the store. |
void |
setDisplayProperty(java.lang.String displayProperty)
Sets the display property. |
void |
setEnableQuickTips(boolean enableQuickTip)
True to enable quicktips (defaults to true, pre-render). |
void |
setItemSelector(java.lang.String itemSelector)
This is a required setting. |
void |
setLoadingText(java.lang.String loadingText)
Sets the text loading text to be displayed during a load request. |
void |
setModelProcessor(ModelProcessor<M> modelProcessor)
Sets the view's model processor. |
void |
setOverStyle(java.lang.String overStyle)
Sets the style name to apply on mouse over. |
void |
setSelectionModel(ListViewSelectionModel<M> sm)
Sets the selection model. |
void |
setSelectOnOver(boolean selectOnHover)
True to select the item when mousing over a element (defaults to false). |
void |
setSelectStyle(java.lang.String selectStyle)
The style to be applied to each selected item (defaults to 'x-view-item-sel'). |
void |
setSimpleTemplate(java.lang.String html)
Sets the template fragment to be used for the text of each listview item. |
void |
setStore(ListStore<M> store)
Changes the data store bound to this view and refreshes it. |
void |
setTemplate(java.lang.String html)
Sets the view's template. |
void |
setTemplate(XTemplate template)
Sets the view's template. |
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
---|
adjustPosition, adjustSize, getBounds, getHeight, getHeight, getPosition, getPositionEl, getResizeEl, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, hideShadow, hideShim, hideUnders, isAutoHeight, isAutoWidth, isDeferHeight, isShim, onHide, onPosition, onResize, onShow, onUnload, 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.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, setLayoutData |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int rowSelectorDepth
protected ListStore<M extends ModelData> store
Constructor Detail |
---|
public ListView()
public ListView(ListStore<M> store)
public ListView(ListStore<M> store, XTemplate template)
template
- the templateMethod Detail |
---|
public com.google.gwt.user.client.Element findElement(com.google.gwt.user.client.Element element)
element
- the element or any child element
public int findElementIndex(com.google.gwt.user.client.Element element)
element
- the element or any child element
public java.lang.String getDisplayProperty()
public com.google.gwt.user.client.Element getElement(int index)
index
- the index
public java.util.List<com.google.gwt.user.client.Element> getElements()
public int getItemCount()
public java.lang.String getItemSelector()
public java.lang.String getLoadingText()
public ModelProcessor<M> getModelProcessor()
public java.lang.String getOverStyle()
public QuickTip getQuickTip()
public ListViewSelectionModel<M> getSelectionModel()
public boolean getSelectOnOver()
public java.lang.String getSelectStyle()
public ListStore<M> getStore()
public XTemplate getTemplate()
public int indexOf(com.google.gwt.user.client.Element element)
element
- the element
public boolean isEnableQuickTips()
public void moveSelectedDown()
public void moveSelectedUp()
public void onComponentEvent(ComponentEvent ce)
Component
Component.onBrowserEvent(com.google.gwt.user.client.Event)
method
should not be overridden or modified.
onComponentEvent
in class Component
ce
- the base eventpublic void refresh()
public void refreshNode(int index)
index
- the items data index in the storepublic void setDisplayProperty(java.lang.String displayProperty)
displayProperty
- the display propertypublic void setEnableQuickTips(boolean enableQuickTip)
enableQuickTip
- true to enable quicktipspublic void setItemSelector(java.lang.String itemSelector)
itemSelector
- the item selectorpublic void setLoadingText(java.lang.String loadingText)
loadingText
- the loading textpublic void setModelProcessor(ModelProcessor<M> modelProcessor)
modelProcessor
- ModelProcessor
public void setOverStyle(java.lang.String overStyle)
overStyle
- the over stylepublic void setSelectionModel(ListViewSelectionModel<M> sm)
sm
- the selection modelpublic void setSelectOnOver(boolean selectOnHover)
selectOnHover
- true to select on mouse overpublic void setSelectStyle(java.lang.String selectStyle)
selectStyle
- the select stylepublic void setSimpleTemplate(java.lang.String html)
<code> listview.setSimpleTemplate("{abbr} {name}"); </code>
html
- the html used only for the text of each item in the listpublic void setStore(ListStore<M> store)
store
- the store to bind this viewpublic void setTemplate(java.lang.String html)
html
- the HTML fragmentpublic void setTemplate(XTemplate template)
template
- the templateprotected void afterRender()
Component
afterRender
in class BoxComponent
protected java.util.List<M> collectData(java.util.List<M> models, int startIndex)
protected ComponentEvent createComponentEvent(com.google.gwt.user.client.Event event)
createComponentEvent
in class BoxComponent
protected void focusItem(int index)
protected void initComponent()
protected void onAdd(java.util.List<M> models, int index)
protected void onBeforeLoad()
protected void onClick(ListViewEvent<M> e)
protected void onDoubleClick(ListViewEvent<M> e)
protected void onFocus(ComponentEvent ce)
protected void onHighlightRow(int index, boolean highLight)
protected void onMouseDown(ListViewEvent<M> e)
protected void onMouseOut(ListViewEvent<M> ce)
protected void onMouseOver(ListViewEvent<M> ce)
protected void onRemove(M data, int index)
protected void onRender(com.google.gwt.user.client.Element target, int index)
Component
onRender
in class Component
target
- the target elementindex
- the insert locationprotected void onSelectChange(M model, boolean select)
protected void onUpdate(M model, int index)
protected M prepareData(M model)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |