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.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright 2000-2014 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.legacy.ui.LegacyTextField;
  18. import com.vaadin.server.VaadinRequest;
  19. import com.vaadin.ui.Label;
  20. import com.vaadin.ui.Panel;
  21. import com.vaadin.ui.VerticalLayout;
  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 AbstractTestUI {
  29. @Override
  30. protected void setup(VaadinRequest request) {
  31. VerticalLayout layout = new VerticalLayout();
  32. layout.setSizeFull();
  33. LegacyTextField textField = new LegacyTextField("Input Text:");
  34. Label label1 = new Label("LABEL 1");
  35. Label label2 = new Label("LABEL 2");
  36. layout.addComponent(textField);
  37. layout.addComponent(label1);
  38. layout.setExpandRatio(label1, 1.0f);
  39. layout.addComponent(label2);
  40. Panel containingPanel = new Panel(layout);
  41. containingPanel.setHeight("200px");
  42. addComponent(containingPanel);
  43. }
  44. /*
  45. * (non-Javadoc)
  46. *
  47. * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription()
  48. */
  49. @Override
  50. protected String getTestDescription() {
  51. return "Test to see if AbstractOrderedLayout calculates captions correctly.";
  52. }
  53. /*
  54. * (non-Javadoc)
  55. *
  56. * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber()
  57. */
  58. @Override
  59. protected Integer getTicketNumber() {
  60. return 13741;
  61. }
  62. }