diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-06-12 16:00:17 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-06-12 16:00:17 +0300 |
commit | ab53fcaf5924e4dc471147c55674d0d7882e4fc1 (patch) | |
tree | f73c39259ee983a0cca4d47b4878cee9754dc639 | |
parent | 798537805ba3b1bdf47e9bf96765920a89656a0e (diff) | |
download | vaadin-framework-ab53fcaf5924e4dc471147c55674d0d7882e4fc1.tar.gz vaadin-framework-ab53fcaf5924e4dc471147c55674d0d7882e4fc1.zip |
Test app for #8714
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java b/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java new file mode 100644 index 0000000000..811bdd3433 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java @@ -0,0 +1,116 @@ +package com.vaadin.tests.components.table; + +import java.net.MalformedURLException; + +import com.vaadin.terminal.WrappedRequest; +import com.vaadin.terminal.gwt.client.ui.label.ContentMode; +import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.ui.AbsoluteLayout; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.TabSheet; +import com.vaadin.ui.Table; +import com.vaadin.ui.Table.Align; +import com.vaadin.ui.VerticalLayout; +import com.vaadin.ui.themes.Reindeer; + +public class TableInTabsheet extends AbstractTestRoot { + + @Override + protected void setup(WrappedRequest request) { + getRoot().setCaption("test"); + VerticalLayout vPrinc = new VerticalLayout(); + vPrinc.setStyleName(Reindeer.LAYOUT_BLUE); + + vPrinc.addComponent(title()); + vPrinc.addComponent(page()); + vPrinc.addComponent(new Label("Dvlop Tecnologia.")); + setContent(vPrinc); + } + + private VerticalLayout title() { + + VerticalLayout vP = new VerticalLayout(); + vP.setStyleName(Reindeer.LAYOUT_BLACK); + Label tit = new Label("<h1> Tab/Table Test</h1>", ContentMode.XHTML); + vP.addComponent(tit); + return vP; + + } + + private VerticalLayout page() { + + VerticalLayout vP = new VerticalLayout(); + vP.setStyleName(Reindeer.LAYOUT_BLUE); + TabSheet t = new TabSheet(); + t.setWidth(1000, Unit.PIXELS); + + HorizontalLayout hP = new HorizontalLayout(); + t.addTab(Ranking(), "Ranking"); + try { + + t.addTab(GDocs(""), "Dez 2011"); + t.addTab(GDocs(""), "Jan 2012"); + t.addTab(GDocs(""), "Abr 2012"); + + } catch (MalformedURLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + hP.addComponent(t); + vP.addComponent(hP); + return vP; + + } + + private AbsoluteLayout Ranking() { + + AbsoluteLayout vT = new AbsoluteLayout(); + vT.setHeight(500, Unit.PIXELS); + vT.setWidth(900, Unit.PIXELS); + vT.setStyleName(Reindeer.LAYOUT_BLUE); + + final Table table = new Table("Ranking Oficial"); + + table.addContainerProperty("Atleta", String.class, null); + table.addContainerProperty("P", String.class, null); + table.addContainerProperty("Dez/11", Integer.class, null); + table.setColumnAlignment("Dez/11", Align.CENTER); + table.addContainerProperty("Jan/12", Integer.class, null); + table.setColumnAlignment("Jan/12", Align.CENTER); + table.addContainerProperty("Abr/12", String.class, null); + table.addContainerProperty("Total", Integer.class, null); + table.setColumnAlignment("Total", Align.CENTER); + + table.addItem(new Object[] { "Araujo", "D.1", 8, 8, " ", 16 }, 1); + table.addItem(new Object[] { "Claudio", "D.2", 2, 10, " ", 12 }, 2); + table.setPageLength(12); + + vT.addComponent(table, "left: 50px; top: 50px;"); + return vT; + + } + + private VerticalLayout GDocs(String end) throws MalformedURLException { + + VerticalLayout vT = new VerticalLayout(); + vT.setHeight(500, Unit.PIXELS); + vT.setWidth(900, Unit.PIXELS); + + return vT; + + } + + @Override + protected String getTestDescription() { + // TODO Auto-generated method stub + return null; + } + + @Override + protected Integer getTicketNumber() { + // TODO Auto-generated method stub + return null; + } + +} |