java.lang.Object | |||||
↳ | com.google.gwt.user.client.ui.UIObject | ||||
↳ | com.google.gwt.user.client.ui.Widget | ||||
↳ | com.google.gwt.user.client.ui.Panel | ||||
↳ | com.google.gwt.user.client.ui.HTMLTable | ||||
↳ | com.google.gwt.user.client.ui.Grid |
A rectangular grid that can contain text, html, or a child
Widget
within its cells. It must be
resized explicitly to the desired number of rows and columns.
Grid widget consists of <g:row> elements. Each <g:row> element
can contain one or more <g:cell> or <g:customCell> elements.
Using <g:cell> attribute it is possible to place pure HTML content.
<g:customCell> is used as a container for
Widget
type objects. (Note that the
tags of the row, cell and customCell elements are not capitalized. This
is meant to signal that the item is not a runtime object, and so cannot
have a ui:field
attribute.)
For example:
<g:Grid> <g:row> <g:customCell> <g:Label>foo</g:Label> </g:customCell> <g:customCell> <g:Label>bar</g:Label> </g:customCell> </g:row> <g:row> <g:cell> <div>foo</div> </g:cell> <g:cell> <div>bar</div> </g:cell> </g:row> </g:Grid>
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.UIObject
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
numColumns | Number of columns in the current grid. | ||||||||||
numRows | Number of rows in the current grid. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructor for
Grid . | |||||||||||
Constructs a grid with the requested size.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Replaces the contents of the specified cell with a single space.
| |||||||||||
Return number of columns.
| |||||||||||
Gets the number of columns in this grid.
| |||||||||||
Return number of rows.
| |||||||||||
Inserts a new row into the table.
| |||||||||||
Removes the specified row from the table.
| |||||||||||
Resizes the grid.
| |||||||||||
Resizes the grid to the specified number of columns.
| |||||||||||
Resizes the grid to the specified number of rows.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new, empty cell.
| |||||||||||
Checks that a cell is a valid cell in the table.
| |||||||||||
Checks that the column index is valid.
| |||||||||||
Checks that the row index is valid.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.HTMLTable
| |||||||||||
From class
com.google.gwt.user.client.ui.Panel
| |||||||||||
From class
com.google.gwt.user.client.ui.Widget
| |||||||||||
From class
com.google.gwt.user.client.ui.UIObject
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.google.gwt.event.dom.client.HasClickHandlers
| |||||||||||
From interface
com.google.gwt.event.dom.client.HasDoubleClickHandlers
| |||||||||||
From interface com.google.gwt.event.logical.shared.HasAttachHandlers | |||||||||||
From interface com.google.gwt.event.shared.HasHandlers | |||||||||||
From interface
com.google.gwt.user.client.EventListener
| |||||||||||
From interface
com.google.gwt.user.client.ui.HasWidgets
| |||||||||||
From interface
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
| |||||||||||
From interface
com.google.gwt.user.client.ui.IsWidget
| |||||||||||
From interface
com.google.gwt.user.client.ui.SourcesTableEvents
| |||||||||||
From interface
java.lang.Iterable
|
Number of columns in the current grid.
Number of rows in the current grid.
Constructor for Grid
.
Constructs a grid with the requested size.
rows | the number of rows |
---|---|
columns | the number of columns |
IndexOutOfBoundsException |
---|
Replaces the contents of the specified cell with a single space.
row | the cell's row |
---|---|
column | the cell's column |
IndexOutOfBoundsException |
---|
Return number of columns. For grid, row argument is ignored as all grids are rectangular.
row | the row whose cells are to be counted |
---|
Gets the number of columns in this grid.
Return number of rows.
Inserts a new row into the table. If you want to add multiple rows at once,
use resize(int, int)
or resizeRows(int)
as they are more
efficient.
beforeRow | the index before which the new row will be inserted |
---|
IndexOutOfBoundsException |
---|
Removes the specified row from the table.
row | the index of the row to be removed |
---|
Resizes the grid.
rows | the number of rows |
---|---|
columns | the number of columns |
IndexOutOfBoundsException |
---|
Resizes the grid to the specified number of columns.
columns | the number of columns |
---|
IndexOutOfBoundsException |
---|
Resizes the grid to the specified number of rows.
rows | the number of rows |
---|
IndexOutOfBoundsException |
---|
Checks that a cell is a valid cell in the table.
row | the cell's row |
---|---|
column | the cell's column |
IndexOutOfBoundsException |
---|
Checks that the column index is valid.
column | The column index to be checked |
---|
IndexOutOfBoundsException | if the column is negative |
---|
Checks that the row index is valid.
row | The row index to be checked |
---|
IndexOutOfBoundsException | if the row is negative |
---|