qx.ui.table.model
Class Simple

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

public class Simple
extends Abstract

A simple table model that provides an API for changing the model data.


Constructor Summary
Simple()
           
 
Method Summary
 void _clearSorting()
          Clears the sorting.
 java.lang.Object _mapArray2RowArr(java.lang.Object mapArr, boolean rememberMaps)
          Creates an array of maps to an array of arrays.
 void addRows(java.lang.Object rowArr, java.lang.Integer startIndex)
          Adds some rows to the model.
 void addRowsAsMapArray(java.lang.Object mapArr, java.lang.Integer startIndex, boolean rememberMaps)
          Adds some rows to the model.
 boolean getCaseSensitiveSorting()
          Returns the (computed) value of the property caseSensitiveSorting.
 java.lang.Object getData()
          Returns the data of this model.
 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.Object getRowDataAsMap(java.lang.Integer rowIndex)
          Returns the data of one row as map containing the column IDs as key and the cell values as value.
 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.
 void initCaseSensitiveSorting(boolean arg)
          Calls the apply method and dispatches the change event of the property caseSensitiveSorting with the default value defined by the class developer.
 boolean isCaseSensitiveSorting()
          Check whether the (computed) value of the boolean property caseSensitiveSorting equals true.
 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 removeRows(java.lang.Integer startIndex, java.lang.Integer howMany)
          Removes some rows from the model.
 void resetCaseSensitiveSorting()
          Resets the user value of the property caseSensitiveSorting.
 void setCaseSensitiveSorting(boolean arg)
          Sets the user value of the property caseSensitiveSorting.
 void setColumnEditable(java.lang.Integer columnIndex, boolean editable)
          Sets whether a column is editable.
 void setColumnSortable(java.lang.Integer columnIndex, boolean sortable)
          Sets whether a column is sortable.
 void setData(java.lang.Object rowArr, boolean clearSorting)
          Sets the whole data in a bulk.
 void setDataAsMapArray(java.lang.Object mapArr, boolean rememberMaps, boolean clearSorting)
          Sets the whole data in a bulk.
 void setEditable(boolean editable)
          Sets all columns editable or not editable.
 void setSortMethods(java.lang.Integer columnIndex, java.lang.Object methods)
          Specify the methods to use for ascending and descending sorts of a particular column.
 void setValue(java.lang.Integer columnIndex, java.lang.Integer rowIndex, java.lang.Object value)
          Sets a cell value by column index.
 void sortByColumn(java.lang.Integer columnIndex, boolean ascending)
          Sorts the model by a column.
 boolean toggleCaseSensitiveSorting()
          Toggles the (computed) value of the boolean property caseSensitiveSorting.
 
Methods inherited from class qx.ui.table.model.Abstract
getColumnCount, getColumnId, getColumnIndexById, getColumnName, getValueById, prefetchRows, setColumnIds, setColumnNamesById, setColumnNamesByIndex, setColumns, setValueById
 
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

Simple

public Simple()
Method Detail

_clearSorting

public void _clearSorting()

Clears the sorting.


_mapArray2RowArr

public java.lang.Object _mapArray2RowArr(java.lang.Object mapArr,
                                         boolean rememberMaps)

Creates an array of maps to an array of arrays.


addRows

public void addRows(java.lang.Object rowArr,
                    java.lang.Integer startIndex)

Adds some rows to the model.

Warning: The given array will be altered!


addRowsAsMapArray

public void addRowsAsMapArray(java.lang.Object mapArr,
                              java.lang.Integer startIndex,
                              boolean rememberMaps)

Adds some rows to the model.

Warning: The given array (mapArr) will be altered!


getCaseSensitiveSorting

public boolean getCaseSensitiveSorting()

Returns the (computed) value of the property caseSensitiveSorting.

For further details take a look at the property definition: caseSensitiveSorting.


getData

public java.lang.Object getData()

Returns the data of this model.

Warning: Do not alter this array! If you want to change the data use setData(java.lang.Object, boolean), setDataAsMapArray(java.lang.Object, boolean, boolean) or setValue(java.lang.Integer, java.lang.Integer, java.lang.Object) instead.


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
Overrides:
getRowCount in class Abstract

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
Overrides:
getRowData in class Abstract

getRowDataAsMap

public java.lang.Object getRowDataAsMap(java.lang.Integer rowIndex)

Returns the data of one row as map containing the column IDs as key and the cell values as value.


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
Overrides:
getSortColumnIndex in class Abstract

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
Overrides:
getValue in class Abstract

initCaseSensitiveSorting

public void initCaseSensitiveSorting(boolean arg)

Calls the apply method and dispatches the change event of the property caseSensitiveSorting with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: caseSensitiveSorting.


isCaseSensitiveSorting

public boolean isCaseSensitiveSorting()

Check whether the (computed) value of the boolean property caseSensitiveSorting equals true.

For further details take a look at the property definition: caseSensitiveSorting.


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
Overrides:
isColumnEditable in class Abstract

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
Overrides:
isColumnSortable in class Abstract

isSortAscending

public boolean isSortAscending()
Description copied from interface: ITableModel

Returns whether the model is sorted ascending.

Specified by:
isSortAscending in interface ITableModel
Overrides:
isSortAscending in class Abstract

removeRows

public void removeRows(java.lang.Integer startIndex,
                       java.lang.Integer howMany)

Removes some rows from the model.


resetCaseSensitiveSorting

public void resetCaseSensitiveSorting()

Resets the user value of the property caseSensitiveSorting.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: caseSensitiveSorting.


setCaseSensitiveSorting

public void setCaseSensitiveSorting(boolean arg)

Sets the user value of the property caseSensitiveSorting.

For further details take a look at the property definition: caseSensitiveSorting.


setColumnEditable

public void setColumnEditable(java.lang.Integer columnIndex,
                              boolean editable)

Sets whether a column is editable.


setColumnSortable

public void setColumnSortable(java.lang.Integer columnIndex,
                              boolean sortable)

Sets whether a column is sortable.


setData

public void setData(java.lang.Object rowArr,
                    boolean clearSorting)

Sets the whole data in a bulk.


setDataAsMapArray

public void setDataAsMapArray(java.lang.Object mapArr,
                              boolean rememberMaps,
                              boolean clearSorting)

Sets the whole data in a bulk.


setEditable

public void setEditable(boolean editable)

Sets all columns editable or not editable.


setSortMethods

public void setSortMethods(java.lang.Integer columnIndex,
                           java.lang.Object methods)

Specify the methods to use for ascending and descending sorts of a particular column.


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
Overrides:
setValue in class Abstract

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
Overrides:
sortByColumn in class Abstract

toggleCaseSensitiveSorting

public boolean toggleCaseSensitiveSorting()

Toggles the (computed) value of the boolean property caseSensitiveSorting.

For further details take a look at the property definition: caseSensitiveSorting.



Copyright © 2008 1&1. All Rights Reserved.