diff options
author | Marc Englund <marc.englund@itmill.com> | 2009-05-08 11:02:30 +0000 |
---|---|---|
committer | Marc Englund <marc.englund@itmill.com> | 2009-05-08 11:02:30 +0000 |
commit | 127009753aebb2b9739d9c2b06aed0dc00146842 (patch) | |
tree | f0ded787f6b72e29f0e0f00ff43179a041d0ce32 /src/com | |
parent | 81f81c0e3798d290928caf4ba27207a47530da09 (diff) | |
download | vaadin-framework-127009753aebb2b9739d9c2b06aed0dc00146842.tar.gz vaadin-framework-127009753aebb2b9739d9c2b06aed0dc00146842.zip |
TC for #2915
svn changeset:7671/svn branch:6.0
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/itmill/toolkit/tests/layouts/AbsoluteLayoutAddRemove.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/tests/layouts/AbsoluteLayoutAddRemove.java b/src/com/itmill/toolkit/tests/layouts/AbsoluteLayoutAddRemove.java new file mode 100644 index 0000000000..14702a75ff --- /dev/null +++ b/src/com/itmill/toolkit/tests/layouts/AbsoluteLayoutAddRemove.java @@ -0,0 +1,50 @@ +package com.itmill.toolkit.tests.layouts; + +import com.itmill.toolkit.tests.components.TestBase; +import com.itmill.toolkit.ui.AbsoluteLayout; +import com.itmill.toolkit.ui.Button; +import com.itmill.toolkit.ui.Label; +import com.itmill.toolkit.ui.Layout; +import com.itmill.toolkit.ui.Button.ClickEvent; + +public class AbsoluteLayoutAddRemove extends TestBase { + + @Override + protected String getDescription() { + return "Tests that addComponent() and removeComponent() works"; + } + + @Override + protected Integer getTicketNumber() { + return 2915; + } + + @Override + protected void setup() { + Layout main = getLayout(); + + final Label l = new Label("A Label"); + final AbsoluteLayout al = new AbsoluteLayout(); + al.setWidth("300px"); + al.setHeight("200px"); + main.addComponent(al); + + final Button b = new Button("Add", new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + if (l.getParent() == null) { + al.addComponent(l); + event.getButton().setCaption("Remove"); + } else { + al.removeComponent(l); + event.getButton().setCaption("Add"); + } + + } + + }); + main.addComponent(b); + + } + +} |