T
- public abstract class AssymetricGridView<T>
extends org.apache.wicket.markup.repeater.data.DataViewBase<T>
GridView
in most places; except those that required tweaking and were
proving weird to override cleanly.
Issues with GridView
that make it unfit for extension:GridView
class assumes Symmetry of Rows x Cols. In addition due to certain
non standardized API methods being final or private the setRows() & setCols() have been overriden
completely to circumvent the use of GridView.updateItemsPerPage()
(which uses internalSetRowsPerPage)
, the name of the method is not appropriate and in the future should be able to override it with
asymmetric implementations.
Also, columns & rows is private. If getters & setters of columns & rows were simple bean methods those could have been used.
But since they involve complex logic that requires visibility of the variables this too becomes unfit for consumption.Constructor and Description |
---|
AssymetricGridView(String id,
org.apache.wicket.markup.repeater.data.IDataProvider<T> dataProvider,
Integer rows,
int cols,
AssymetricDescriptor assymetricDescriptor) |
Modifier and Type | Method and Description |
---|---|
protected void |
addItems(Iterator<org.apache.wicket.markup.repeater.Item<T>> items)
NOTE CHANGE : Accounts for Assymetrical Structures
|
protected abstract boolean |
currentCellEmpty(int currentRow,
int currentCol)
The Grid here is not a regular Symmetrical Grid; hence overriding
certain aspects of Grid.
|
protected abstract boolean |
currentCellMerged(int currentRow,
int currentCol)
The Grid here is not a regular Symmetrical Grid; hence overriding
certain aspects of Grid.
|
protected abstract boolean |
currentItemInMergedCell(int index)
Checks if the Item with the index is a part of a Merged space
|
protected void |
customizeCell(org.apache.wicket.markup.repeater.Item<T> cellItem,
int row,
int col) |
AssymetricDescriptor |
getAssymetricDescriptor() |
int |
getColumns() |
org.apache.wicket.markup.repeater.data.IDataProvider<T> |
getDataProvider() |
Iterator<org.apache.wicket.markup.repeater.Item<T>> |
getItems() |
int |
getRows() |
boolean |
isAllRows()
The Grid will represent all rows from the Data Provider
|
protected org.apache.wicket.markup.repeater.Item<T> |
newEmptyItem(String id,
int index)
Create a Item which represents an empty cell (there is no model for it in the DataProvider)
Can be null if we do not want the empty cell added to the Grid at all.
|
protected org.apache.wicket.markup.repeater.Item<?> |
newRowItem(String id,
int index)
Create a new Item which will hold a row.
|
protected abstract void |
populateEmptyItem(org.apache.wicket.markup.repeater.Item<T> item,
int row,
int col)
Add component to an Item for which there is no model anymore and is shown in a cell.
|
void |
setAllRows(boolean allRows)
The Grid will represent all rows from the Data Provider
|
void |
setAssymetricDescriptor(AssymetricDescriptor assymetricDescriptor) |
AssymetricGridView<T> |
setColumns(int cols)
Sets number of columns
|
AssymetricGridView<T> |
setRows(int rows)
Sets number of rows per page
|
protected void |
updateItemsPerPage()
NOTE CHANGE : Accounts for Assymetrical Structures
|
getItemModels, internalGetDataProvider, internalGetItemCount, onDetach
getCurrentPage, getItemCount, getItemModels, getPageCount, getRowCount, getViewOffset, getViewSize, internalGetRowsPerPage, internalSetRowsPerPage, onBeforeRender, setCurrentPage
getItemReuseStrategy, newItem, newItemFactory, onPopulate, populateItem, setItemReuseStrategy
newChildId, renderIterator
onRender, renderChild
getMarkupType, getWebPage, getWebRequest
add, addOrReplace, autoAdd, autoAdd, contains, findMarkupStream, get, get, getAssociatedMarkupStream, getMarkupStream, hasAssociatedMarkup, internalAdd, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onComponentTagBody, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, renderNext, replace, setDefaultModel, setMarkupStream, size, swap, toString, toString, visitChildren, visitChildren
add, addStateChange, afterRender, beforeRender, callOnBeforeRenderIfNotVisible, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, configure, continueToOriginalDestination, debug, detach, detachBehaviors, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getBehaviors, getBehaviors, getBehaviorsRawList, getClassRelativePath, getComponentBorder, getConverter, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdImpl, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalAttach, internalDetach, internalOnAttach, internalOnDetach, internalOnModelChanged, isActionAuthorized, isAncestorOf, isAttached, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, locateMarkupStream, markAttached, markRendering, modelChanged, modelChanging, onAfterRender, onAttach, onBeginRequest, onComponentTag, onConfigure, onEndRequest, onInitialize, onModelChanged, onModelChanging, onRemove, prepareForRender, prepareForRender, redirectToInterceptPage, remove, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, setAuto, setComponentBorder, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn, wrap
public AssymetricGridView(String id, org.apache.wicket.markup.repeater.data.IDataProvider<T> dataProvider, Integer rows, int cols, AssymetricDescriptor assymetricDescriptor)
id
- component iddataProvider
- data providerrows
- @NotNull false (null implies allRows = true)public AssymetricDescriptor getAssymetricDescriptor()
public void setAssymetricDescriptor(AssymetricDescriptor assymetricDescriptor)
public boolean isAllRows()
public void setAllRows(boolean allRows)
boolean
- public int getColumns()
public AssymetricGridView<T> setColumns(int cols)
cols
- number of columnspublic int getRows()
public AssymetricGridView<T> setRows(int rows)
rows
- number of rowsprotected void updateItemsPerPage()
protected abstract boolean currentCellMerged(int currentRow, int currentCol)
protected abstract boolean currentCellEmpty(int currentRow, int currentCol)
IDataProvider
.protected abstract boolean currentItemInMergedCell(int index)
index
- as integer (base starts @ 0)protected void addItems(Iterator<org.apache.wicket.markup.repeater.Item<T>> items)
addItems
in class org.apache.wicket.markup.repeater.RefreshingView<T>
items
- as < Item < T > >
protected void customizeCell(org.apache.wicket.markup.repeater.Item<T> cellItem, int row, int col)
public org.apache.wicket.markup.repeater.data.IDataProvider<T> getDataProvider()
public Iterator<org.apache.wicket.markup.repeater.Item<T>> getItems()
getItems
in class org.apache.wicket.markup.repeater.RefreshingView<T>
RefreshingView.getItems()
protected abstract void populateEmptyItem(org.apache.wicket.markup.repeater.Item<T> item, int row, int col)
item
- Item objectprotected org.apache.wicket.markup.repeater.Item<T> newEmptyItem(String id, int index)
id
- index
- protected org.apache.wicket.markup.repeater.Item<?> newRowItem(String id, int index)
id
- index
- Copyright © 2018. All rights reserved.