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 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright 2000-2016 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.tests.components;
  17. import com.vaadin.server.VaadinRequest;
  18. import com.vaadin.ui.Label;
  19. import com.vaadin.ui.Panel;
  20. import com.vaadin.ui.VerticalLayout;
  21. import com.vaadin.v7.ui.TextField;
  22. /**
  23. * Test to see if AbstractOrderedLayout displays captions correctly with
  24. * expanding ratios.
  25. *
  26. * @author Vaadin Ltd
  27. */
  28. public class AbstractOrderedLayoutWithCaptions extends AbstractReindeerTestUI {
  29. @Override
  30. protected void setup(VaadinRequest request) {
  31. VerticalLayout layout = new VerticalLayout();
  32. layout.setSizeFull();
  33. TextField textField = new TextField("Input Text:");
  34. Label label1 = new Label("LABEL 1");
  35. Label label2 = new Label("LABEL 2");
  36. label1.setWidth("100%"); // Only to make test backwards compatible
  37. label2.setWidth("100%"); // Only to make test backwards compatible
  38. layout.addComponent(textField);
  39. layout.addComponent(label1);
  40. layout.setExpandRatio(label1, 1.0f);
  41. layout.addComponent(label2);
  42. Panel containingPanel = new Panel(layout);
  43. containingPanel.setHeight("200px");
  44. addComponent(containingPanel);
  45. }
  46. /*
  47. * (non-Javadoc)
  48. *
  49. * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription()
  50. */
  51. @Override
  52. protected String getTestDescription() {
  53. return "Test to see if AbstractOrderedLayout calculates captions correctly.";
  54. }
  55. /*
  56. * (non-Javadoc)
  57. *
  58. * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber()
  59. */
  60. @Override
  61. protected Integer getTicketNumber() {
  62. return 13741;
  63. }
  64. }