blob: 6b71ab6510a0f47a125d0b5bf92b8e86f4dac831 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
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.CustomLayout;
import com.vaadin.v7.ui.TextField;
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 TextField("Hello world"), "loc1");
cl.setPrimaryStyleName("my-customlayout");
addComponent(cl);
addComponent(new Button("Set primary stylename",
event -> cl.setPrimaryStyleName("my-second-customlayout")));
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
protected String getDescription() {
return "CustomLayout should support primary stylenames both initially and dynamically";
}
@Override
protected Integer getTicketNumber() {
return 9902;
}
}
|