|
||||||||||
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
public class SortableGrid
A variation of the
Grid
that supports
many more options such as lazy row and column creation, row movement,
hovering, row selection, and better column resizing.
Nested Class Summary | |
---|---|
static class |
SortableGrid.ColumnSorter
The column sorter defines an algorithm to sort columns. |
class |
SortableGrid.ColumnSorterCallback
Callback that is called when the row sorting is complete. |
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 |
---|
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 | |
---|---|
SortableGrid()
Constructor. |
|
SortableGrid(int rows,
int columns)
Constructs a SortableGrid with the requested size. |
Method Summary | |
---|---|
void |
addSortableColumnsListener(SortableColumnsListener listener)
Add a SortableColumnsListener listener. |
protected void |
fireColumnSorted()
Fire column sorted event to listeners. |
SortableGrid.ColumnSorter |
getColumnSorter()
|
protected SortableGrid.ColumnSorter |
getColumnSorter(boolean createAsNeeded)
Get the SortableGrid.ColumnSorter . |
TableModel.ColumnSortList |
getColumnSortList()
|
void |
moveRowDown(int row)
Move a row up (relative to the screen) one index to a lesser index. |
void |
moveRowUp(int row)
Move a row down (relative to the screen) one index to a greater index. |
void |
removeSortableColumnsListener(SortableColumnsListener listener)
Remove a SortableColumnsListener bleColumnsListener listener. |
void |
reverseRows()
Completely reverse the order of all rows in the table. |
void |
setColumnSorter(SortableGrid.ColumnSorter sorter)
Set the SortableGrid.ColumnSorter . |
void |
sortColumn(int column)
Sort the grid according to the specified column. |
void |
sortColumn(int column,
boolean ascending)
Sort the grid according to the specified column. |
void |
swapRows(int row1,
int row2)
Swap the positions of two rows. |
protected void |
swapRowsRaw(int row1,
int row2)
Swap two rows without checking the cell bounds. |
Methods inherited from class com.google.gwt.widgetideas.table.client.SelectionGrid |
---|
addTableSelectionListener, deselectRow, deselectRows, getSelectedRows, getSelectedRowsMap, getSelectionGridCellFormatter, getSelectionGridRowFormatter, getSelectionPolicy, hoverCell, insertRow, isRowSelected, onBrowserEvent, removeRow, removeTableSelectionListener, selectRow, selectRow, selectRow, setSelectionPolicy |
Methods inherited from class com.google.gwt.widgetideas.table.client.overrides.Grid |
---|
createCell, getCellCount, getColumnCount, getRowCount, prepareCell, prepareColumn, prepareRow, resize, resizeColumns, resizeRows |
Methods inherited from class com.google.gwt.widgetideas.table.client.overrides.HTMLTable |
---|
addTableListener, checkCellBounds, checkRowBounds, cleanCell, clear, clearAll, clearCell, getBodyElement, getCellContainer, getCellContainer, getCellFormatter, getCellPadding, getCellSpacing, getColumnFormatter, getDOMCellCount, getDOMCellCount, getDOMRowCount, getDOMRowCount, getEventTargetCell, getEventTargetRow, getHTML, getRowFormatter, getRowIndex, getText, getWidget, getWidgetMap, insertCell, 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 |
Constructor Detail |
---|
public SortableGrid()
public SortableGrid(int rows, int columns)
SortableGrid
with the requested size.
rows
- the number of rowscolumns
- the number of columns
java.lang.IndexOutOfBoundsException
Method Detail |
---|
public void addSortableColumnsListener(SortableColumnsListener listener)
SortableColumnsListener
listener.
listener
- the listenerpublic SortableGrid.ColumnSorter getColumnSorter()
public TableModel.ColumnSortList getColumnSortList()
TableModel.ColumnSortList
of previously sorted columnspublic void moveRowDown(int row)
row
- the row index to move
java.lang.IndexOutOfBoundsException
public void moveRowUp(int row)
row
- the row index to move
java.lang.IndexOutOfBoundsException
public void removeSortableColumnsListener(SortableColumnsListener listener)
SortableColumnsListener
bleColumnsListener listener.
listener
- the listener to removepublic void reverseRows()
public void setColumnSorter(SortableGrid.ColumnSorter sorter)
SortableGrid.ColumnSorter
.
sorter
- the new SortableGrid.ColumnSorter
public void sortColumn(int column)
column
- the column to sort
java.lang.IndexOutOfBoundsException
public void sortColumn(int column, boolean ascending)
column
- the column to sortascending
- sort the column in ascending order
java.lang.IndexOutOfBoundsException
public void swapRows(int row1, int row2)
row1
- the first row to swaprow2
- the second row to swap
java.lang.IndexOutOfBoundsException
protected void fireColumnSorted()
protected SortableGrid.ColumnSorter getColumnSorter(boolean createAsNeeded)
SortableGrid.ColumnSorter
. Optionally create a
DefaultColumnSorter
if the user hasn't specified one already.
createAsNeeded
- create a default sorter if needed
protected void swapRowsRaw(int row1, int row2)
row1
- the first row to swaprow2
- the second row to swap
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |