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.

TableTooManyColumns.java 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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.table;
  17. import com.vaadin.server.VaadinRequest;
  18. import com.vaadin.tests.components.AbstractTestUI;
  19. import com.vaadin.ui.Table;
  20. import com.vaadin.ui.Table.ColumnGenerator;
  21. public class TableTooManyColumns extends AbstractTestUI {
  22. @Override
  23. protected void setup(VaadinRequest request) {
  24. Table table = new Table();
  25. table.setColumnCollapsingAllowed(true);
  26. for (int i = 0; i < 91; i++) {
  27. table.addGeneratedColumn("COLUMN " + i, new ColumnGenerator() {
  28. @Override
  29. public Object generateCell(Table source, Object itemId,
  30. Object columnId) {
  31. return columnId;
  32. }
  33. });
  34. }
  35. addComponent(table);
  36. }
  37. /*
  38. * (non-Javadoc)
  39. *
  40. * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription()
  41. */
  42. @Override
  43. protected String getTestDescription() {
  44. return "Table column drop down becomes too large to fit the screen.";
  45. }
  46. /*
  47. * (non-Javadoc)
  48. *
  49. * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber()
  50. */
  51. @Override
  52. protected Integer getTicketNumber() {
  53. return 14156;
  54. }
  55. }