org.ujorm.wicket.component.grid
Class KeyPopulator<UJO extends Ujo,T>

java.lang.Object
  extended by org.ujorm.wicket.component.grid.KeyPopulator<UJO,T>
Type Parameters:
UJO -
All Implemented Interfaces:
Serializable, org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator<UJO>, org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn<UJO,Key<UJO,T>>, org.apache.wicket.model.IDetachable, org.apache.wicket.util.io.IClusterable

public class KeyPopulator<UJO extends Ujo,T>
extends Object
implements org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator<UJO>, org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn<UJO,Key<UJO,T>>

A convenience implementation of ICellPopulator that adds a label that will display the value of the specified key. Non-string properties will be converted to a string before display.

Example:

 List<ICellPopulator> columns = KeyPopulator.list
         ( Employee.ID
         , Employee.FIRSTNAME
         , Employee.LASTNAME
         , Employee.EMAIL
         );
 
 final WebMarkupContainer table = new WebMarkupContainer("table");
 final DataGridView grid = new DataGridView("gridPanel", columns, new InnerPeopleProvicer());
 table.setOutputMarkupId(true);
 grid.setItemsPerPage(20);
 add(table);
 table.add(grid);
 add(new AjaxPagingNavigator("tableNavigator", grid));
 

Author:
Igor Vaynberg (ivaynberg), Pavel Ponec
See Also:
Serialized Form

Constructor Summary
KeyPopulator(Key<UJO,?> key)
           
KeyPopulator(KeyRing<UJO> key)
           
 
Method Summary
 void detach()
           
 org.apache.wicket.Component getHeader(String componentId)
           
 Key<UJO,T> getSortProperty()
           
 boolean isSortable()
           
static
<UJO extends Ujo>
List<org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator>
list(Key<? super UJO,?>... properties)
          Create new ICellPopulator List with a pupulator with no generic item type for easy use
 void populateItem(org.apache.wicket.markup.repeater.Item<org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator<UJO>> cellItem, String componentId, org.apache.wicket.model.IModel<UJO> rowModel)
           
static
<UJO extends Ujo>
List<org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator<UJO>>
safeList(Key<UJO,?>... properties)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyPopulator

public KeyPopulator(KeyRing<UJO> key)

KeyPopulator

public KeyPopulator(Key<UJO,?> key)
Method Detail

detach

public void detach()
Specified by:
detach in interface org.apache.wicket.model.IDetachable
See Also:
IDetachable.detach()

populateItem

public void populateItem(org.apache.wicket.markup.repeater.Item<org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator<UJO>> cellItem,
                         String componentId,
                         org.apache.wicket.model.IModel<UJO> rowModel)
Specified by:
populateItem in interface org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator<UJO extends Ujo>
See Also:
ICellPopulator.populateItem(org.apache.wicket.markup.repeater.Item, java.lang.String, org.apache.wicket.model.IModel)

getHeader

public org.apache.wicket.Component getHeader(String componentId)
Specified by:
getHeader in interface org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn<UJO extends Ujo,Key<UJO extends Ujo,T>>

getSortProperty

public Key<UJO,T> getSortProperty()
Specified by:
getSortProperty in interface org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn<UJO extends Ujo,Key<UJO extends Ujo,T>>

isSortable

public boolean isSortable()
Specified by:
isSortable in interface org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn<UJO extends Ujo,Key<UJO extends Ujo,T>>

safeList

@Deprecated
public static <UJO extends Ujo> List<org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator<UJO>> safeList(Key<UJO,?>... properties)
Deprecated. 

Create new ICellPopulator List

See Also:
#list(java.lang.Class, org.ujorm.Key[])

list

public static <UJO extends Ujo> List<org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator> list(Key<? super UJO,?>... properties)
Create new ICellPopulator List with a pupulator with no generic item type for easy use



Copyright © 2015. All Rights Reserved.