|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
com.google.gwt.widgetideas.table.client.overrides.HTMLTable
com.google.gwt.widgetideas.table.client.overrides.Grid
com.google.gwt.widgetideas.table.client.SelectionGrid
com.google.gwt.widgetideas.table.client.SortableGrid
com.google.gwt.widgetideas.table.client.FixedWidthGrid
public class FixedWidthGrid
A variation of the Grid
that
resizes columns using a fixed table width.
Nested Class Summary | |
---|---|
class |
FixedWidthGrid.FixedWidthGridCellFormatter
This class contains methods used to format a table's cells. |
class |
FixedWidthGrid.FixedWidthGridColumnFormatter
This class contains methods used to format a table's columns. |
class |
FixedWidthGrid.FixedWidthGridRowFormatter
This class contains methods used to format a table's rows. |
Nested classes/interfaces inherited from class com.google.gwt.widgetideas.table.client.SortableGrid |
---|
SortableGrid.ColumnSorter, SortableGrid.ColumnSorterCallback |
Nested classes/interfaces inherited from class com.google.gwt.widgetideas.table.client.SelectionGrid |
---|
SelectionGrid.SelectionGridCellFormatter, SelectionGrid.SelectionGridRowFormatter, SelectionGrid.SelectionPolicy |
Nested classes/interfaces inherited from class com.google.gwt.widgetideas.table.client.overrides.HTMLTable |
---|
HTMLTable.CellFormatter, HTMLTable.ColumnFormatter, HTMLTable.RowFormatter, HTMLTable.WidgetMapper |
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary | |
---|---|
static int |
DEFAULT_COLUMN_WIDTH
The default width of a column in pixels. |
static int |
MIN_COLUMN_WIDTH
The minimum width of any column. |
Fields inherited from class com.google.gwt.widgetideas.table.client.overrides.Grid |
---|
numColumns, numRows |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
FixedWidthGrid()
Constructor. |
|
FixedWidthGrid(int rows,
int columns)
Constructs a FixedWidthGrid with the requested size. |
Method Summary | |
---|---|
int |
autoFitColumnWidth(int column)
Stretches or shrinks the column to automatically fit its data content. |
int |
getAutoFitColumnWidth(int column)
Calculate the minimum required width to fit the contents of the column, but do not actually change the column size. |
protected com.google.gwt.user.client.Element |
getCellContainer(com.google.gwt.user.client.Element td)
Get the container element from a cell. |
int |
getColumnWidth(int column)
Return the column width for a given column index. |
protected int |
getDOMCellCount(int row)
Directly ask the underlying DOM what the cell count on the given row is. |
protected com.google.gwt.user.client.Element |
getDOMGhostRow(HTMLTable table)
Gets the new ghost element directly from the table. |
protected int |
getDOMRowCount()
Directly ask the underlying DOM what the row count is. |
protected FixedWidthGrid.FixedWidthGridCellFormatter |
getFixedWidthGridCellFormatter()
Explicitly gets the FixedWidthGrid.FixedWidthGridCellFormatter . |
protected FixedWidthGrid.FixedWidthGridRowFormatter |
getFixedWidthGridRowFormatter()
Explicitly gets the FixedWidthGrid.FixedWidthGridRowFormatter . |
protected int |
getGhostColumnCount()
|
protected com.google.gwt.user.client.Element |
getGhostRow()
|
protected int |
getRowIndex(com.google.gwt.user.client.Element rowElem)
|
protected com.google.gwt.user.client.Element |
insertCell(int row,
int column)
Inserts a new cell into the specified row. |
int |
insertRow(int beforeRow)
Inserts a new row into the table. |
protected void |
prepareCell(int row,
int column)
Checks that a cell is a valid cell in the table. |
protected void |
prepareColumn(int column)
Checks that the column index is valid. |
protected void |
prepareRow(int row)
Checks that the row index is valid. |
void |
removeRow(int row)
Removes the specified row from the table. |
void |
resizeColumns(int columns)
Resizes the grid to the specified number of columns. |
void |
resizeRows(int rows)
Resizes the grid to the specified number of rows. |
void |
setColumnWidth(int column,
int width)
Set the width of a column. |
protected void |
setGhostRow(com.google.gwt.user.client.Element ghostRow)
Sets the ghost row variable. |
protected void |
updateGhostRow()
Add or remove ghost cells when the table size changes. |
Methods inherited from class com.google.gwt.widgetideas.table.client.SortableGrid |
---|
addSortableColumnsListener, fireColumnSorted, getColumnSorter, getColumnSorter, getColumnSortList, moveRowDown, moveRowUp, removeSortableColumnsListener, reverseRows, setColumnSorter, sortColumn, sortColumn, swapRows, swapRowsRaw |
Methods inherited from class com.google.gwt.widgetideas.table.client.SelectionGrid |
---|
addTableSelectionListener, deselectRow, deselectRows, getSelectedRows, getSelectedRowsMap, getSelectionGridCellFormatter, getSelectionGridRowFormatter, getSelectionPolicy, hoverCell, isRowSelected, onBrowserEvent, removeTableSelectionListener, selectRow, selectRow, selectRow, setSelectionPolicy |
Methods inherited from class com.google.gwt.widgetideas.table.client.overrides.Grid |
---|
createCell, getCellCount, getColumnCount, getRowCount, resize |
Methods inherited from class com.google.gwt.widgetideas.table.client.overrides.HTMLTable |
---|
addTableListener, checkCellBounds, checkRowBounds, cleanCell, clear, clearAll, clearCell, getBodyElement, getCellContainer, getCellFormatter, getCellPadding, getCellSpacing, getColumnFormatter, getDOMCellCount, getDOMRowCount, getEventTargetCell, getEventTargetRow, getHTML, getRowFormatter, getText, getWidget, getWidgetMap, insertCells, internalClearCell, isCellPresent, iterator, remove, removeCell, removeTableListener, setBodyElement, setBorderWidth, setCellFormatter, setCellPadding, setCellSpacing, setClearText, setColumnFormatter, setElement, setHTML, setRowFormatter, setText, setWidget |
Methods inherited from class com.google.gwt.user.client.ui.Panel |
---|
add, adopt, adopt, disown, doAttachChildren, doDetachChildren, onLoad, onUnload, orphan |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
getParent, isAttached, onAttach, onDetach, removeFromParent, setElement |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_COLUMN_WIDTH
public static final int MIN_COLUMN_WIDTH
Constructor Detail |
---|
public FixedWidthGrid()
public FixedWidthGrid(int rows, int columns)
FixedWidthGrid
with the requested size.
rows
- the number of rowscolumns
- the number of columns
java.lang.IndexOutOfBoundsException
Method Detail |
---|
public int autoFitColumnWidth(int column)
column
- the column to fit
java.lang.IndexOutOfBoundsException
public int getAutoFitColumnWidth(int column)
column
- the column to fit
java.lang.IndexOutOfBoundsException
public int getColumnWidth(int column)
column
- the column index
public int insertRow(int beforeRow)
HTMLTable
insertRow
in class SelectionGrid
beforeRow
- the index before which the new row will be inserted
HTMLTable
public void removeRow(int row)
HTMLTable
removeRow
in class SelectionGrid
row
- the index of the row to be removedHTMLTable
public void resizeColumns(int columns)
Grid
resizeColumns
in class Grid
columns
- the number of columnsGrid
public void resizeRows(int rows)
Grid
resizeRows
in class Grid
rows
- the number of rowsGrid
public void setColumnWidth(int column, int width)
column
- the index of the columnwidth
- the width in pixels
java.lang.IndexOutOfBoundsException
protected com.google.gwt.user.client.Element getCellContainer(com.google.gwt.user.client.Element td)
getCellContainer
in class HTMLTable
td
- the cell element
protected int getDOMCellCount(int row)
HTMLTable
getDOMCellCount
in class HTMLTable
row
- the row
HTMLTable
protected com.google.gwt.user.client.Element getDOMGhostRow(HTMLTable table)
table
- the table
protected int getDOMRowCount()
HTMLTable
getDOMRowCount
in class HTMLTable
HTMLTable
protected FixedWidthGrid.FixedWidthGridCellFormatter getFixedWidthGridCellFormatter()
FixedWidthGrid.FixedWidthGridCellFormatter
. The results of
HTMLTable.getCellFormatter()
may also
be downcast to a FixedWidthGrid.FixedWidthGridCellFormatter
.
FixedWidthGrid
's cell formatterprotected FixedWidthGrid.FixedWidthGridRowFormatter getFixedWidthGridRowFormatter()
FixedWidthGrid.FixedWidthGridRowFormatter
. The results of
HTMLTable.getCellFormatter()
may also
be downcast to a FixedWidthGrid.FixedWidthGridRowFormatter
.
FixedWidthGrid
's cell formatterprotected int getGhostColumnCount()
protected com.google.gwt.user.client.Element getGhostRow()
protected int getRowIndex(com.google.gwt.user.client.Element rowElem)
getRowIndex
in class HTMLTable
rowElem
- the row element
SelectionGrid
protected com.google.gwt.user.client.Element insertCell(int row, int column)
HTMLTable
insertCell
in class HTMLTable
row
- the row into which the new cell will be insertedcolumn
- the column before which the cell will be inserted
HTMLTable
protected void prepareCell(int row, int column)
Grid
prepareCell
in class Grid
row
- the cell's rowcolumn
- the cell's columnGrid
protected void prepareColumn(int column)
Grid
prepareColumn
in class Grid
column
- The column index to be checkedGrid
protected void prepareRow(int row)
Grid
prepareRow
in class Grid
row
- The row index to be checkedGrid
protected void setGhostRow(com.google.gwt.user.client.Element ghostRow)
ghostRow
- the new ghost rowprotected void updateGhostRow()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |