public RowRenderer getAdvanceTypeRenderer() {
return new RowRenderer() {
@Override
public void render(Row row, Object data) {
final AdvanceType advanceType = (AdvanceType) data;
appendLabelName(row, advanceType);
appendCheckboxEnabled(row, advanceType);
appendCheckboxPredefined(row, advanceType);
appendOperations(row, advanceType);
row.addEventListener(Events.ON_CLICK, new EventListener() {
@Override
public void onEvent(Event event) {
goToEditForm(advanceType);
}
});
}
private void appendLabelName(Row row, AdvanceType advanceType) {
row.appendChild(new Label(advanceType.getUnitName()));
}
private void appendCheckboxEnabled(Row row, AdvanceType advanceType) {
Checkbox checkbox = new Checkbox();
checkbox.setChecked(advanceType.getActive());
checkbox.setDisabled(true);
row.appendChild(checkbox);
}
private void appendCheckboxPredefined(Row row,
AdvanceType advanceType) {
Checkbox checkbox = new Checkbox();
checkbox.setChecked(advanceType.isImmutable());
checkbox.setDisabled(true);
row.appendChild(checkbox);
}
private void appendOperations(Row row, final AdvanceType advanceType) {