|
@ -50,7 +50,9 @@ public class MatchComponent extends Div implements ContentConfigurable { |
|
|
private final FlexLayout editLayoutWrapper = new FlexLayout(); |
|
|
private final FlexLayout editLayoutWrapper = new FlexLayout(); |
|
|
private final VerticalLayout editLayout = new VerticalLayout(); |
|
|
private final VerticalLayout editLayout = new VerticalLayout(); |
|
|
private final ArrayList<TextField> editTextFields = new ArrayList<>(); |
|
|
private final ArrayList<TextField> editTextFields = new ArrayList<>(); |
|
|
|
|
|
// TODO: autocorrect "/live/game" to "/game/live/" |
|
|
private final Button editSubmitButton = new Button("Submit", new Icon(VaadinIcon.CHECK)); |
|
|
private final Button editSubmitButton = new Button("Submit", new Icon(VaadinIcon.CHECK)); |
|
|
|
|
|
// TODO: disable when no 6 values in form, and make sure you don't freeze forever when there are wrong entries |
|
|
private Registration editSubmitButtonRegistration; |
|
|
private Registration editSubmitButtonRegistration; |
|
|
private final Button editCancelButton = new Button("Cancel", new Icon(VaadinIcon.CLOSE)); |
|
|
private final Button editCancelButton = new Button("Cancel", new Icon(VaadinIcon.CLOSE)); |
|
|
private Registration editCancelButtonRegistration; |
|
|
private Registration editCancelButtonRegistration; |
|
@ -72,13 +74,13 @@ public class MatchComponent extends Div implements ContentConfigurable { |
|
|
add(headerLayout); |
|
|
add(headerLayout); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
configureHeaderLayout(); |
|
|
|
|
|
configureGamesLayout(); |
|
|
|
|
|
configureNoGamesLayout(); |
|
|
|
|
|
configureEditLayout(); |
|
|
|
|
|
|
|
|
defineHeaderLayout(); |
|
|
|
|
|
defineGamesLayout(); |
|
|
|
|
|
defineNoGamesLayout(); |
|
|
|
|
|
defineEditLayout(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void configureNoGamesLayout() { |
|
|
|
|
|
|
|
|
private void defineNoGamesLayout() { |
|
|
Label label = new Label("No games for this match in the database."); |
|
|
Label label = new Label("No games for this match in the database."); |
|
|
Button button = new Button("Add games", new Icon(VaadinIcon.PLUS)); |
|
|
Button button = new Button("Add games", new Icon(VaadinIcon.PLUS)); |
|
|
button.addThemeVariants(ButtonVariant.LUMO_PRIMARY); |
|
|
button.addThemeVariants(ButtonVariant.LUMO_PRIMARY); |
|
@ -90,7 +92,7 @@ public class MatchComponent extends Div implements ContentConfigurable { |
|
|
noGamesLayout.setAlignItems(FlexComponent.Alignment.CENTER); |
|
|
noGamesLayout.setAlignItems(FlexComponent.Alignment.CENTER); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void configureHeaderLayout() { |
|
|
|
|
|
|
|
|
private void defineHeaderLayout() { |
|
|
headerLayout.add(headerPlayersLayout, headerResultLabel); |
|
|
headerLayout.add(headerPlayersLayout, headerResultLabel); |
|
|
|
|
|
|
|
|
headerPlayersLayout.addClassName("match-header-players"); |
|
|
headerPlayersLayout.addClassName("match-header-players"); |
|
@ -99,12 +101,12 @@ public class MatchComponent extends Div implements ContentConfigurable { |
|
|
headerResultLabel.addClassName("bold-header"); |
|
|
headerResultLabel.addClassName("bold-header"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void configureGamesLayout() { |
|
|
|
|
|
|
|
|
private void defineGamesLayout() { |
|
|
gamesLayout.setFlexWrap(FlexLayout.FlexWrap.WRAP); |
|
|
gamesLayout.setFlexWrap(FlexLayout.FlexWrap.WRAP); |
|
|
gamesLayout.setJustifyContentMode(FlexComponent.JustifyContentMode.CENTER); |
|
|
gamesLayout.setJustifyContentMode(FlexComponent.JustifyContentMode.CENTER); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void configureEditLayout() { |
|
|
|
|
|
|
|
|
private void defineEditLayout() { |
|
|
editLayoutWrapper.add(editLayout); |
|
|
editLayoutWrapper.add(editLayout); |
|
|
editLayoutWrapper.setJustifyContentMode(FlexComponent.JustifyContentMode.CENTER); |
|
|
editLayoutWrapper.setJustifyContentMode(FlexComponent.JustifyContentMode.CENTER); |
|
|
|
|
|
|
|
|