|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.Component
org.apache.wicket.MarkupContainer
org.apache.wicket.markup.html.WebMarkupContainer
org.apache.wicket.markup.html.panel.Panel
com.inmethod.grid.common.AbstractGrid<M,I>
M - grid model object typeI - row/item model object typepublic abstract class AbstractGrid<M,I>
Provides common functionality for DataGrid and TreeGrid.
| Field Summary | |
|---|---|
static String |
INTERNAL_TOOLBAR_ITEM_ID
INTERNAL |
static String |
THEME_VISTA
Constant for the Vista theme (default). |
| Fields inherited from class org.apache.wicket.markup.html.panel.Panel |
|---|
PANEL |
| Fields inherited from class org.apache.wicket.Component |
|---|
ENABLE, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER |
| Constructor Summary | |
|---|---|
AbstractGrid(String id,
IModel<M> model,
List<IGridColumn<M,I>> columns)
Creates new AbstractGrid instance |
|
| Method Summary | |
|---|---|
void |
addBottomToolbar(AbstractToolbar<M,I> toolbar)
Adds a toolbar to the bottom section (below the actual data). |
void |
addHeaderToolbar(AbstractHeaderToolbar<M,I> toolbar)
Ads a toolbar to the header section (below the grid header, above the actual data). |
void |
addTopToolbar(AbstractToolbar<M,I> toolbar)
Adds a toolbar to the top section (above the grid header). |
void |
cleanLastClickedColumn()
|
protected void |
columnSanityCheck(IGridColumn<M,I> column)
Checks whether the column is a valid grid column |
protected boolean |
disableRowClickNotifications()
|
abstract WebMarkupContainer |
findParentRow(Component child)
Returns the row in DataTable that contains the child component |
protected abstract WebMarkupContainer |
findRowComponent(IModel<I> rowModel)
Returns the row component for specified item. |
Collection<IGridColumn<M,I>> |
getActiveColumns()
Returns collection of currently visible columns. |
List<IGridColumn<M,I>> |
getAllColumns()
Returns the list of all columns in this grid. |
ColumnsState |
getColumnState()
Returns the column state. |
int |
getContentHeight()
Returns the content height. |
SizeUnit |
getContentHeightSizeUnit()
Returns the size unit for content height. |
Form<Void> |
getForm()
|
IGridColumn<M,I> |
getLastClickedColumn()
|
abstract Collection<IModel<I>> |
getSelectedItems()
Returns the collection of models of all currently selected items. |
GridSortState |
getSortState()
Returns the sort state of this grid. |
String |
getTheme()
Returns the theme identifier |
abstract boolean |
isAllowSelectMultiple()
Returns whether user will be able to select more than one item at a time. |
boolean |
isClickRowToDeselect()
Returns whether clicking a selected row deselects it. |
boolean |
isClickRowToSelect()
Returns whether a click on grid row should select/deselect the row. |
boolean |
isItemEdited(IModel<I> rowModel)
Returns whether the row is in editable mode. |
abstract boolean |
isItemSelected(IModel<I> itemModel)
Queries whether the item specified by itemModel is currently selected. |
boolean |
isSelectToEdit()
Returns whether selected rows are also editable. |
abstract void |
markItemDirty(IModel<I> model)
Marks the item from the given model as dirty. |
protected void |
onAfterRender()
|
protected void |
onBeforeRender()
|
protected boolean |
onCellClicked(AjaxRequestTarget target,
IModel<I> rowModel,
IGridColumn<M,I> column)
|
void |
onColumnStateChanged()
Invoked when client change the column state (e.g. |
protected void |
onComponentTag(ComponentTag tag)
|
protected void |
onInitialize()
|
protected void |
onItemSelectionChanged(IModel<I> item,
boolean newValue)
Invoked when an item selection state has been changed. |
protected void |
onRowClicked(AjaxRequestTarget target,
IModel<I> rowModel)
|
protected void |
onRowPopulated(WebMarkupContainer rowComponent)
Called after a grid row has been populated. |
protected void |
onSortStateChanged(AjaxRequestTarget target)
Invoked when sort state of this grid has changed (e.g. |
void |
renderHead(IHeaderResponse response)
|
abstract void |
resetSelectedItems()
Deselects all items. |
abstract void |
selectAllVisibleItems()
Marks all currently displayed items as selected. |
abstract void |
selectItem(IModel<I> itemModel,
boolean selected)
Alters the selection state of item specified by the item model. |
abstract void |
setAllowSelectMultiple(boolean value)
Sets whether user will be able to select more than one item. |
void |
setClickRowToDeselect(boolean clickRowToDeselect)
Sets whether a click on selected grid row should deselect it. |
AbstractGrid<M,I> |
setClickRowToSelect(boolean clickRowToSelect)
Sets whether a click on grid row should select/deselect the row. |
void |
setColumnState(ColumnsState columnState)
Sets a new column state. |
void |
setContentHeight(Integer contentHeight,
SizeUnit contentSizeUnit)
Sets the height of grid content. |
void |
setItemEdit(IModel<I> rowModel,
boolean edit)
Sets the edit mode of the row. |
void |
setSelectToEdit(boolean selectToEdit)
Determines whether selected items should also be editable. |
void |
setTheme(String theme)
Sets the grid theme. |
abstract void |
update()
During an Ajax request this method updates the changed grid rows. |
| Methods inherited from class org.apache.wicket.markup.html.panel.Panel |
|---|
newMarkupSourcingStrategy |
| Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer |
|---|
getWebPage, getWebRequest |
| Methods inherited from class org.apache.wicket.MarkupContainer |
|---|
add, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, hasAssociatedMarkup, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, onMarkupAttached, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildren |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String INTERNAL_TOOLBAR_ITEM_ID
Id of toolbar item (inside toolbar repeaters).
public static final String THEME_VISTA
| Constructor Detail |
|---|
public AbstractGrid(String id,
IModel<M> model,
List<IGridColumn<M,I>> columns)
AbstractGrid instance
id - model - columns - | Method Detail |
|---|
public Form<Void> getForm()
protected void columnSanityCheck(IGridColumn<M,I> column)
column - public void onColumnStateChanged()
getColumnState()public ColumnsState getColumnState()
ColumnsStatepublic void setColumnState(ColumnsState columnState)
columnState - new column stateColumnsStateprotected void onInitialize()
onInitialize in class Componentprotected void onBeforeRender()
onBeforeRender in class Componentprotected void onAfterRender()
onAfterRender in class Componentpublic void addTopToolbar(AbstractToolbar<M,I> toolbar)
toolbar - toolbar instanceAbstractToolbarpublic void addBottomToolbar(AbstractToolbar<M,I> toolbar)
toolbar - toolbar instanceAbstractToolbarpublic void addHeaderToolbar(AbstractHeaderToolbar<M,I> toolbar)
toolbar - toolbar instanceAbstractToolbarprotected void onSortStateChanged(AjaxRequestTarget target)
target - public Collection<IGridColumn<M,I>> getActiveColumns()
public List<IGridColumn<M,I>> getAllColumns()
public GridSortState getSortState()
IGridSortState,
GridSortStatepublic void setTheme(String theme)
theme - theme identifierpublic String getTheme()
setTheme(String)protected void onComponentTag(ComponentTag tag)
onComponentTag in class Componentpublic void renderHead(IHeaderResponse response)
renderHead in interface IHeaderContributorrenderHead in class Component
public abstract void selectItem(IModel<I> itemModel,
boolean selected)
itemModel - item modelselected - true if the item should be selected, false otherwise.public abstract void selectAllVisibleItems()
DataGrid this selects all items
on current page, for TreeGrid this selects all currently visible nodes.
public abstract void resetSelectedItems()
public abstract boolean isItemSelected(IModel<I> itemModel)
itemModel - item model
true if the item is selected, false otherwisepublic abstract Collection<IModel<I>> getSelectedItems()
public abstract void setAllowSelectMultiple(boolean value)
value - true if the user will be able to select more than one item at a time,
false otherwise (single selection mode).public abstract boolean isAllowSelectMultiple()
true if multiple items can be selected at a time, false
otherwise.public abstract void update()
The definition of "changed" varies in DataGrid and TreeGrid.
TreeGrid the changes to TreeModel itself are being tracked (assuming
the proper listeners are fired) and all rows that need to be updated are also considered
changed.
DataGrid the items that need to be updated can be marked by
DataGrid.markItemDirty(IModel) or DataGrid.markAllItemsDirty(). The grid
itself doesn't track changes to specific items (apart from the selection state).
protected void onItemSelectionChanged(IModel<I> item,
boolean newValue)
item - item modelnewValue - true if the item became selected, false otherwise.public IGridColumn<M,I> getLastClickedColumn()
public void cleanLastClickedColumn()
protected boolean disableRowClickNotifications()
protected void onRowPopulated(WebMarkupContainer rowComponent)
rowComponent -
protected boolean onCellClicked(AjaxRequestTarget target,
IModel<I> rowModel,
IGridColumn<M,I> column)
protected void onRowClicked(AjaxRequestTarget target,
IModel<I> rowModel)
public AbstractGrid<M,I> setClickRowToSelect(boolean clickRowToSelect)
clickRowToSelect - true if the row selection state should be changed upon a mouse click,
false otherwise.
this (useful for method chaining)setClickRowToDeselect(boolean)public boolean isClickRowToSelect()
true if the row click should alter the row selection state,
false otherwise.public void setClickRowToDeselect(boolean clickRowToDeselect)
setClickRowToSelect(boolean) is set to true.
clickRowToDeselect - whether clicking a selected row should deselect itpublic boolean isClickRowToDeselect()
true if clicking a selected row deselects it, false
otherwise.
public void setContentHeight(Integer contentHeight,
SizeUnit contentSizeUnit)
contentHeight - desired height of the content or null is the height should be
determined by the actual height (no scrollbar displayed, defalt value)contentSizeUnit - size unit for the contentHeightpublic int getContentHeight()
setContentHeight(Integer, SizeUnit)public SizeUnit getContentHeightSizeUnit()
public abstract WebMarkupContainer findParentRow(Component child)
child -
protected abstract WebMarkupContainer findRowComponent(IModel<I> rowModel)
rowModel -
public abstract void markItemDirty(IModel<I> model)
update() method is called.
model - model used to access the itempublic void setSelectToEdit(boolean selectToEdit)
false when the grid is both selectable and editable (independently).
selectToEdit - whether selected rows should be editablepublic boolean isSelectToEdit()
public void setItemEdit(IModel<I> rowModel,
boolean edit)
selectItem(IModel, boolean).
rowModel - row modeledit - true if the row should be in editable mode, false
otherwise.setSelectToEdit(boolean)public boolean isItemEdited(IModel<I> rowModel)
rowModel -
true if the row is in editable mode, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||