table.removeContainerProperty("progress");
table.removeGeneratedColumn("progress");
if (componentsInRows) {
table.addContainerProperty("textfield", TextField.class, null);
table.addGeneratedColumn("textfield", new ColumnGenerator() {
@Override
public Object generateCell(Table source, Object itemId,
Object columnId) {
TextField tf = new TextField();
tf.setInputPrompt("Type hereā¦");
// tf.addStyleName("compact");
if ((Integer) itemId % 2 == 0) {
tf.addStyleName("borderless");
}
return tf;
}
});
table.addContainerProperty("datefield", TextField.class, null);
table.addGeneratedColumn("datefield", new ColumnGenerator() {
@Override
public Object generateCell(Table source, Object itemId,
Object columnId) {
DateField tf = new DateField();
tf.addStyleName("compact");
if ((Integer) itemId % 2 == 0) {
tf.addStyleName("borderless");
}
return tf;
}
});
table.addContainerProperty("combobox", TextField.class, null);
table.addGeneratedColumn("combobox", new ColumnGenerator() {
@Override
public Object generateCell(Table source, Object itemId,
Object columnId) {
ComboBox tf = new ComboBox();
tf.setInputPrompt("Select");
tf.addStyleName("compact");
if ((Integer) itemId % 2 == 0) {
tf.addStyleName("borderless");
}
return tf;
}
});
table.addContainerProperty("button", Button.class, null);
table.addGeneratedColumn("button", new ColumnGenerator() {
@Override
public Object generateCell(Table source, Object itemId,
Object columnId) {
Button b = new Button("Button");
b.addStyleName("small");
return b;
}
});
table.addContainerProperty("label", TextField.class, null);
table.addGeneratedColumn("label", new ColumnGenerator() {
@Override
public Object generateCell(Table source, Object itemId,
Object columnId) {
Label label = new Label("Label component");
label.setSizeUndefined();
label.addStyleName("bold");
return label;
}
});
table.addContainerProperty("checkbox", TextField.class, null);
table.addGeneratedColumn("checkbox", new ColumnGenerator() {
@Override
public Object generateCell(Table source, Object itemId,
Object columnId) {
CheckBox cb = new CheckBox(null, true);
return cb;
}
});
table.addContainerProperty("optiongroup", TextField.class, null);
table.addGeneratedColumn("optiongroup", new ColumnGenerator() {
@Override
public Object generateCell(Table source, Object itemId,
Object columnId) {
OptionGroup op = new OptionGroup();
op.addItem("Male");
op.addItem("Female");
op.addStyleName("horizontal");
return op;
}
});
table.addContainerProperty("slider", TextField.class, null);
table.addGeneratedColumn("slider", new ColumnGenerator() {
@Override
public Object generateCell(Table source, Object itemId,
Object columnId) {
Slider s = new Slider();
s.setValue(30.0);
return s;
}
});
table.addContainerProperty("progress", TextField.class, null);
table.addGeneratedColumn("progress", new ColumnGenerator() {
@Override
public Object generateCell(Table source, Object itemId,
Object columnId) {
ProgressBar bar = new ProgressBar();
bar.setValue(0.7f);