Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: awt :: grid ::

interface XMutableGridDataModel
Base Interfaces
XMutableGridDataModelXGridDataModel
   ┣ ::com::sun::star::lang::XComponent
   ┗ ::com::sun::star::util::XCloneable

XGridDataModel
(referenced interface's summary:)
An instance of this interface is used by the UnoControlGrid to retrieve the content data that is displayed in the actual control. If you do not need your own model implementation, you can also use the DefaultGridDataModel.
Description
allows to modify the data represented by a XGridDataModel

Methods' Summary
addRow appends a row to the model.  
addRows appends multiple rows of data to the model.  
insertRow inserts a row into the set of data rows  
insertRows inserts multiple rows of data into the model.  
removeRow removes a row of data from the model  
removeAllRows Removes all rows from the model.  
updateCellData updates the content of the given cell  
updateRowData updates the content of a given row.  
updateRowHeading sets a new title for a given row.  
updateCellToolTip updates the tooltip to be displayed for a given cell  
updateRowToolTip updates the tooltip for all cells of a given row  
addGridDataListener registers listener to be notified of data changes in the model  
removeGridDataListener revokes a listener which was previously registered via addGridDataListener  
Methods' Details
addRow
void
addRow( [in] any  Heading,
[in] sequence< any >  Data );

Description
appends a row to the model.
Parameter Heading
denotes the heading of the row.
Parameter Data
specifies the content of the row.
addRows
void
addRows( [in] sequence< any >  Headings,
[in] sequence< sequence< any > >  Data )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
appends multiple rows of data to the model.
Parameter Headings
denotes the headings of the to-be-added rows.
Parameter Data
specifies the data of the rows to be added.
Throws
::com::sun::star::lang::IllegalArgumentException if Titles and Data are of different length.
insertRow
void
insertRow( [in] long  Index,
[in] any  Heading,
[in] sequence< any >  Data )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
inserts a row into the set of data rows
Parameter Index
denotes the position at which the row is to be inserted
Parameter Heading
denotes the heading of the row.
Parameter Data
specifies the content of the row.
Throws
::com::sun::star::lang::IndexOutOfBoundsException if Index is smaller than 0 or greater than the number of rows in the model.
insertRows
void
insertRows( [in] long  Index,
[in] sequence< any >  Headings,
[in] sequence< sequence< any > >  Data )
raises( ::com::sun::star::lang::IndexOutOfBoundsException,
::com::sun::star::lang::IllegalArgumentException );

Description
inserts multiple rows of data into the model.
Parameter Index
denotes the position at which the rows are to be inserted
Parameter Headings
denotes the headings of the to-be-added rows.
Parameter Data
specifies the data of the rows to be added.
Throws
::com::sun::star::lang::IllegalArgumentException if Titles and Data are of different length.
Throws
::com::sun::star::lang::IndexOutOfBoundsException if Index is smaller than 0 or greater than the number of rows in the model.
removeRow
void
removeRow( [in] long  RowIndex )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
removes a row of data from the model
Parameter RowIndex
the index of the row that should be removed.
Throws
::com::sun::star::lang::IndexOutOfBoundsException if the given index is invalid
removeAllRows
void
removeAllRows();

Description
Removes all rows from the model.
updateCellData
void
updateCellData( [in] long  ColumnIndex,
[in] long  RowIndex,
[in] any  Value )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
updates the content of the given cell
Parameter ColumnIndex
the column index of the to-be-updated cell
Parameter RowIndex
the row index of the to-be-updated cell
Parameter Value
the new value of the cell.
Throws
::com::sun::star::lang::IndexOutOfBoundsException if the row or column index is invalid
updateRowData
void
updateRowData( [in] sequence< long >  ColumnIndexes,
[in] long  RowIndex,
[in] sequence< any >  Values )
raises( ::com::sun::star::lang::IndexOutOfBoundsException,
::com::sun::star::lang::IllegalArgumentException );

Description
updates the content of a given row.

The change in the data model will be notified to registered listeners via >XGridDataListener::dataChanged. The GridDataEvent::FirstColumn and GridDataEvent::LastColumn will denote the smallest respectively largest column index from .

Parameter ColumnIndexes
contains the column indexes of the cells, which should be updated
Parameter RowIndex
contains the index of the row whose data is to be updated
Parameter Values
specifies the new values of the cells.
Throws
::com::sun::star::lang::IndexOutOfBoundsException if one of the row indexes or the column index is invalid
Throws
::com::sun::star::lang::IllegalArgumentException if the lengths of the ColumnIndexes and Values sequences are not equal.
updateRowHeading
void
updateRowHeading( [in] long  RowIndex,
[in] any  Heading )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
sets a new title for a given row.
Throws
::com::sun::star::lang::IndexOutOfBoundsException if the given index does not denote a valid row.
updateCellToolTip
void
updateCellToolTip( [in] long  ColumnIndex,
[in] long  RowIndex,
[in] any  Value )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
updates the tooltip to be displayed for a given cell
See also
XGridDataModel::getCellToolTip
updateRowToolTip
void
updateRowToolTip( [in] long  RowIndex,
[in] any  Value )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
updates the tooltip for all cells of a given row

Effectively this method is a shortcut for calling updateCellToolTip multiple times in a row, for all cells of a given row.

See also
XGridDataModel::getCellToolTip, updateCellToolTip
addGridDataListener
void
addGridDataListener( [in] XGridDataListener  Listener );

Description
registers listener to be notified of data changes in the model
Parameter Listener
specifies the listener to register
removeGridDataListener
void
removeGridDataListener( [in] XGridDataListener  Listener );

Description
revokes a listener which was previously registered via addGridDataListener
Parameter Listener
specifies the listener to revoke.
Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.