qx.ui.table.model
Class Abstract

java.lang.Object
  extended by qx.core.Object
      extended by qx.core.Target
          extended by qx.ui.table.model.Abstract
All Implemented Interfaces:
ITableModel
Direct Known Subclasses:
Remote, Simple

public abstract class Abstract
extends Target
implements ITableModel

An abstract table model that performs the column handling, so subclasses only need to care for row handling.


Constructor Summary
Abstract()
           
 
Method Summary
 java.lang.Integer getColumnCount()
          Returns the number of columns in the model.
 java.lang.String getColumnId(java.lang.Integer columnIndex)
          Returns the ID of column.
 java.lang.Integer getColumnIndexById(java.lang.String columnId)
          Returns the index of a column.
 java.lang.String getColumnName(java.lang.Integer columnIndex)
          Returns the name of a column.
 java.lang.Integer getRowCount()
          Returns the number of rows in the model.
 java.lang.Object getRowData(java.lang.Integer rowIndex)
          Returns the data of one row.
 java.lang.Integer getSortColumnIndex()
          Returns the column index the model is sorted by.
 java.lang.Object getValue(java.lang.Integer columnIndex, java.lang.Integer rowIndex)
          Returns a cell value by column index.
 java.lang.Object getValueById(java.lang.String columnId, java.lang.Integer rowIndex)
          Returns a cell value by column ID.
 boolean isColumnEditable(java.lang.Integer columnIndex)
          Returns whether a column is editable.
 boolean isColumnSortable(java.lang.Integer columnIndex)
          Returns whether a column is sortable.
 boolean isSortAscending()
          Returns whether the model is sorted ascending.
 void prefetchRows(java.lang.Integer firstRowIndex, java.lang.Integer lastRowIndex)
          Prefetches some rows.
 void setColumnIds(java.lang.String columnIdArr)
          Sets the column IDs.
 void setColumnNamesById(java.lang.Object columnNameMap)
          Sets the column names.
 void setColumnNamesByIndex(java.lang.String columnNameArr)
          Sets the column names.
 void setColumns(java.lang.String columnNameArr, java.lang.String columnIdArr)
          Sets the column names (and optionally IDs)
 void setValue(java.lang.Integer columnIndex, java.lang.Integer rowIndex, java.lang.Object value)
          Sets a cell value by column index.
 java.lang.Object setValueById(java.lang.String columnId, java.lang.Integer rowIndex, java.lang.Object value)
          Sets a cell value by column ID.
 void sortByColumn(java.lang.Integer columnIndex, boolean ascending)
          Sorts the model by a column.
 
Methods inherited from class qx.core.Target
_dispatchEvent, addChangeSelectionListener, addChangeValueListener, addEventListener, addExecuteListener, addJavaEventListener, createDispatchChangeEvent, createDispatchDataEvent, createDispatchEvent, dispatchEvent, hasEventListeners, removeEventListener
 
Methods inherited from class qx.core.Object
_disposeFields, _disposeObjectDeep, _disposeObjects, base, dispose, get, getDisposed, isDisposed, reset, self, set, toHashCode, toString_
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Abstract

public Abstract()
Method Detail

getColumnCount

public java.lang.Integer getColumnCount()
Description copied from interface: ITableModel

Returns the number of columns in the model.

Specified by:
getColumnCount in interface ITableModel

getColumnId

public java.lang.String getColumnId(java.lang.Integer columnIndex)
Description copied from interface: ITableModel

Returns the ID of column. The ID may be used to identify columns independent from their index in the model. E.g. for being aware of added columns when saving the width of a column.

Specified by:
getColumnId in interface ITableModel

getColumnIndexById

public java.lang.Integer getColumnIndexById(java.lang.String columnId)
Description copied from interface: ITableModel

Returns the index of a column.

Specified by:
getColumnIndexById in interface ITableModel

getColumnName

public java.lang.String getColumnName(java.lang.Integer columnIndex)
Description copied from interface: ITableModel

Returns the name of a column. This name will be shown to the user in the table header.

