選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

NewSelectionAfterTabRemove.java 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package com.vaadin.tests.components.tabsheet;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.tests.components.AbstractReindeerTestUI;
  4. import com.vaadin.ui.Label;
  5. import com.vaadin.ui.TabSheet;
  6. import com.vaadin.ui.TabSheet.Tab;
  7. /**
  8. * In case a selected tab is removed the new selected one should be a neighbor.
  9. *
  10. * In case an unselected tab is removed and the selected one is not visible, the
  11. * scroll should not jump to the selected one.
  12. *
  13. * @author Vaadin Ltd
  14. */
  15. public class NewSelectionAfterTabRemove extends AbstractReindeerTestUI {
  16. @Override
  17. protected void setup(VaadinRequest request) {
  18. TabSheet tabSheet = new TabSheet();
  19. for (int i = 0; i < 20; i++) {
  20. String caption = "Tab " + i;
  21. Label label = new Label(caption);
  22. Tab tab = tabSheet.addTab(label, caption);
  23. tab.setClosable(true);
  24. }
  25. addComponent(tabSheet);
  26. }
  27. @Override
  28. protected String getTestDescription() {
  29. return "When a selected tab is removed, its neighbor should become selected.";
  30. }
  31. @Override
  32. protected Integer getTicketNumber() {
  33. return 6876;
  34. }
  35. }