1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- package com.vaadin.tests.components.formlayout;
-
- import com.vaadin.tests.components.TestBase;
- import com.vaadin.ui.Button;
- import com.vaadin.ui.FormLayout;
- import com.vaadin.v7.ui.TextField;
-
- public class FormLayoutCaptionStyles extends TestBase {
-
- @Override
- protected void setup() {
- setTheme("reindeer-tests");
- FormLayout fl = new FormLayout();
-
- TextField f1 = createTextField("Text field 1", "");
- final TextField f2 = createTextField("Text field 2", "bold");
-
- fl.addComponent(f1);
- fl.addComponent(new Button("Toggle Text field 2 bold style", event -> {
- if ("bold".equals(f2.getStyleName())) {
- f2.setStyleName("");
- } else {
- f2.setStyleName("bold");
- }
- }));
- fl.addComponent(f2);
-
- addComponent(fl);
- }
-
- private TextField createTextField(String caption, String style) {
- TextField tf = new TextField(caption);
- tf.setStyleName(style);
- return tf;
- }
-
- @Override
- protected String getDescription() {
- return "The component style should be copied to the caption element. Changing the component style should update the caption style also";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return 5982;
- }
-
- }
|