Specified by:
getColumnName in interface ITableModel

getRowCount

public java.lang.Integer getRowCount()
Description copied from interface: ITableModel

Returns the number of rows in the model.

Specified by:
getRowCount in interface ITableModel

getRowData

public java.lang.Object getRowData(java.lang.Integer rowIndex)
Description copied from interface: ITableModel

Returns the data of one row. This function may be overriden by models which hold all data of a row in one object. By using this function, clients have a way of quickly retrieving the entire row data.

Important:Models which do not have their row data accessible in one object may return null.

Specified by:
getRowData in interface ITableModel

getSortColumnIndex

public java.lang.Integer getSortColumnIndex()
Description copied from interface: ITableModel

Returns the column index the model is sorted by. If the model is not sorted -1 is returned.

Specified by:
getSortColumnIndex in interface ITableModel

getValue

public java.lang.Object getValue(java.lang.Integer columnIndex,
                                 java.lang.Integer rowIndex)
Description copied from interface: ITableModel

Returns a cell value by column index.

Specified by:
getValue in interface ITableModel

getValueById

public java.lang.Object getValueById(java.lang.String columnId,
                                     java.lang.Integer rowIndex)
Description copied from interface: ITableModel

Returns a cell value by column ID.

Whenever you have the choice, use #getValue() instead, because this should be faster.

Specified by:
getValueById in interface ITableModel

isColumnEditable

public boolean isColumnEditable(java.lang.Integer columnIndex)
Description copied from interface: ITableModel

Returns whether a column is editable.

Specified by:
isColumnEditable in interface ITableModel

isColumnSortable

public boolean isColumnSortable(java.lang.Integer columnIndex)
Description copied from interface: ITableModel

Returns whether a column is sortable.

Specified by:
isColumnSortable in interface ITableModel

isSortAscending

public boolean isSortAscending()
Description copied from interface: ITableModel

Returns whether the model is sorted ascending.

Specified by:
isSortAscending in interface ITableModel

prefetchRows

public void prefetchRows(java.lang.Integer firstRowIndex,
                         java.lang.Integer lastRowIndex)
Description copied from interface: ITableModel

Prefetches some rows. This is a hint to the model that the specified rows will be read soon.

Specified by:
prefetchRows in interface ITableModel

setColumnIds

public void setColumnIds(java.lang.String columnIdArr)

Sets the column IDs. These IDs may be used internally to identify a column.

Note: This will clear previously set column names.


setColumnNamesById

public void setColumnNamesById(java.lang.Object columnNameMap)

Sets the column names. These names will be shown to the user.

Note: The column IDs have to be defined before.


setColumnNamesByIndex

public void setColumnNamesByIndex(java.lang.String columnNameArr)

Sets the column names. These names will be shown to the user.

Note: The column IDs have to be defined before.


setColumns

public void setColumns(java.lang.String columnNameArr,
                       java.lang.String columnIdArr)

Sets the column names (and optionally IDs)

Note: You can not change the number of columns this way. The number of columns is highly intertwined in the entire table operation, and dynamically changing it would require as much work as just recreating your table. If you must change the number of columns in a table then you should remove the table and add a new one.


setValue

public void setValue(java.lang.Integer columnIndex,
                     java.lang.Integer rowIndex,
                     java.lang.Object value)
Description copied from interface: ITableModel

Sets a cell value by column index.

Specified by:
setValue in interface ITableModel

setValueById

public java.lang.Object setValueById(java.lang.String columnId,
                                     java.lang.Integer rowIndex,
                                     java.lang.Object value)
Description copied from interface: ITableModel

Sets a cell value by column ID.

Whenever you have the choice, use #setValue() instead, because this should be faster.

Specified by:
setValueById in interface ITableModel

sortByColumn

public void sortByColumn(java.lang.Integer columnIndex,
                         boolean ascending)
Description copied from interface: ITableModel

Sorts the model by a column.

Specified by:
sortByColumn in interface ITableModel


Copyright © 2008 1&1. All Rights Reserved.