use of com.vaadin.v7.data.Container.ItemSetChangeEvent in project SORMAS-Project by hzi-braunschweig.
the class AbstractTableField method initContent.
@Override
protected Component initContent() {
this.addStyleName(CssStyles.CAPTION_HIDDEN);
this.addStyleName(CssStyles.VSPACE_2);
layout = new VerticalLayout();
layout.setSpacing(false);
layout.setMargin(false);
HorizontalLayout headerLayout = new HorizontalLayout();
{
headerLayout.setWidth(100, Unit.PERCENTAGE);
captionLabel = new Label(getCaption());
captionLabel.setSizeUndefined();
headerLayout.addComponent(captionLabel);
headerLayout.setComponentAlignment(captionLabel, Alignment.BOTTOM_LEFT);
headerLayout.setExpandRatio(captionLabel, 0);
addButton = createAddButton();
headerLayout.addComponent(addButton);
headerLayout.setComponentAlignment(addButton, Alignment.BOTTOM_RIGHT);
headerLayout.setExpandRatio(addButton, 1);
}
layout.addComponent(headerLayout);
table = createTable();
table.addItemSetChangeListener(new ItemSetChangeListener() {
@Override
public void containerItemSetChange(ItemSetChangeEvent event) {
applyTablePageLength();
}
});
layout.addComponent(table);
return layout;
}
Aggregations