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.

VerticalRelativeChildren.java 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package com.vaadin.tests.components.orderedlayout;
  2. import com.vaadin.tests.components.TestBase;
  3. import com.vaadin.ui.Alignment;
  4. import com.vaadin.ui.VerticalLayout;
  5. import com.vaadin.v7.ui.TextArea;
  6. public class VerticalRelativeChildren extends TestBase {
  7. @Override
  8. protected void setup() {
  9. VerticalLayout vl = new VerticalLayout();
  10. vl.setWidth("300px");
  11. TextArea areaUndefined = new TextArea();
  12. areaUndefined.setSizeUndefined();
  13. areaUndefined.setValue("Undefined height");
  14. vl.addComponent(areaUndefined);
  15. TextArea areaDefined = new TextArea();
  16. areaDefined.setWidth("200px");
  17. areaDefined.setValue("200px width");
  18. vl.addComponent(areaDefined);
  19. TextArea areaRelativeBottom = new TextArea();
  20. areaRelativeBottom.setWidth("50%");
  21. areaRelativeBottom.setValue("50% width, right align");
  22. vl.addComponent(areaRelativeBottom);
  23. vl.setComponentAlignment(areaRelativeBottom, Alignment.TOP_RIGHT);
  24. TextArea areaRelativeCenter = new TextArea();
  25. areaRelativeCenter.setWidth("50%");
  26. areaRelativeCenter.setValue("50% width, center align");
  27. vl.addComponent(areaRelativeCenter);
  28. vl.setComponentAlignment(areaRelativeCenter, Alignment.TOP_CENTER);
  29. TextArea areaRelativeTop = new TextArea();
  30. areaRelativeTop.setWidth("50%");
  31. areaRelativeTop.setValue("50% width, left align");
  32. vl.addComponent(areaRelativeTop);
  33. vl.setComponentAlignment(areaRelativeTop, Alignment.TOP_LEFT);
  34. addComponent(vl);
  35. }
  36. @Override
  37. protected String getDescription() {
  38. // TODO Auto-generated method stub
  39. return null;
  40. }
  41. @Override
  42. protected Integer getTicketNumber() {
  43. // TODO Auto-generated method stub
  44. return null;
  45. }
  46. }