123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- package com.vaadin.tests.components.customlayout;
-
- import java.io.ByteArrayInputStream;
- import java.io.IOException;
- import java.io.InputStream;
-
- import com.vaadin.tests.components.TestBase;
- import com.vaadin.ui.Button;
- import com.vaadin.ui.Button.ClickEvent;
- import com.vaadin.ui.CustomLayout;
- import com.vaadin.v7.ui.LegacyTextField;
-
- public class CustomLayoutPrimaryStyleName extends TestBase {
-
- @Override
- protected void setup() {
- InputStream is = new ByteArrayInputStream(
- "<div location='loc1'>".getBytes());
- try {
- final CustomLayout cl = new CustomLayout(is);
-
- cl.addComponent(new LegacyTextField("Hello world"), "loc1");
-
- cl.setPrimaryStyleName("my-customlayout");
- addComponent(cl);
-
- addComponent(new Button("Set primary stylename",
- new Button.ClickListener() {
- @Override
- public void buttonClick(ClickEvent event) {
- cl.setPrimaryStyleName("my-second-customlayout");
- }
- }));
-
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- @Override
- protected String getDescription() {
- return "CustomLayout should support primary stylenames both initially and dynamically";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return 9902;
- }
-
- }
|