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.

AbstractOrderedLayoutWithCaptions.java 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package com.vaadin.tests.components;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.ui.Label;
  4. import com.vaadin.ui.Panel;
  5. import com.vaadin.ui.VerticalLayout;
  6. import com.vaadin.v7.ui.TextField;
  7. /**
  8. * Test to see if AbstractOrderedLayout displays captions correctly with
  9. * expanding ratios.
  10. *
  11. * @author Vaadin Ltd
  12. */
  13. public class AbstractOrderedLayoutWithCaptions extends AbstractReindeerTestUI {
  14. @Override
  15. protected void setup(VaadinRequest request) {
  16. VerticalLayout layout = new VerticalLayout();
  17. layout.setSizeFull();
  18. TextField textField = new TextField("Input Text:");
  19. Label label1 = new Label("LABEL 1");
  20. Label label2 = new Label("LABEL 2");
  21. label1.setWidth("100%"); // Only to make test backwards compatible
  22. label2.setWidth("100%"); // Only to make test backwards compatible
  23. layout.addComponent(textField);
  24. layout.addComponent(label1);
  25. layout.setExpandRatio(label1, 1.0f);
  26. layout.addComponent(label2);
  27. Panel containingPanel = new Panel(layout);
  28. containingPanel.setHeight("200px");
  29. addComponent(containingPanel);
  30. }
  31. /*
  32. * (non-Javadoc)
  33. *
  34. * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription()
  35. */
  36. @Override
  37. protected String getTestDescription() {
  38. return "Test to see if AbstractOrderedLayout calculates captions correctly.";
  39. }
  40. /*
  41. * (non-Javadoc)
  42. *
  43. * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber()
  44. */
  45. @Override
  46. protected Integer getTicketNumber() {
  47. return 13741;
  48. }
  49. }