org.olat.core.gui.components.table
Class Table

java.lang.Object
  extended by org.olat.core.gui.components.Component
      extended by org.olat.core.gui.components.table.Table
All Implemented Interfaces:
java.util.Comparator

public class Table
extends Component
implements java.util.Comparator

Description:
a table. 1.) set column descriptors 2.) generate a tabledatamodel with valid datas 3.) do table.setTableDataModel(tdm); this inits and sorts the table

Author:
Felix Jost

Field Summary
static java.lang.String COMMAND_MULTISELECT
          TableMultiSelectEvent command identifier.
static java.lang.String COMMANDLINK_ROWACTION_CLICKED
          Table row selection.
 
Method Summary
 int compare(java.lang.Object a, java.lang.Object b)
           
 void enableShowAllLink(boolean enableShowAllLinkValue)
           
 TableDataModel getFilteredTableDataModel()
           
 ComponentRenderer getHTMLRendererSingleton()
           
 java.lang.String getSearchString()
           
 int getSortedRow(int originalRow)
          serves a purpose: it maps from the rowid in the gui (first row = 0, second = 1 and so on) to the corresponding row in the tabledatamodel getSortedRow(guirow) is used by the columnDescriptors: public String getRenderValue(int row)..
 TableDataModel getTableDataModel()
           
 int getUnfilteredRowCount()
           
 TableDataModel getUnfilteredTableDataModel()
           
 boolean isShowAllLinkEnabled()
           
 boolean isShowAllSelected()
           
 boolean isSortableColumnIn(java.util.List selRows)
           
 boolean isSortAscending()
          * used by renderer only
 boolean isSortingEnabled()
           
 boolean isTableFiltered()
           
 void setSearchString(java.lang.String tableSearchString)
           
 void setShowAllSelected(boolean isShowAllSelected)
           
 void validate(UserRequest ureq, ValidationResult vr)
          called just before the rendering of the -whole tree- takes place, so e.g.
 
Methods inherited from class org.olat.core.gui.components.Component
addListener, debuginfoGetListeners, dispatchRequest, getAndClearLatestFiredEvent, getComponentName, getDispatchID, getExtendedDebugInfo, getLatestDispatchedController, getListenerInfo, getParent, getSpanAsDomReplaceable, getTimestamp, getTranslator, isDirty, isDirtyForUser, isDomReplaceable, isEnabled, isVisible, setDirty, setDomReplaceable, setEnabled, setSpanAsDomReplaceable, setVisible, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

COMMAND_MULTISELECT

public static final java.lang.String COMMAND_MULTISELECT
TableMultiSelectEvent command identifier.

See Also:
Constant Field Values

COMMANDLINK_ROWACTION_CLICKED

public static final java.lang.String COMMANDLINK_ROWACTION_CLICKED
Table row selection.

See Also:
Constant Field Values
Method Detail

getSortedRow

public int getSortedRow(int originalRow)
serves a purpose: it maps from the rowid in the gui (first row = 0, second = 1 and so on) to the corresponding row in the tabledatamodel getSortedRow(guirow) is used by the columnDescriptors: public String getRenderValue(int row).. to determine the row in the model they have to return and the tablerenderer

Parameters:
originalRow -
Returns:
integer representing the row id after sorting

getTableDataModel

public TableDataModel getTableDataModel()
Returns:
TableDataModel

getUnfilteredTableDataModel

public TableDataModel getUnfilteredTableDataModel()
Returns:
filtered TableDataModel

getFilteredTableDataModel

public TableDataModel getFilteredTableDataModel()
Returns:
filtered TableDataModel

compare

public int compare(java.lang.Object a,
                   java.lang.Object b)
Specified by:
compare in interface java.util.Comparator
See Also:
Comparator.compare(java.lang.Object, java.lang.Object)

isSortAscending

public boolean isSortAscending()
* used by renderer only

Returns:
boolean

isSortingEnabled

public boolean isSortingEnabled()
Returns:
true when data can be and should be sorted, false for data that is not sortable

isSortableColumnIn

public boolean isSortableColumnIn(java.util.List selRows)
Parameters:
selRows -
Returns:
true if there is at least one sortable row in the list of all columndescriptors (both visible and invisible)

getHTMLRendererSingleton

public ComponentRenderer getHTMLRendererSingleton()
Specified by:
getHTMLRendererSingleton in class Component

validate

public void validate(UserRequest ureq,
                     ValidationResult vr)
Description copied from class: Component
called just before the rendering of the -whole tree- takes place, so e.g. lazy fetching can be implemented, or issueing a request for a new moduleUri (e.g. for CPComponent, so that the browser loads images correctly). only called when the component is visible

Overrides:
validate in class Component

isShowAllSelected

public boolean isShowAllSelected()

setShowAllSelected

public void setShowAllSelected(boolean isShowAllSelected)

enableShowAllLink

public void enableShowAllLink(boolean enableShowAllLinkValue)

isShowAllLinkEnabled

public boolean isShowAllLinkEnabled()

getUnfilteredRowCount

public int getUnfilteredRowCount()

setSearchString

public void setSearchString(java.lang.String tableSearchString)

getSearchString

public java.lang.String getSearchString()

isTableFiltered

public boolean isTableFiltered()