diff options
author | Jonatan Kronqvist <jonatan.kronqvist@itmill.com> | 2011-08-24 11:14:51 +0000 |
---|---|---|
committer | Jonatan Kronqvist <jonatan.kronqvist@itmill.com> | 2011-08-24 11:14:51 +0000 |
commit | bd0df87dabc8b66877d54e576d89de0ba3d8ad9e (patch) | |
tree | dc2a26b51de97a471aab4e979b79e54bedd5e8dc /tests | |
parent | f10053dab3a47729491d70609e8f89592da9df7f (diff) | |
download | vaadin-framework-bd0df87dabc8b66877d54e576d89de0ba3d8ad9e.tar.gz vaadin-framework-bd0df87dabc8b66877d54e576d89de0ba3d8ad9e.zip |
Test case for ticket #7462
svn changeset:20610/svn branch:6.7
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/vaadin/tests/components/panel/PanelShouldNotScroll.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/panel/PanelShouldNotScroll.java b/tests/src/com/vaadin/tests/components/panel/PanelShouldNotScroll.java new file mode 100644 index 0000000000..7c537fe710 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/panel/PanelShouldNotScroll.java @@ -0,0 +1,56 @@ +package com.vaadin.tests.components.panel; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.Component; +import com.vaadin.ui.CssLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.Panel; +import com.vaadin.ui.VerticalLayout; + +public class PanelShouldNotScroll extends TestBase { + + private Button addMore; + + @Override + protected void setup() { + final Panel p = new Panel(new CssLayout()); + p.setScrollable(true); + p.setSizeFull(); + p.setHeight("600px"); + p.addComponent(foo()); + addMore = new Button("Add"); + addMore.addListener(new ClickListener() { + public void buttonClick(ClickEvent event) { + p.removeComponent(addMore); + p.addComponent(foo()); + p.addComponent(addMore); + } + }); + p.addComponent(addMore); + addComponent(p); + ((VerticalLayout) getMainWindow().getContent()).setSizeFull(); + } + + private Component foo() { + Panel panel = new Panel(); + panel.addComponent(new Label( + "fooooooooo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>" + + "foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>", + Label.CONTENT_XHTML)); + return panel; + } + + @Override + protected String getDescription() { + return "adding a panel to the bottom of the scrolling panel should not scroll up to the top"; + } + + @Override + protected Integer getTicketNumber() { + return 7462; + } + +} |