|
||||||||||
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
public class SelectionGrid
A variation of the Grid
that supports row or cell hovering and row
selection.
Nested Class Summary | |
---|---|
class |
SelectionGrid.SelectionGridCellFormatter
This class contains methods used to format a table's cells. |
class |
SelectionGrid.SelectionGridRowFormatter
This class contains methods used to format a table's rows. |
static class |
SelectionGrid.SelectionPolicy
Selection policies. |
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 | |
---|---|
SelectionGrid()
Constructor. |
|
SelectionGrid(int rows,
int columns)
Constructs a SelectionGrid with the requested size. |
Method Summary | |
---|---|
void |
addTableSelectionListener(TableSelectionListener listener)
Add a TableSelectionListener . |
void |
deselectRow(int row)
Deselect a row in the grid. |
void |
deselectRows()
Deselect all selected rows in the data table. |
java.util.Set<java.lang.Integer> |
getSelectedRows()
|
protected java.util.Map<java.lang.Integer,com.google.gwt.user.client.Element> |
getSelectedRowsMap()
|
SelectionGrid.SelectionGridCellFormatter |
getSelectionGridCellFormatter()
Explicitly gets the SelectionGrid.SelectionGridCellFormatter . |
SelectionGrid.SelectionGridRowFormatter |
getSelectionGridRowFormatter()
Explicitly gets the SelectionGrid.SelectionGridRowFormatter . |
SelectionGrid.SelectionPolicy |
getSelectionPolicy()
|
protected void |
hoverCell(com.google.gwt.user.client.Element cellElem)
Set the current hovering cell. |
protected int |
insertRow(int beforeRow)
Inserts a new row into the table. |
boolean |
isRowSelected(int row)
|
void |
onBrowserEvent(com.google.gwt.user.client.Event event)
Method to process events generated from the browser. |
protected void |
removeRow(int row)
Removes the specified row from the table. |
void |
removeTableSelectionListener(TableSelectionListener listener)
Remove a TableSelectionListener . |
void |
selectRow(int row,
boolean unselectAll)
Select a row in the data table. |
void |
selectRow(int row,
boolean ctrlKey,
boolean shiftKey)
Select a row in the data table. |
protected void |
selectRow(int row,
com.google.gwt.user.client.Element rowElem,
boolean unselectAll,
boolean fireEvent)
Select a row in the data table. |
void |
setSelectionPolicy(SelectionGrid.SelectionPolicy selectionPolicy)
Set the selection policy, which determines if the user can select zero, one, or multiple rows. |
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 SelectionGrid()
public SelectionGrid(int rows, int columns)
SelectionGrid
with the requested size.
rows
- the number of rowscolumns
- the number of columns
java.lang.IndexOutOfBoundsException
Method Detail |
---|
public void addTableSelectionListener(TableSelectionListener listener)
TableSelectionListener
.
addTableSelectionListener
in interface SourceTableSelectionEvents
listener
- the listenerpublic void deselectRow(int row)
row
- the row indexpublic void deselectRows()
public java.util.Set<java.lang.Integer> getSelectedRows()
public SelectionGrid.SelectionGridCellFormatter getSelectionGridCellFormatter()
SelectionGrid.SelectionGridCellFormatter
. The results of
HTMLTable.getCellFormatter()
may also be downcast to a SelectionGrid.SelectionGridCellFormatter
.
public SelectionGrid.SelectionGridRowFormatter getSelectionGridRowFormatter()
SelectionGrid.SelectionGridRowFormatter
. The results of
HTMLTable.getRowFormatter()
may also be downcast to a SelectionGrid.SelectionGridRowFormatter
.
public SelectionGrid.SelectionPolicy getSelectionPolicy()
public boolean isRowSelected(int row)
row
- the row index
public void onBrowserEvent(com.google.gwt.user.client.Event event)
HTMLTable
onBrowserEvent
in interface com.google.gwt.user.client.EventListener
onBrowserEvent
in class HTMLTable
event
- the generated eventHTMLTable
public void removeTableSelectionListener(TableSelectionListener listener)
TableSelectionListener
.
removeTableSelectionListener
in interface SourceTableSelectionEvents
listener
- the listener to removepublic void selectRow(int row, boolean unselectAll)
row
- the row indexunselectAll
- unselect all other rows first
java.lang.IndexOutOfBoundsException
public void selectRow(int row, boolean ctrlKey, boolean shiftKey)
row
- the row indexctrlKey
- true to simulate a control clickshiftKey
- true to simulate a shift selection
java.lang.IndexOutOfBoundsException
public void setSelectionPolicy(SelectionGrid.SelectionPolicy selectionPolicy)
selectionPolicy
- the selection policyprotected java.util.Map<java.lang.Integer,com.google.gwt.user.client.Element> getSelectedRowsMap()
protected void hoverCell(com.google.gwt.user.client.Element cellElem)
cellElem
- the cell elementprotected int insertRow(int beforeRow)
HTMLTable
insertRow
in class Grid
beforeRow
- the index before which the new row will be inserted
HTMLTable
protected void removeRow(int row)
HTMLTable
removeRow
in class Grid
row
- the index of the row to be removedHTMLTable
protected void selectRow(int row, com.google.gwt.user.client.Element rowElem, boolean unselectAll, boolean fireEvent)
row
- the row index, or -1 if unknownrowElem
- the row elementunselectAll
- true to unselect all currently selected rowsfireEvent
- true to fire the select event to listeners
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |