com.atlassian.gwt.client
Class DataTable<T>

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by com.atlassian.gwt.client.DataTable<T>
All Implemented Interfaces:
HasAction, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener

public class DataTable<T>
extends com.google.gwt.user.client.ui.Composite
implements HasAction


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
DataTable(java.lang.String id, DataSource<T> dataSource)
           
 
Method Summary
 void addColumnConfig(ColumnConfig<T> config)
          Adds a column configuration for the data table.
 void addHeader()
          Adds the header row for the data table based on the column configurations added to the table.
 void addRow(T obj, boolean selectRow)
          Adds a row to end of the table with the given object.
 void clearRows()
          Clears the table data rows.
 void fetchAndDisplay()
          Fetches the data using the configured datasource and displays the data in the table body based on the column configurations.
 java.util.List<T> getData()
           
 java.lang.String getId()
           
 void setAction(Action action)
           
 void setDataSource(DataSource<T> dataSource)
           
 void setDataSourceCallback(DataSourceCallback<T> delegateCallback)
          Sets the data source callback function that will be excuted when DataSource.fetchData(DataSourceCallback) is called.
 void setHoverClassName(java.lang.String hoverClassName)
          Sets the class name which will be set on row hover.
 void setSelectedClassName(java.lang.String selectedClassName)
          Sets the class name which will be set on row select.
 void setSelectFirstRow(boolean selectFirstRow)
          If set to true, the first row will be selected automatically once the data has been loaded in the table.
 void setSelectionHandler(DataTableSelectionHandler handler)
          Sets the seleciton handler which will be invoked on row select.
 void setShowSpinner(boolean showSpinner)
           
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getWidget, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataTable

public DataTable(java.lang.String id,
                 DataSource<T> dataSource)
Method Detail

setShowSpinner

public void setShowSpinner(boolean showSpinner)

setDataSource

public void setDataSource(DataSource<T> dataSource)

setDataSourceCallback

public void setDataSourceCallback(DataSourceCallback<T> delegateCallback)
Sets the data source callback function that will be excuted when DataSource.fetchData(DataSourceCallback) is called.


setSelectFirstRow

public void setSelectFirstRow(boolean selectFirstRow)
If set to true, the first row will be selected automatically once the data has been loaded in the table.


setHoverClassName

public void setHoverClassName(java.lang.String hoverClassName)
Sets the class name which will be set on row hover.


setSelectedClassName

public void setSelectedClassName(java.lang.String selectedClassName)
Sets the class name which will be set on row select.


setSelectionHandler

public void setSelectionHandler(DataTableSelectionHandler handler)
Sets the seleciton handler which will be invoked on row select.


getId

public java.lang.String getId()

getData

public java.util.List<T> getData()

addColumnConfig

public void addColumnConfig(ColumnConfig<T> config)
Adds a column configuration for the data table.

See Also:
ColumnConfig

clearRows

public void clearRows()
Clears the table data rows.


fetchAndDisplay

public void fetchAndDisplay()
Fetches the data using the configured datasource and displays the data in the table body based on the column configurations.

See Also:
#setColumnConfigs(List)

addRow

public void addRow(T obj,
                   boolean selectRow)
Adds a row to end of the table with the given object. Objects added are also added to the data list (returned by getData(), so care must be taken to ensure added objects are of the same type. If selectRow is true, then the added row will be selected automatically.


addHeader

public void addHeader()
Adds the header row for the data table based on the column configurations added to the table.

See Also:
addColumnConfig(ColumnConfig)

setAction

public void setAction(Action action)
Specified by:
setAction in interface HasAction


Copyright © 2003-2010 Atlassian. All Rights Reserved.