add data for cards
This commit is contained in:
@@ -37,19 +37,19 @@ public class ComicView extends VerticalLayout {
|
|||||||
@Getter
|
@Getter
|
||||||
Grid<Comic> grid = new Grid<>(Comic.class, false);
|
Grid<Comic> grid = new Grid<>(Comic.class, false);
|
||||||
Grid.Column<Comic> idColumn = grid.addColumn(Comic::getId)
|
Grid.Column<Comic> idColumn = grid.addColumn(Comic::getId)
|
||||||
.setHeader("ID").setResizable(true).setSortable(true);
|
.setHeader("ID").setResizable(true).setSortable(true);
|
||||||
Grid.Column<Comic> createdColumn = grid.addColumn(Comic::getCreatedDate)
|
Grid.Column<Comic> createdColumn = grid.addColumn(Comic::getCreatedDate)
|
||||||
.setHeader("Erstellt").setResizable(true).setSortable(true);
|
.setHeader("Erstellt").setResizable(true).setSortable(true);
|
||||||
Grid.Column<Comic> modifiedColumn = grid.addColumn(Comic::getLastModifiedDate)
|
Grid.Column<Comic> modifiedColumn = grid.addColumn(Comic::getLastModifiedDate)
|
||||||
.setHeader("Geändert").setResizable(true).setSortable(true);
|
.setHeader("Geändert").setResizable(true).setSortable(true);
|
||||||
Grid.Column<Comic> titleColumn = grid.addColumn(Comic::getTitle)
|
Grid.Column<Comic> titleColumn = grid.addColumn(Comic::getTitle)
|
||||||
.setHeader("Titel").setResizable(true).setSortable(true);
|
.setHeader("Titel").setResizable(true).setSortable(true);
|
||||||
Grid.Column<Comic> publisherColumn = grid.addColumn(Comic::getPublisherName)
|
Grid.Column<Comic> publisherColumn = grid.addColumn(Comic::getPublisherName)
|
||||||
.setHeader("Verlag").setResizable(true).setSortable(true);
|
.setHeader("Verlag").setResizable(true).setSortable(true);
|
||||||
Grid.Column<Comic> currentOrderColumn = grid.addComponentColumn(comic -> StatusIcon.create(comic.getCurrentOrder()))
|
Grid.Column<Comic> currentOrderColumn = grid.addComponentColumn(comic -> StatusIcon.create(comic.getCurrentOrder()))
|
||||||
.setHeader("Bestellung").setWidth("6rem").setSortable(true);
|
.setHeader("Bestellung").setWidth("6rem").setSortable(true);
|
||||||
Grid.Column<Comic> completedColumn = grid.addComponentColumn(comic -> StatusIcon.create(comic.getCompleted()))
|
Grid.Column<Comic> completedColumn = grid.addComponentColumn(comic -> StatusIcon.create(comic.getCompleted()))
|
||||||
.setHeader("Abgeschlossen").setWidth("6rem").setSortable(true);
|
.setHeader("Abgeschlossen").setWidth("6rem").setSortable(true);
|
||||||
TextField filterText = new TextField();
|
TextField filterText = new TextField();
|
||||||
@Getter
|
@Getter
|
||||||
ComicForm form;
|
ComicForm form;
|
||||||
|
|||||||
@@ -84,25 +84,25 @@ public class SetupModuleTysc implements ApplicationListener<ContextRefreshedEven
|
|||||||
Team steelers = createTeamIfNotFound(football, "Pittsburgh Steelers", "Steelers");
|
Team steelers = createTeamIfNotFound(football, "Pittsburgh Steelers", "Steelers");
|
||||||
createTeamIfNotFound(football, "Tennessee Titans", "Titans");
|
createTeamIfNotFound(football, "Tennessee Titans", "Titans");
|
||||||
createTeamIfNotFound(football, "Denver Broncos", "Broncos");
|
createTeamIfNotFound(football, "Denver Broncos", "Broncos");
|
||||||
createTeamIfNotFound(football, "Kansas City Chiefs", "Chiefs");
|
Team chiefs = createTeamIfNotFound(football, "Kansas City Chiefs", "Chiefs");
|
||||||
createTeamIfNotFound(football, "Oakland Raiders", "Raiders");
|
Team raiders = createTeamIfNotFound(football, "Oakland Raiders", "Raiders");
|
||||||
createTeamIfNotFound(football, "San Diego Chargers", "Chargers");
|
createTeamIfNotFound(football, "San Diego Chargers", "Chargers");
|
||||||
createTeamIfNotFound(football, "Seattle Seahawks", "Seahawks");
|
Team seahawks = createTeamIfNotFound(football, "Seattle Seahawks", "Seahawks");
|
||||||
createTeamIfNotFound(football, "Arizona Cardinals", "Cardinals");
|
createTeamIfNotFound(football, "Arizona Cardinals", "Cardinals");
|
||||||
createTeamIfNotFound(football, "Dallas Cowboys", "Cowboys");
|
Team cowboys = createTeamIfNotFound(football, "Dallas Cowboys", "Cowboys");
|
||||||
createTeamIfNotFound(football, "New York Giants", "Giants");
|
Team giants = createTeamIfNotFound(football, "New York Giants", "Giants");
|
||||||
createTeamIfNotFound(football, "Philadelphia Eagles", "Eagles");
|
Team eagles = createTeamIfNotFound(football, "Philadelphia Eagles", "Eagles");
|
||||||
Team redskins = createTeamIfNotFound(football, "Washington Redskins", "Redskins");
|
Team redskins = createTeamIfNotFound(football, "Washington Redskins", "Redskins");
|
||||||
createTeamIfNotFound(football, "Chicago Bears", "Bears");
|
createTeamIfNotFound(football, "Chicago Bears", "Bears");
|
||||||
createTeamIfNotFound(football, "Detroit Lions", "Lions");
|
createTeamIfNotFound(football, "Detroit Lions", "Lions");
|
||||||
createTeamIfNotFound(football, "Green Bay Packers", "Packers");
|
createTeamIfNotFound(football, "Green Bay Packers", "Packers");
|
||||||
createTeamIfNotFound(football, "Minnesota Vikings", "Vikings");
|
createTeamIfNotFound(football, "Minnesota Vikings", "Vikings");
|
||||||
createTeamIfNotFound(football, "Tampa Bay Buccaneers", "Buccaneers");
|
createTeamIfNotFound(football, "Tampa Bay Buccaneers", "Buccaneers");
|
||||||
createTeamIfNotFound(football, "Atlanta Falcons", "Falcons");
|
Team falcons = createTeamIfNotFound(football, "Atlanta Falcons", "Falcons");
|
||||||
createTeamIfNotFound(football, "Carolina Panthers", "Panthers");
|
createTeamIfNotFound(football, "Carolina Panthers", "Panthers");
|
||||||
createTeamIfNotFound(football, "New Orleans Saints", "Saints");
|
Team saints = createTeamIfNotFound(football, "New Orleans Saints", "Saints");
|
||||||
createTeamIfNotFound(football, "St.Louis Rams", "Rams");
|
Team rams = createTeamIfNotFound(football, "St.Louis Rams", "Rams");
|
||||||
createTeamIfNotFound(football, "San Francisco 49ers", "49ers");
|
Team sf49ers = createTeamIfNotFound(football, "San Francisco 49ers", "49ers");
|
||||||
createTeamIfNotFound(football, "Houston Texans", "Texans");
|
createTeamIfNotFound(football, "Houston Texans", "Texans");
|
||||||
createTeamIfNotFound(football, "Houston Oilers", "Oilers");
|
createTeamIfNotFound(football, "Houston Oilers", "Oilers");
|
||||||
createTeamIfNotFound(baseball, "Baltimore Orioles", "Orioles");
|
createTeamIfNotFound(baseball, "Baltimore Orioles", "Orioles");
|
||||||
@@ -273,34 +273,35 @@ public class SetupModuleTysc implements ApplicationListener<ContextRefreshedEven
|
|||||||
Player chrisfuamatu = createPlayerIfNotFound("Chris", "Fuamatu-Ma'afala");
|
Player chrisfuamatu = createPlayerIfNotFound("Chris", "Fuamatu-Ma'afala");
|
||||||
Player jeromebettis = createPlayerIfNotFound("Jerome", "Bettis");
|
Player jeromebettis = createPlayerIfNotFound("Jerome", "Bettis");
|
||||||
Player kordellstewart = createPlayerIfNotFound("Kordell", "Stewart");
|
Player kordellstewart = createPlayerIfNotFound("Kordell", "Stewart");
|
||||||
createPlayerIfNotFound("Warren", "Moon");
|
Player warrenmoon = createPlayerIfNotFound("Warren", "Moon");
|
||||||
createPlayerIfNotFound("Kevin", "Lockett");
|
Player kevinlockett = createPlayerIfNotFound("Kevin", "Lockett");
|
||||||
createPlayerIfNotFound("Rich", "Gannon");
|
Player richgannon = createPlayerIfNotFound("Rich", "Gannon");
|
||||||
createPlayerIfNotFound("James", "Jett");
|
Player jamesjett = createPlayerIfNotFound("James", "Jett");
|
||||||
createPlayerIfNotFound("Mack", "Strong");
|
Player mackstrong = createPlayerIfNotFound("Mack", "Strong");
|
||||||
createPlayerIfNotFound("Brock", "Huard");
|
Player brockhuard = createPlayerIfNotFound("Brock", "Huard");
|
||||||
createPlayerIfNotFound("Ricky", "Watters");
|
Player rickywatters = createPlayerIfNotFound("Ricky", "Watters");
|
||||||
createPlayerIfNotFound("Troy", "Aikman");
|
Player troyaikman = createPlayerIfNotFound("Troy", "Aikman");
|
||||||
createPlayerIfNotFound("David", "LaFleur");
|
Player davidlafleur = createPlayerIfNotFound("David", "LaFleur");
|
||||||
createPlayerIfNotFound("Chris", "Brazzell");
|
Player chrisbrazzell = createPlayerIfNotFound("Chris", "Brazzell");
|
||||||
createPlayerIfNotFound("Ron", "Dayne");
|
Player rondayne = createPlayerIfNotFound("Ron", "Dayne");
|
||||||
createPlayerIfNotFound("Na", "Brown");
|
Player nabrowne = createPlayerIfNotFound("Na", "Brown");
|
||||||
createPlayerIfNotFound("Torrance", "Small");
|
Player torrancesmall = createPlayerIfNotFound("Torrance", "Small");
|
||||||
createPlayerIfNotFound("Chad", "Lewis");
|
Player chadlewis = createPlayerIfNotFound("Chad", "Lewis");
|
||||||
createPlayerIfNotFound("Adrian", "Murrell");
|
Player adrianmurrell = createPlayerIfNotFound("Adrian", "Murrell");
|
||||||
createPlayerIfNotFound("Chris", "Chandler");
|
Player mauricesmith = createPlayerIfNotFound("Maurice", "Smith");
|
||||||
createPlayerIfNotFound("Danny", "Kanell");
|
Player chrischandler = createPlayerIfNotFound("Chris", "Chandler");
|
||||||
createPlayerIfNotFound("Ricky", "Williams");
|
Player dannykenell = createPlayerIfNotFound("Danny", "Kanell");
|
||||||
createPlayerIfNotFound("Jeff", "Garcia");
|
Player rickywilliams = createPlayerIfNotFound("Ricky", "Williams");
|
||||||
createPlayerIfNotFound("Tai", "Streets");
|
Player jeffgarcia = createPlayerIfNotFound("Jeff", "Garcia");
|
||||||
createPlayerIfNotFound("Charlie", "Garner");
|
Player taistreets = createPlayerIfNotFound("Tai", "Streets");
|
||||||
createPlayerIfNotFound("Drew", "Bledsoe");
|
Player charliegarner = createPlayerIfNotFound("Charlie", "Garner");
|
||||||
|
Player drewbledsoe = createPlayerIfNotFound("Drew", "Bledsoe");
|
||||||
createPlayerIfNotFound("Antowain", "Smith");
|
createPlayerIfNotFound("Antowain", "Smith");
|
||||||
createPlayerIfNotFound("Terry", "Glenn");
|
createPlayerIfNotFound("Terry", "Glenn");
|
||||||
createPlayerIfNotFound("Jerry", "Rice");
|
Player jerryrice = createPlayerIfNotFound("Jerry", "Rice");
|
||||||
createPlayerIfNotFound("Terrell", "Owens");
|
Player terrellowens = createPlayerIfNotFound("Terrell", "Owens");
|
||||||
createPlayerIfNotFound("Isaac", "Bruce");
|
Player isaacbruce = createPlayerIfNotFound("Isaac", "Bruce");
|
||||||
createPlayerIfNotFound("Trung", "Canidate");
|
Player trungcanidate = createPlayerIfNotFound("Trung", "Canidate");
|
||||||
Rooster pathoncoltswr2001 = createRoosterIfNotFound(jeromepathon, colts, wr, 2001);
|
Rooster pathoncoltswr2001 = createRoosterIfNotFound(jeromepathon, colts, wr, 2001);
|
||||||
Rooster bruschipatriotslb2001 = createRoosterIfNotFound(bruschi, patriots, lb, 2001);
|
Rooster bruschipatriotslb2001 = createRoosterIfNotFound(bruschi, patriots, lb, 2001);
|
||||||
Rooster couchbrownsqb2001 = createRoosterIfNotFound(couch, browns, qb, 2001);
|
Rooster couchbrownsqb2001 = createRoosterIfNotFound(couch, browns, qb, 2001);
|
||||||
@@ -312,6 +313,32 @@ public class SetupModuleTysc implements ApplicationListener<ContextRefreshedEven
|
|||||||
Rooster chrisfuamatusteelersfb2001 = createRoosterIfNotFound(chrisfuamatu, steelers, fb, 2001);
|
Rooster chrisfuamatusteelersfb2001 = createRoosterIfNotFound(chrisfuamatu, steelers, fb, 2001);
|
||||||
Rooster jeromebettissteelersrb2001 = createRoosterIfNotFound(jeromebettis, steelers, rb, 2001);
|
Rooster jeromebettissteelersrb2001 = createRoosterIfNotFound(jeromebettis, steelers, rb, 2001);
|
||||||
Rooster kordellstewartsteelersqb2001 = createRoosterIfNotFound(kordellstewart, steelers, qb, 2001);
|
Rooster kordellstewartsteelersqb2001 = createRoosterIfNotFound(kordellstewart, steelers, qb, 2001);
|
||||||
|
Rooster warrenmoonchiefsqb2001 = createRoosterIfNotFound(warrenmoon, chiefs, qb, 2001);
|
||||||
|
Rooster kevinlockettchiefswr2001 = createRoosterIfNotFound(kevinlockett, chiefs, wr, 2001);
|
||||||
|
Rooster richgannonqbraidersqb2001 = createRoosterIfNotFound(richgannon, raiders, qb, 2001);
|
||||||
|
Rooster jamesjettraiderswr2001 = createRoosterIfNotFound(jamesjett, raiders, wr,2001);
|
||||||
|
Rooster mackstrongseahawksfb2001 = createRoosterIfNotFound(mackstrong, seahawks, fb, 2001);
|
||||||
|
Rooster brockhuardseahawksqb2001 = createRoosterIfNotFound(brockhuard, seahawks, qb, 2001);
|
||||||
|
Rooster rickywattersseahawksrb2001 = createRoosterIfNotFound(rickywatters, seahawks, rb, 2001);
|
||||||
|
Rooster troyaikmancowboysqb2001 = createRoosterIfNotFound(troyaikman, cowboys, qb, 2001);
|
||||||
|
Rooster davidlafleurcowboyste2001 = createRoosterIfNotFound(davidlafleur, cowboys, te, 2001);
|
||||||
|
Rooster chrisbrazzellcowboyswr2001 = createRoosterIfNotFound(chrisbrazzell, cowboys, wr, 2001);
|
||||||
|
Rooster rondaynegiantsrb2001 = createRoosterIfNotFound(rondayne, giants, rb, 2001);
|
||||||
|
Rooster nabrownegiantswr2001 = createRoosterIfNotFound(nabrowne, giants, wr, 2001);
|
||||||
|
Rooster torrancesmalleagleswr2001 = createRoosterIfNotFound(torrancesmall, eagles, wr, 2001);
|
||||||
|
Rooster chadlewiseagleste2001 = createRoosterIfNotFound(chadlewis, eagles, te, 2001);
|
||||||
|
Rooster adrianmurrellredskinsrb2001 = createRoosterIfNotFound(adrianmurrell, redskins, rb, 2001);
|
||||||
|
Rooster mauricesmithfalconsrb2001 = createRoosterIfNotFound(mauricesmith, falcons, rb, 2001);
|
||||||
|
Rooster chrischandlerfalconsqb2001 = createRoosterIfNotFound(chrischandler, falcons, qb, 2001);
|
||||||
|
Rooster dannykanellfalconsqb2001 = createRoosterIfNotFound(dannykenell, falcons, qb, 2001);
|
||||||
|
Rooster rickywilliamssaintsrb2001 = createRoosterIfNotFound(rickywilliams, saints, rb, 2001);
|
||||||
|
Rooster jeffgarcia49ersqb2001 = createRoosterIfNotFound(jeffgarcia, sf49ers, qb, 2001);
|
||||||
|
Rooster taistreets49erswr2001 = createRoosterIfNotFound(taistreets, sf49ers, wr, 2001);
|
||||||
|
Rooster charliegarner49ersrb2001 = createRoosterIfNotFound(charliegarner, sf49ers, rb, 2001);
|
||||||
|
Rooster jerryrice49erswr2001 = createRoosterIfNotFound(jerryrice, sf49ers, wr, 2001);
|
||||||
|
Rooster terrelowens49erswr2001 = createRoosterIfNotFound(terrellowens, sf49ers, wr, 2001);
|
||||||
|
Rooster isaacbruseramswr2001 = createRoosterIfNotFound(isaacbruce, rams, wr, 2001);
|
||||||
|
Rooster trungcanidateramsrb2001 = createRoosterIfNotFound(trungcanidate, rams, rb, 2001);
|
||||||
createCardIfNotFound(185, 2001, pacific, pacificbase, pathoncoltswr2001);
|
createCardIfNotFound(185, 2001, pacific, pacificbase, pathoncoltswr2001);
|
||||||
createCardIfNotFound(250, 2001, pacific, pacificbase, bruschipatriotslb2001);
|
createCardIfNotFound(250, 2001, pacific, pacificbase, bruschipatriotslb2001);
|
||||||
createCardIfNotFound(103, 2001, pacific, pacificbase, couchbrownsqb2001);
|
createCardIfNotFound(103, 2001, pacific, pacificbase, couchbrownsqb2001);
|
||||||
@@ -322,99 +349,32 @@ public class SetupModuleTysc implements ApplicationListener<ContextRefreshedEven
|
|||||||
createCardIfNotFound(338, 2001, pacific, pacificbase, chrisfuamatusteelersfb2001);
|
createCardIfNotFound(338, 2001, pacific, pacificbase, chrisfuamatusteelersfb2001);
|
||||||
createCardIfNotFound(335, 2001, pacific, pacificbase, jeromebettissteelersrb2001);
|
createCardIfNotFound(335, 2001, pacific, pacificbase, jeromebettissteelersrb2001);
|
||||||
createCardIfNotFound(345, 2001, pacific, pacificbase, kordellstewartsteelersqb2001);
|
createCardIfNotFound(345, 2001, pacific, pacificbase, kordellstewartsteelersqb2001);
|
||||||
/*
|
createCardIfNotFound(213, 2001, pacific, pacificbase, warrenmoonchiefsqb2001);
|
||||||
* INSERT INTO `spieler` (`ID`,`name`) VALUES
|
createCardIfNotFound(212, 2001, pacific, pacificbase, kevinlockettchiefswr2001);
|
||||||
* (11,'Moon, Warren'),
|
createCardIfNotFound(311, 2001, pacific, pacificbase, richgannonqbraidersqb2001);
|
||||||
* (12,'Lockett, Kevin'),
|
createCardIfNotFound(312, 2001, pacific, pacificbase, jamesjettraiderswr2001);
|
||||||
* (13,'Gannon, Rich'),
|
createCardIfNotFound(403, 2001, pacific, pacificbase, mackstrongseahawksfb2001);
|
||||||
* (14,'Jett, James'),
|
createCardIfNotFound(397, 2001, pacific, pacificbase, brockhuardseahawksqb2001);
|
||||||
* (15,'Strong, Mack'),
|
createCardIfNotFound(404, 2001, pacific, pacificbase, rickywattersseahawksrb2001);
|
||||||
* (16,'Huard, Brock'),
|
createCardIfNotFound(116, 2001, pacific, pacificbase, troyaikmancowboysqb2001);
|
||||||
* (17,'Watters, Ricky'),
|
createCardIfNotFound(122, 2001, pacific, pacificbase, davidlafleurcowboyste2001);
|
||||||
* (18,'Aikman, Troy'),
|
createCardIfNotFound(117, 2001, pacific, pacificbase, chrisbrazzellcowboyswr2001);
|
||||||
* (19,'LaFleur, David'),
|
createCardIfNotFound(281, 2001, pacific, pacificbase, rondaynegiantsrb2001);
|
||||||
* (20,'Brazzell, Chris'),
|
createCardIfNotFound(321, 2001, pacific, pacificbase, nabrownegiantswr2001);
|
||||||
* (21,'Dayne, Ron'),
|
createCardIfNotFound(331, 2001, pacific, pacificbase, torrancesmalleagleswr2001);
|
||||||
* (22,'Brown, Na'),
|
createCardIfNotFound(324, 2001, pacific, pacificbase, chadlewiseagleste2001);
|
||||||
* (23,'Small, Torrance'),
|
createCardIfNotFound(445, 2001, pacific, pacificbase, adrianmurrellredskinsrb2001);
|
||||||
* (24,'Lewis, Chad'),
|
createCardIfNotFound(28, 2001, pacific, pacificbase, mauricesmithfalconsrb2001);
|
||||||
* (25,'Murrell, Adrian'),
|
createCardIfNotFound(17, 2001, pacific, pacificbase, chrischandlerfalconsqb2001);
|
||||||
* (26,'Smith, Maurice'),
|
createCardIfNotFound(23, 2001, pacific, pacificbase, dannykanellfalconsqb2001);
|
||||||
* (27,'Chandler, Chris'),
|
createCardIfNotFound(273, 2001, pacific, pacificbase, rickywilliamssaintsrb2001);
|
||||||
* (28,'Kanell, Danny')
|
createCardIfNotFound(380, 2001, pacific, pacificbase, jeffgarcia49ersqb2001);
|
||||||
* ,(29,'Williams, Ricky'),
|
createCardIfNotFound(390, 2001, pacific, pacificbase, taistreets49erswr2001);
|
||||||
* (30,'Garcia, Jeff'),
|
createCardIfNotFound(381, 2001, pacific, pacificbase, charliegarner49ersrb2001);
|
||||||
* (31,'Streets, Tai'),
|
createCardIfNotFound(387, 2001, pacific, pacificbase, jerryrice49erswr2001);
|
||||||
* (32,'Garner, Charlie'),
|
createCardIfNotFound(386, 2001, pacific, pacificbase, terrelowens49erswr2001);
|
||||||
* (33,'Rice, Jerry'),
|
createCardIfNotFound(349, 2001, pacific, pacificbase, isaacbruseramswr2001);
|
||||||
* (34,'Owens, Terrell'),
|
createCardIfNotFound(350, 2001, pacific, pacificbase, trungcanidateramsrb2001);
|
||||||
* (35,'Bruce, Isaac'),
|
|
||||||
* (36,'Canidate, Trung');
|
|
||||||
*
|
|
||||||
* INSERT INTO `team` (`ID`,`sportart_id`,`name`,`short`) VALUES
|
|
||||||
* (1,1,'Buffalo Bills','Bills'),
|
|
||||||
* (2,1,'Indianapolis Colts','Colts'),
|
|
||||||
* (3,1,'Miami Dolphins','Dolphins'),
|
|
||||||
* (4,1,'New England Patriots','Patriots'),
|
|
||||||
* (5,1,'New York Jets','Jets'),
|
|
||||||
* (6,1,'Baltimore Ravens','Ravens'),
|
|
||||||
* (7,1,'Cincinnati Bengals','Bengals'),
|
|
||||||
* (8,1,'Cleveland Browns','Browns'),
|
|
||||||
* (9,1,'Jacksonville Jaguars','Jaguars'),
|
|
||||||
* (10,1,'Pittsburgh Steelers','Steelers'),
|
|
||||||
* (11,1,'Tennessee Titans','Titans'),
|
|
||||||
* (12,1,'Denver Broncos','Broncos'),
|
|
||||||
* (13,1,'Kansas City Chiefs','Chiefs'),
|
|
||||||
* (14,1,'Oakland Raiders','Raiders'),
|
|
||||||
* (15,1,'San Diego Chargers','Chargers'),
|
|
||||||
* (16,1,'Seattle Seahawks','Seahawks'),
|
|
||||||
* (17,1,'Arizona Cardinals','Cardinals'),
|
|
||||||
* (18,1,'Dallas Cowboys','Cowboys'),
|
|
||||||
* (19,1,'New York Giants','Giants'),
|
|
||||||
* (20,1,'Philadelphia Eagles','Eagles'),
|
|
||||||
* (21,1,'Washington Redskins','Redskins'),
|
|
||||||
* (22,1,'Chicago Bears','Bears'),
|
|
||||||
* (23,1,'Detroit Lions','Lions'),
|
|
||||||
* (24,1,'Green Bay Packers','Packers'),
|
|
||||||
* (25,1,'Minnesota Vikings','Vikings'),
|
|
||||||
* (26,1,'Tampa Bay Buccaneers','Buccaneers'),
|
|
||||||
* (27,1,'Atlanta Falcons','Falcons'),
|
|
||||||
* (28,1,'Carolina Panthers','Panthers');
|
|
||||||
* (29,1,'New Orleans Saints','Saints'),
|
|
||||||
* (30,1,'St.Louis Rams','Rams'),
|
|
||||||
* (31,1,'San Francisco 49ers','49ers'),
|
|
||||||
*
|
|
||||||
* INSERT INTO `karte`
|
|
||||||
* (`ID`,`spieler_id`,`team_id`,`hersteller_id`,`serie_id`,`parallel_id`,`
|
|
||||||
* inserts_id`,`rookie`,`jahr`,`nummer`) VALUES
|
|
||||||
* (11,11,13,1,1,0,0,'N',2001,213),
|
|
||||||
* (12,12,13,1,1,0,0,'N',2001,212),
|
|
||||||
* (13,13,14,1,1,0,0,'N',2001,311),
|
|
||||||
* (14,14,14,1,1,0,0,'N',2001,312),
|
|
||||||
* (15,15,16,1,1,0,0,'N',2001,403),
|
|
||||||
* (16,16,16,1,1,0,0,'N',2001,397),
|
|
||||||
* (17,17,16,1,1,0,0,'N',2001,404),
|
|
||||||
* (18,18,18,1,1,0,0,'N',2001,116),
|
|
||||||
* (19,19,18,1,1,0,0,'N',2001,122),
|
|
||||||
* (20,20,18,1,1,0,0,'N',2001,117),
|
|
||||||
* (21,21,19,1,1,0,0,'N',2001,281),
|
|
||||||
* (22,22,19,1,1,0,0,'N',2001,321),
|
|
||||||
* (23,23,20,1,1,0,0,'N',2001,331),
|
|
||||||
* (24,24,20,1,1,0,0,'N',2001,324),
|
|
||||||
* (25,25,21,1,1,0,0,'N',2001,445),
|
|
||||||
* (26,26,27,1,1,0,0,'N',2001,28),
|
|
||||||
* (27,27,27,1,1,0,0,'N',2001,17),
|
|
||||||
* (28,28,27,1,1,0,0,'N',2001,23),
|
|
||||||
* (29,29,29,1,1,0,0,'N',2001,273);
|
|
||||||
* (30,30,31,1,1,0,0,'N',2001,380),
|
|
||||||
* (31,31,31,1,1,0,0,'N',2001,390),
|
|
||||||
* (32,32,31,1,1,0,0,'N',2001,381),
|
|
||||||
* (33,33,31,1,1,0,0,'N',2001,387),
|
|
||||||
* (34,34,31,1,1,0,0,'N',2001,386),
|
|
||||||
* (35,35,30,1,1,0,0,'N',2001,349),
|
|
||||||
* (36,36,30,1,1,0,0,'N',2001,350),
|
|
||||||
* (37,37,44,5,8,0,0,'N',1994,106);
|
|
||||||
*/
|
|
||||||
|
|
||||||
alreadySetup = true;
|
alreadySetup = true;
|
||||||
moduleService.setDataImported(TyscConstants.TYSC);
|
moduleService.setDataImported(TyscConstants.TYSC);
|
||||||
|
|||||||
@@ -46,4 +46,17 @@ public class Card extends AbstractEntity {
|
|||||||
@NotNull
|
@NotNull
|
||||||
@JsonIgnoreProperties({ "cards" })
|
@JsonIgnoreProperties({ "cards" })
|
||||||
private Rooster rooster;
|
private Rooster rooster;
|
||||||
|
|
||||||
|
public String getVendorName() {
|
||||||
|
return this.vendor.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCardSetName() {
|
||||||
|
return this.cardSet.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPlayerName() {
|
||||||
|
return this.rooster.getPlayer().getFullName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.vaadin.flow.component.ComponentEventListener;
|
|||||||
import com.vaadin.flow.component.Key;
|
import com.vaadin.flow.component.Key;
|
||||||
import com.vaadin.flow.component.button.Button;
|
import com.vaadin.flow.component.button.Button;
|
||||||
import com.vaadin.flow.component.button.ButtonVariant;
|
import com.vaadin.flow.component.button.ButtonVariant;
|
||||||
|
import com.vaadin.flow.component.combobox.ComboBox;
|
||||||
import com.vaadin.flow.component.formlayout.FormLayout;
|
import com.vaadin.flow.component.formlayout.FormLayout;
|
||||||
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||||
import com.vaadin.flow.component.textfield.TextField;
|
import com.vaadin.flow.component.textfield.TextField;
|
||||||
@@ -15,12 +16,15 @@ import com.vaadin.flow.data.binder.Binder;
|
|||||||
|
|
||||||
import de.thpeetz.kontor.tysc.data.Card;
|
import de.thpeetz.kontor.tysc.data.Card;
|
||||||
import de.thpeetz.kontor.tysc.data.Rooster;
|
import de.thpeetz.kontor.tysc.data.Rooster;
|
||||||
|
import de.thpeetz.kontor.tysc.data.Vendor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class CardForm extends FormLayout {
|
public class CardForm extends FormLayout {
|
||||||
|
|
||||||
TextField cardNumber = new TextField("CardNumber");
|
TextField cardNumber = new TextField("CardNumber");
|
||||||
|
TextField year = new TextField("Year");
|
||||||
|
ComboBox<Vendor> vendor = new ComboBox<>("Vendor");
|
||||||
|
|
||||||
Button save = new Button("Save");
|
Button save = new Button("Save");
|
||||||
Button delete = new Button("Delete");
|
Button delete = new Button("Delete");
|
||||||
@@ -28,11 +32,13 @@ public class CardForm extends FormLayout {
|
|||||||
|
|
||||||
Binder<Card> binder = new BeanValidationBinder<>(Card.class);
|
Binder<Card> binder = new BeanValidationBinder<>(Card.class);
|
||||||
|
|
||||||
public CardForm() {
|
public CardForm(List<Vendor> vendors) {
|
||||||
addClassName("card-form");
|
addClassName("card-form");
|
||||||
binder.bindInstanceFields(this);
|
binder.bindInstanceFields(this);
|
||||||
|
|
||||||
add(cardNumber, createButtonsLayout());
|
vendor.setItems(vendors);
|
||||||
|
vendor.setItemLabelGenerator(Vendor::getName);
|
||||||
|
add(cardNumber, year, vendor, createButtonsLayout());
|
||||||
}
|
}
|
||||||
|
|
||||||
private HorizontalLayout createButtonsLayout() {
|
private HorizontalLayout createButtonsLayout() {
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
package de.thpeetz.kontor.tysc.views;
|
package de.thpeetz.kontor.tysc.views;
|
||||||
|
|
||||||
|
import de.thpeetz.kontor.comics.data.Comic;
|
||||||
|
import de.thpeetz.kontor.common.views.StatusIcon;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
|
|
||||||
import com.vaadin.flow.component.Component;
|
import com.vaadin.flow.component.Component;
|
||||||
import com.vaadin.flow.component.button.Button;
|
import com.vaadin.flow.component.button.Button;
|
||||||
|
import com.vaadin.flow.component.button.ButtonVariant;
|
||||||
import com.vaadin.flow.component.grid.Grid;
|
import com.vaadin.flow.component.grid.Grid;
|
||||||
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||||
@@ -13,11 +16,13 @@ import com.vaadin.flow.router.PageTitle;
|
|||||||
import com.vaadin.flow.router.Route;
|
import com.vaadin.flow.router.Route;
|
||||||
import com.vaadin.flow.spring.annotation.SpringComponent;
|
import com.vaadin.flow.spring.annotation.SpringComponent;
|
||||||
|
|
||||||
|
import de.thpeetz.kontor.common.views.ColumnToggleContextMenu;
|
||||||
import de.thpeetz.kontor.common.views.MainLayout;
|
import de.thpeetz.kontor.common.views.MainLayout;
|
||||||
import de.thpeetz.kontor.tysc.TyscConstants;
|
import de.thpeetz.kontor.tysc.TyscConstants;
|
||||||
import de.thpeetz.kontor.tysc.data.Card;
|
import de.thpeetz.kontor.tysc.data.Card;
|
||||||
import de.thpeetz.kontor.tysc.services.CardService;
|
import de.thpeetz.kontor.tysc.services.CardService;
|
||||||
import jakarta.annotation.security.PermitAll;
|
import jakarta.annotation.security.PermitAll;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
@SpringComponent
|
@SpringComponent
|
||||||
@Scope("prototype")
|
@Scope("prototype")
|
||||||
@@ -26,8 +31,30 @@ import jakarta.annotation.security.PermitAll;
|
|||||||
@PageTitle("Card | Tysc | Kontor")
|
@PageTitle("Card | Tysc | Kontor")
|
||||||
public class CardView extends VerticalLayout {
|
public class CardView extends VerticalLayout {
|
||||||
|
|
||||||
Grid<Card> grid = new Grid<>(Card.class);
|
@Getter
|
||||||
|
Grid<Card> grid = new Grid<>(Card.class, false);
|
||||||
|
Grid.Column<Card> idColumn = grid.addColumn(Card::getId).setHeader("ID")
|
||||||
|
.setResizable(true).setSortable(true);
|
||||||
|
Grid.Column<Card> createdColumn = grid.addColumn(Card::getCreatedDate)
|
||||||
|
.setHeader("Erstellt").setResizable(true).setSortable(true);
|
||||||
|
Grid.Column<Card> modifiedColumn = grid.addColumn(Card::getLastModifiedDate)
|
||||||
|
.setHeader("Geändert").setResizable(true).setSortable(true);
|
||||||
|
Grid.Column<Card> numberColumn = grid.addColumn(Card::getCardNumber)
|
||||||
|
.setHeader("Nummer").setResizable(true).setSortable(true);
|
||||||
|
Grid.Column<Card> yearColumn = grid.addColumn(Card::getYear)
|
||||||
|
.setHeader("Jahr").setResizable(true).setSortable(true);
|
||||||
|
Grid.Column<Card> vendorColumn = grid.addColumn(Card::getVendorName)
|
||||||
|
.setHeader("Hersteller").setResizable(true).setSortable(true);
|
||||||
|
Grid.Column<Card> cardSetColumn = grid.addColumn(Card::getCardSetName)
|
||||||
|
.setHeader("Cardset").setResizable(true).setSortable(true);
|
||||||
|
Grid.Column<Card> insertSetColumn = grid.addComponentColumn(card -> StatusIcon.create(card.getCardSet().isInsertSet()))
|
||||||
|
.setHeader("Inserts").setWidth("6rem").setSortable(true);
|
||||||
|
Grid.Column<Card> parallelSetColumn = grid.addComponentColumn(card -> StatusIcon.create(card.getCardSet().isParallelSet()))
|
||||||
|
.setHeader("Parallels").setWidth("6rem").setSortable(true);
|
||||||
|
|
||||||
|
Grid.Column<Card> playerColumn = grid.addColumn(Card::getPlayerName).setHeader("Spieler").setResizable(true).setSortable(true);
|
||||||
TextField filterText = new TextField();
|
TextField filterText = new TextField();
|
||||||
|
@Getter
|
||||||
CardForm form;
|
CardForm form;
|
||||||
CardService service;
|
CardService service;
|
||||||
|
|
||||||
@@ -42,24 +69,18 @@ public class CardView extends VerticalLayout {
|
|||||||
updateList();
|
updateList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Grid<Card> getGrid() {
|
|
||||||
return grid;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void configureGrid() {
|
private void configureGrid() {
|
||||||
grid.addClassName("card-grid");
|
grid.addClassName("card-grid");
|
||||||
grid.setSizeFull();
|
grid.setSizeFull();
|
||||||
grid.setColumns("cardNumber", "year", "vendor.name", "cardSet.name", "rooster.player.fullName");
|
|
||||||
grid.getColumns().forEach(col -> col.setAutoWidth(true));
|
grid.getColumns().forEach(col -> col.setAutoWidth(true));
|
||||||
grid.asSingleSelect().addValueChangeListener(event -> editCard(event.getValue()));
|
grid.asSingleSelect().addValueChangeListener(event -> editCard(event.getValue()));
|
||||||
}
|
idColumn.setVisible(false);
|
||||||
|
createdColumn.setVisible(false);
|
||||||
public CardForm getForm() {
|
modifiedColumn.setVisible(false);
|
||||||
return form;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureForm() {
|
private void configureForm() {
|
||||||
form = new CardForm();
|
form = new CardForm(service.findAllVendors(null));
|
||||||
form.setWidth("25em");
|
form.setWidth("25em");
|
||||||
form.setVisible(false);
|
form.setVisible(false);
|
||||||
form.addSaveListener(this::saveCard);
|
form.addSaveListener(this::saveCard);
|
||||||
@@ -97,7 +118,19 @@ public class CardView extends VerticalLayout {
|
|||||||
Button addCardButton = new Button("Add card");
|
Button addCardButton = new Button("Add card");
|
||||||
addCardButton.addClickListener(click -> addCard());
|
addCardButton.addClickListener(click -> addCard());
|
||||||
|
|
||||||
HorizontalLayout toolbar = new HorizontalLayout(filterText, addCardButton);
|
Button menuButton = new Button("Show/Hide Columns");
|
||||||
|
menuButton.addThemeVariants(ButtonVariant.LUMO_TERTIARY);
|
||||||
|
ColumnToggleContextMenu<Card> columnToggleContextMenu = new ColumnToggleContextMenu<>(menuButton);
|
||||||
|
columnToggleContextMenu.addColumnToggleItem(idColumn);
|
||||||
|
columnToggleContextMenu.addColumnToggleItem(createdColumn);
|
||||||
|
columnToggleContextMenu.addColumnToggleItem(modifiedColumn);
|
||||||
|
columnToggleContextMenu.addColumnToggleItem(numberColumn);
|
||||||
|
columnToggleContextMenu.addColumnToggleItem(yearColumn);
|
||||||
|
columnToggleContextMenu.addColumnToggleItem(vendorColumn);
|
||||||
|
columnToggleContextMenu.addColumnToggleItem(cardSetColumn);
|
||||||
|
columnToggleContextMenu.addColumnToggleItem(playerColumn);
|
||||||
|
HorizontalLayout toolbar = new HorizontalLayout(filterText, addCardButton, menuButton);
|
||||||
|
|
||||||
toolbar.addClassName("toolbar");
|
toolbar.addClassName("toolbar");
|
||||||
return toolbar;
|
return toolbar;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user