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 XGridColumnModel
Base Interfaces
XGridColumnModel
┣ ::com::sun::star::lang::XComponent
┣ ::com::sun::star::container::XContainer
┗ ::com::sun::star::util::XCloneable

::com::sun::star::lang::XComponent
Description
implements life time control for the component
::com::sun::star::container::XContainer
Description
allows to register listeners to be notified when columns are inserted or removed
::com::sun::star::util::XCloneable
Description
allows cloning the complete column model
Description
An instance of this interface is used by the UnoControlGrid to retrieve the column structure that is displayed in the actual control. If you do not need your own model implementation, you can also use the DefaultGridColumnModel.
Since
OOo 3.3

Methods' Summary
getColumnCount Returns the number of columns.  
createColumn creates a new column for use with the column model.  
addColumn Adds a column to the model.  
removeColumn removes a column from the model  
getColumns Returns all columns of the model.  
getColumn Returns a specific column.  
setDefaultColumns Fills the model with the given number of default columns  
Methods' Details
getColumnCount
long
getColumnCount();

Description
Returns the number of columns.
Returns
the number of columns.
createColumn
XGridColumn
createColumn();

Description
creates a new column for use with the column model.

The newly created column is not yet inserted into the column container, you need to call addColumn after you initialized the column object.

addColumn
long
addColumn( [in] XGridColumn  column )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
Adds a column to the model.

You should use the createColumn member to create a new column. This gives implementations of the XGridColumnModel interface the possibility to provide own column implementations which extend the basic GridColumn type.

As soon as the column has been inserted into the model, the model takes ownership of it. This means when the column is removed, or when the column model is disposed, the grid column is disposed as well.

Parameter column
the column to add to the model.
Returns
the index of new created column.
Throws
::com::sun::star::lang::IllegalArgumentException if the given column is not a valid element for the column container, or if it is NULL.
removeColumn
void
removeColumn( [in] long  ColumnIndex )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
removes a column from the model

The column object will be disposed upon removal.

Parameter ColumnIndex
denotes the index of the column to remove
Throws
::com::sun::star::lang::IndexOutOfBoundsException if ColumnIndex does not denote a valid column index.
getColumns
sequence< XGridColumn >
getColumns();

Description
Returns all columns of the model.
Returns
all columns associated with the model in a sequence of XGridColumn.
getColumn
XGridColumn
getColumn( [in] long  index )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
Returns a specific column.
Parameter index
the position of the requested column.
Returns
the requested column.
setDefaultColumns
void
setDefaultColumns( [in] long  elements );

Description
Fills the model with the given number of default columns

Existing columns will be removed before adding new columns. Listeners at the column model will be notified one ::com::sun::star::container::XContainerListener::elementRemoved event for each removed column, and one ::com::sun::star::container::XContainerListener::elementInserted event for each insertion.

Parameter elements
the number of default columns that should be set.
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.