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.

LabelStyles.java 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package com.vaadin.tests.components.label;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.tests.components.AbstractReindeerTestUI;
  4. import com.vaadin.ui.GridLayout;
  5. import com.vaadin.ui.Label;
  6. import com.vaadin.ui.Panel;
  7. import com.vaadin.v7.ui.themes.Reindeer;
  8. public class LabelStyles extends AbstractReindeerTestUI {
  9. @Override
  10. protected void setup(VaadinRequest request) {
  11. addComponent(createPanel(null, 1));
  12. addComponent(createPanel(null, 2));
  13. addComponent(createPanel(Reindeer.LABEL_SMALL, 1));
  14. addComponent(createPanel(Reindeer.LABEL_SMALL, 2));
  15. addComponent(createPanel(Reindeer.LABEL_H1, 1));
  16. addComponent(createPanel(Reindeer.LABEL_H1, 2));
  17. addComponent(createPanel(Reindeer.LABEL_H2, 1));
  18. addComponent(createPanel(Reindeer.LABEL_H2, 2));
  19. }
  20. private Panel createPanel(String styleName, int labels) {
  21. Panel p = new Panel("");
  22. if (styleName != null) {
  23. p.setCaption(styleName);
  24. }
  25. GridLayout layout = new GridLayout();
  26. p.setContent(layout);
  27. // ((VerticalLayout) p.getContent()).setMargin(false);
  28. p.setSizeUndefined();
  29. layout.setSizeUndefined();
  30. for (int i = 0; i < labels; i++) {
  31. Label l = new Label("Label " + i);
  32. if (styleName != null) {
  33. l.setStyleName(styleName);
  34. }
  35. layout.addComponent(l);
  36. }
  37. return p;
  38. }
  39. @Override
  40. protected String getTestDescription() {
  41. // TODO Auto-generated method stub
  42. return null;
  43. }
  44. @Override
  45. protected Integer getTicketNumber() {
  46. // TODO Auto-generated method stub
  47. return null;
  48. }
  49. }