org.uqbar.wicket.xtend.XListView.xtend Maven / Gradle / Ivy
package org.uqbar.wicket.xtend
import java.util.List
import org.apache.wicket.markup.html.list.ListItem
import org.apache.wicket.markup.html.list.ListView
import org.apache.wicket.model.IModel
import org.eclipse.xtend.lib.annotations.Accessors
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1
/**
* Extends wicket's {@link ListView} to adapt it
* to use xtend's closures.
* By introducing composition instead of inheritance.
*
* @author jfernandes
*/
@Accessors
class XListView extends ListView {
Procedure1> populateItem
new(String id) { super(id) }
new(String id, IModel extends List extends T>> model) { super(id, model) }
new(String id, List extends T> list) { super(id, list) }
override populateItem(ListItem item) {
populateItem.apply(item)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy