From b68f541f11c782312a56908cb4b94c043553b5ab Mon Sep 17 00:00:00 2001 From: Paola De Bartolo Date: Fri, 29 Sep 2023 15:24:13 -0300 Subject: [PATCH] fix(demo): reorder "roles" column Close #8 --- .../vaadin/addons/badgelist/BadgeListDemo.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/test/java/com/flowingcode/vaadin/addons/badgelist/BadgeListDemo.java b/src/test/java/com/flowingcode/vaadin/addons/badgelist/BadgeListDemo.java index 59ac3da..ee3efb7 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/badgelist/BadgeListDemo.java +++ b/src/test/java/com/flowingcode/vaadin/addons/badgelist/BadgeListDemo.java @@ -38,21 +38,19 @@ public BadgeListDemo() { grid.addColumn(Person::getFirstName).setHeader("First Name").setAutoWidth(true).setFlexGrow(0); grid.addColumn(Person::getLastName).setHeader("Last Name").setAutoWidth(true).setFlexGrow(0); + grid.addComponentColumn( + person -> { + List badges = new ArrayList<>(); + person.getRoles().forEach(role -> badges.add(new Badge(role))); + return new BadgeList(badges); + }) + .setHeader("Roles") + .setResizable(true); grid.addColumn(Person::getEmailAddress).setHeader("Email").setAutoWidth(true).setFlexGrow(0); grid.addColumn(Person::getPhoneNumber) .setHeader("Phone number") .setAutoWidth(true) .setFlexGrow(0); - - grid.addComponentColumn( - person -> { - List badges = new ArrayList<>(); - person.getRoles().forEach(role -> badges.add(new Badge(role))); - return new BadgeList(badges); - }) - .setHeader("Roles") - .setResizable(true); - grid.addColumn(Person::getTitle).setHeader("Title"); grid.setWidthFull();