package com.itmill.dev.addressbooktutorial.ui; import com.itmill.dev.addressbooktutorial.AddressBookApplication; import com.itmill.dev.addressbooktutorial.data.PersonContainer; import com.itmill.toolkit.ui.Table; public class PersonList extends Table { public PersonList(AddressBookApplication app) { setSizeFull(); setContainerDataSource(app.getDataSource()); setVisibleColumns(PersonContainer.NATURAL_COL_ORDER); setColumnHeaders(PersonContainer.COL_HEADERS_ENGLISH); /* * Make table selectable, react immediatedly to user events, and pass * events to the controller (our main application) */ setSelectable(true); setImmediate(true); addListener((ValueChangeListener) app); /* We don't want to allow users to de-select a row */ setNullSelectionAllowed(false); } }