|
||||||||||
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.HoverGrid
public class HoverGrid
A variation of the Grid
that supports row or cell hovering and row
selection.
Nested Class Summary | |
---|---|
class |
HoverGrid.HoverGridRowFormatter
This class contains methods used to format a table's rows. |
Nested classes/interfaces inherited from class com.google.gwt.widgetideas.table.client.overrides.HTMLTable |
---|
HTMLTable.CellFormatter, HTMLTable.ColumnFormatter, HTMLTable.RowFormatter, HTMLTable.WidgetMapper |
Field Summary | |
---|---|
static int |
HOVERING_POLICY_CELL
Enable hovering of a cell. |
static int |
HOVERING_POLICY_DISABLED
Disable hovering. |
static int |
HOVERING_POLICY_ROW
Enable hovering of a row. |
static int |
SELECTION_POLICY_DISABLED
Disable row selection. |
static int |
SELECTION_POLICY_MULTI_ROW
Allow multiple rows to be selected. |
static int |
SELECTION_POLICY_ONE_ROW
Allow only one row to be selected at a time. |
Fields inherited from class com.google.gwt.widgetideas.table.client.overrides.Grid |
---|
numColumns, numRows |
Constructor Summary | |
---|---|
HoverGrid()
Constructor. |
|
HoverGrid(int rows,
int columns)
Constructs a HoverGrid with the requested size. |
Method Summary | |
---|---|
void |
addHoverGridListener(HoverGridListener listener)
Add a listener to this grid. |
void |
deselectRow(int row)
Deselect a row in the data table. |
void |
deselectRows()
Deselect all selected rows in the data table. |
int |
getHoveringPolicy()
Returns the current hovering policy. |
protected int |
getRowIndex(com.google.gwt.user.client.Element rowElem)
Get the index of a row given the row element. |
java.util.Set |
getSelectedRows()
Returns a Set of selected row indexes. |
protected java.util.Map |
getSelectedRowsMap()
Returns a HashMap of selected rows. |
int |
getSelectionPolicy()
Returns the current selection policy. |
protected void |
hoverCell(com.google.gwt.user.client.Element cellElem,
com.google.gwt.user.client.Element rowElem)
Set the current hovering cell. |
protected void |
hoverRow(com.google.gwt.user.client.Element rowElem)
Set the current hovering row. |
protected int |
insertRow(int beforeRow)
Inserts a new row into the table, deselecting all selected rows. |
boolean |
isRowSelected(int row)
Returns true if the row is currently selected. |
void |
onBrowserEvent(com.google.gwt.user.client.Event event)
Method to process events generated from the browser. |
void |
onCellClicked(int row,
int cell)
Handle cell click events. |
void |
removeHoverGridListener(HoverGridListener listener)
Remove one of the grid listeners. |
void |
removeRow(int row)
Removes the specified row from the table. |
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 |
setHoveringPolicy(int hoveringPolicy)
Set the hovering policy. |
void |
setMinHoverRow(int minRow)
Set the index of the first row that can be hovered or selected. |
void |
setSelectionPolicy(int selectionPolicy)
Set the selection policy, which determines if the user can select zero, one, or multiple rows. |
protected void |
unhover()
Unhighlight the currently hovering row or cell. |
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, getHTML, getRowFormatter, getText, getWidget, getWidgetMap, insertCell, insertCells, internalClearCell, isCellPresent, iterator, remove, removeCell, removeTableListener, setBodyElement, setBorderWidth, setCellFormatter, setCellPadding, setCellSpacing, setClearText, setColumnFormatter, 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, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, 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 |
Methods inherited from interface com.google.gwt.widgetideas.table.client.HasColumns |
---|
getElement, getOffsetWidth, setStyleName |
Field Detail |
---|
public static final int HOVERING_POLICY_CELL
public static final int HOVERING_POLICY_DISABLED
public static final int HOVERING_POLICY_ROW
public static final int SELECTION_POLICY_DISABLED
public static final int SELECTION_POLICY_MULTI_ROW
public static final int SELECTION_POLICY_ONE_ROW
Constructor Detail |
---|
public HoverGrid()
public HoverGrid(int rows, int columns)
HoverGrid
with the requested size.
rows
- the number of rowscolumns
- the number of columns
java.lang.IndexOutOfBoundsException
Method Detail |
---|
public void addHoverGridListener(HoverGridListener listener)
listener
- the listenerpublic void deselectRow(int row)
row
- the row indexpublic void deselectRows()
public int getHoveringPolicy()
public java.util.Set getSelectedRows()
public int getSelectionPolicy()
public boolean isRowSelected(int row)
row
- the row index
public void onBrowserEvent(com.google.gwt.user.client.Event event)
onBrowserEvent
in interface com.google.gwt.user.client.EventListener
onBrowserEvent
in class HTMLTable
event
- the generated eventpublic void onCellClicked(int row, int cell)
row
- the row indexcell
- the cell indexpublic void removeHoverGridListener(HoverGridListener listener)
listener
- the listener to removepublic void removeRow(int row)
removeRow
in class HTMLTable
row
- the index of the row to be removed
java.lang.IndexOutOfBoundsException
public 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 setHoveringPolicy(int hoveringPolicy)
hoveringPolicy
- the hovering policy to usepublic void setMinHoverRow(int minRow)
minRow
- the min row that can be hoveredpublic void setSelectionPolicy(int selectionPolicy)
selectionPolicy
- the selection policyprotected int getRowIndex(com.google.gwt.user.client.Element rowElem)
protected java.util.Map getSelectedRowsMap()
protected void hoverCell(com.google.gwt.user.client.Element cellElem, com.google.gwt.user.client.Element rowElem)
cellElem
- the cell elementprotected void hoverRow(com.google.gwt.user.client.Element rowElem)
rowElem
- the row elementprotected int insertRow(int beforeRow)
insertRow
in class HTMLTable
beforeRow
- the index before which the new row will be inserted
java.lang.IndexOutOfBoundsException
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 listenersprotected void unhover()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |