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.

TableItemIcon.java 1.0KB

123456789101112131415161718192021222324252627282930313233343536
  1. package com.vaadin.tests.components.table;
  2. import com.vaadin.server.ClassResource;
  3. import com.vaadin.server.Resource;
  4. import com.vaadin.tests.components.TestBase;
  5. import com.vaadin.v7.data.Item;
  6. import com.vaadin.v7.ui.Table;
  7. public class TableItemIcon extends TestBase {
  8. @Override
  9. protected Integer getTicketNumber() {
  10. return 2457;
  11. }
  12. @Override
  13. protected String getDescription() {
  14. return "The items in the Table should have icons in the first column (rowheader).";
  15. }
  16. @Override
  17. protected void setup() {
  18. Table table = new Table();
  19. table.addContainerProperty("icon", Resource.class, null);
  20. table.setItemIconPropertyId("icon");
  21. table.setRowHeaderMode(Table.ROW_HEADER_MODE_ICON_ONLY);
  22. getLayout().addComponent(table);
  23. Item item = table.addItem("FI");
  24. item.getItemProperty("icon").setValue(new ClassResource("fi.gif"));
  25. item = table.addItem("SE");
  26. item.getItemProperty("icon").setValue(new ClassResource("se.gif"));
  27. }
  28. }