You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MarginsInLabels.java 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package com.vaadin.tests.components.label;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.shared.ui.ContentMode;
  4. import com.vaadin.tests.components.AbstractReindeerTestUI;
  5. import com.vaadin.ui.AbstractLayout;
  6. import com.vaadin.ui.Accordion;
  7. import com.vaadin.ui.GridLayout;
  8. import com.vaadin.ui.Label;
  9. import com.vaadin.ui.TabSheet;
  10. import com.vaadin.ui.VerticalLayout;
  11. public class MarginsInLabels extends AbstractReindeerTestUI {
  12. @Override
  13. protected void setup(VaadinRequest request) {
  14. AbstractLayout layout = new VerticalLayout();
  15. layout.addComponent(
  16. new Label("<h1>Vertical layout</h1>", ContentMode.HTML));
  17. layout.addComponent(new Label("Next row"));
  18. addComponent(layout);
  19. layout = new GridLayout(1, 2);
  20. layout.setWidth("100%");
  21. layout.addComponent(
  22. new Label("<h1>Grid layout</h1>", ContentMode.HTML));
  23. layout.addComponent(new Label("Next row"));
  24. addComponent(layout);
  25. TabSheet tabSheet = new TabSheet();
  26. tabSheet.addTab(new Label("<h1>Tabsheet</h1>", ContentMode.HTML),
  27. "Label");
  28. addComponent(tabSheet);
  29. Accordion accordion = new Accordion();
  30. accordion.addTab(new Label("<h1>Accordion</h1>", ContentMode.HTML),
  31. "Label");
  32. addComponent(accordion);
  33. }
  34. @Override
  35. protected String getTestDescription() {
  36. return "Margins inside labels should not be allowed to collapse out of the label as it causes problems with layotus measuring the label.";
  37. }
  38. @Override
  39. protected Integer getTicketNumber() {
  40. return Integer.valueOf(8671);
  41. }
  42. }