<td></td>
</tr>
<tr>
- <td>verifyTextPresent</td>
- <td>exact:1: Size 200x200 pixels</td>
- <td></td>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::PID_SLog_row_0</td>
+ <td>1. Size 200x200 pixels</td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
</tr>
<tr>
- <td>verifyTextPresent</td>
- <td>exact:2: Size 600x200 pixels<br />1: Size 200x200 pixels</td>
- <td></td>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::PID_SLog_row_0</td>
+ <td>2. Size 600x200 pixels</td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
</tr>
<tr>
- <td>verifyTextPresent</td>
- <td>exact:3: Size undefined<br />2: Size 600x200 pixels<br />1: Size 200x200 pixels</td>
- <td></td>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::PID_SLog_row_0</td>
+ <td>3. Size undefined</td>
</tr>
<tr>
<td>select</td>
<td>label=4</td>
</tr>
<tr>
- <td>verifyTextPresent</td>
- <td>exact:4: Page length: 4<br />3: Size undefined<br />2: Size 600x200 pixels<br />1: Size 200x200 pixels</td>
- <td></td>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::PID_SLog_row_0</td>
+ <td>4. Page length: 4</td>
</tr>
<tr>
<td>screenCapture</td>
<td>3,6</td>
</tr>
<tr>
- <td>verifyTextPresent</td>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td>
<td>Column 2</td>
- <td></td>
</tr>
<tr>
- <td>verifyTextPresent</td>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[2]</td>
<td>Column 3</td>
- <td></td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
<td>AllColumnsShown</td>
</tr>
-
</tbody></table>
</body>
</html>
import com.vaadin.data.Container;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.util.IndexedContainer;
-import com.vaadin.data.util.ObjectProperty;
import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.Table;
public class TableUndefinedSize extends TestBase {
- private ObjectProperty<String> output = new ObjectProperty<String>("");
-
- private int counter = 1;
+ private Log log;
@Override
protected void setup() {
tbl.setImmediate(true);
tbl.setColumnCollapsingAllowed(true);
- Label output = new Label(this.output);
- output.setWidth("400px");
- output.setHeight("100px");
- output.setContentMode(Label.CONTENT_XHTML);
+ log = new Log(5);
controls.addComponent(new Button("Fixed size (200x200)",
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
tbl.setWidth("200px");
tbl.setHeight("200px");
- print("Size 200x200 pixels");
+ log.log("Size 200x200 pixels");
}
}));
public void buttonClick(ClickEvent event) {
tbl.setWidth("600px");
tbl.setHeight("200px");
- print("Size 600x200 pixels");
+ log.log("Size 600x200 pixels");
}
}));
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
tbl.setSizeUndefined();
- print("Size undefined");
+ log.log("Size undefined");
}
}));
int pageLength = Integer.valueOf(event.getProperty().getValue()
.toString());
tbl.setPageLength(pageLength);
- print("Page length: " + pageLength);
+ log.log("Page length: " + pageLength);
}
});
controls.addComponent(pageLength);
- CheckBox cb = new CheckBox("Column 1", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- tbl.setColumnCollapsed("Column 1", !event.getButton()
- .booleanValue());
- if (event.getButton().booleanValue()) {
- print("Column 1 visible");
+ CheckBox cb = new CheckBox("Column 1");
+ cb.setValue(true);
+ cb.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ Boolean value = (Boolean) event.getProperty().getValue();
+ tbl.setColumnCollapsed("Column 1", !value);
+ if (value) {
+ log.log("Column 1 visible");
} else {
- print("Column 1 hidden");
+ log.log("Column 1 hidden");
}
- }
+ }
});
cb.setImmediate(true);
- cb.setValue(true);
visibilities.addComponent(cb);
- cb = new CheckBox("Column 2", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- tbl.setColumnCollapsed("Column 2", !event.getButton()
- .booleanValue());
+ cb = new CheckBox("Column 2");
+ cb.setValue(true);
+ cb.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ Boolean value = (Boolean) event.getProperty().getValue();
+ tbl.setColumnCollapsed("Column 2", !value);
- if (event.getButton().booleanValue()) {
- print("Column 2 visible");
+ if (value) {
+ log.log("Column 2 visible");
} else {
- print("Column 2 hidden");
+ log.log("Column 2 hidden");
}
}
});
cb.setImmediate(true);
- cb.setValue(true);
visibilities.addComponent(cb);
- cb = new CheckBox("Column 3", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- tbl.setColumnCollapsed("Column 3", !event.getButton()
- .booleanValue());
+ cb = new CheckBox("Column 3");
+ cb.setValue(true);
+ cb.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ Boolean value = (Boolean) event.getProperty().getValue();
- if (event.getButton().booleanValue()) {
- print("Column 3 visible");
+ tbl.setColumnCollapsed("Column 3", !value);
+
+ if (value) {
+ log.log("Column 3 visible");
} else {
- print("Column 3 hidden");
+ log.log("Column 3 hidden");
}
}
});
cb.setImmediate(true);
- cb.setValue(true);
visibilities.addComponent(cb);
- addComponent(output);
+ addComponent(log);
addComponent(tbl);
}
- protected void print(String message) {
- output.setValue(counter + ": " + message + "<br/>" + output.getValue());
- counter++;
- }
-
protected Container createDataSource() {
IndexedContainer c = new IndexedContainer();
c.addContainerProperty("Column 1", String.class, "Column 1");