Skip to content

Commit ceb20a5

Browse files
committed
Corrected demo
* Use logical car models * Corrected naming * Re-sort * Hid some easter eggs
1 parent 7f4537d commit ceb20a5

File tree

7 files changed

+21
-20
lines changed

7 files changed

+21
-20
lines changed

vaadin-breadcrumbs-demo/src/main/java/software/xdev/vaadin/ui/MainLayout.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ public MainLayout()
3939
CarsView.class,
4040
VaadinIcon.CAR.create());
4141
carsItem.addItem(new SideNavItem(
42-
this.getTranslation(TranslationKeys.ELECTRIC),
43-
ElectricView.class,
44-
VaadinIcon.BOLT.create()));
42+
this.getTranslation(TranslationKeys.GASOLINE),
43+
GasolineView.class,
44+
VaadinIcon.FIRE.create()));
4545
carsItem.addItem(new SideNavItem(
4646
this.getTranslation(TranslationKeys.HYBRID),
4747
HybridView.class,
4848
VaadinIcon.GLOBE.create()));
4949
carsItem.addItem(new SideNavItem(
50-
this.getTranslation(TranslationKeys.GASOLINE),
51-
GasolineView.class,
52-
VaadinIcon.FIRE.create()));
50+
this.getTranslation(TranslationKeys.ELECTRIC),
51+
ElectricView.class,
52+
VaadinIcon.BOLT.create()));
5353

5454
sideNav.addItem(Objects.requireNonNull(carsItem));
5555

vaadin-breadcrumbs-demo/src/main/java/software/xdev/vaadin/ui/TranslationKeys.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public final class TranslationKeys
88
public static final String ELECTRIC = "electric";
99
public static final String HYBRID = "hybrid";
1010
public static final String GASOLINE = "gasoline";
11+
public static final String PLUTONIUM = "plutonium";
1112

1213
public static final String FUEL = "fuel";
1314
public static final String MODEL = "model";

vaadin-breadcrumbs-demo/src/main/java/software/xdev/vaadin/ui/cars/AbstractCarView.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import static software.xdev.vaadin.ui.TranslationKeys.ELECTRIC;
44
import static software.xdev.vaadin.ui.TranslationKeys.GASOLINE;
55
import static software.xdev.vaadin.ui.TranslationKeys.HYBRID;
6+
import static software.xdev.vaadin.ui.TranslationKeys.PLUTONIUM;
67

78
import java.util.List;
89

@@ -32,18 +33,15 @@ protected static List<Car> getCarsByFuel(final String fuel)
3233
protected static List<Car> getAllCars()
3334
{
3435
return List.of(
35-
new Car(ELECTRIC, "A4", 190),
36-
new Car(ELECTRIC, "A3", 150),
37-
new Car(ELECTRIC, "S4", 250),
38-
new Car(ELECTRIC, "Q5", 300),
39-
new Car(HYBRID, "318i", 190),
40-
new Car(HYBRID, "M4", 400),
41-
new Car(HYBRID, "420d", 200),
42-
new Car(HYBRID, "X5", 250),
43-
new Car(GASOLINE, "Cayenne", 300),
44-
new Car(GASOLINE, "911", 400),
45-
new Car(GASOLINE, "Carrera", 400),
46-
new Car(GASOLINE, "GT3RS", 600)
36+
new Car(GASOLINE, "Opel Astra K", 110),
37+
new Car(GASOLINE, "Skoda Octavia 4", 150),
38+
new Car(GASOLINE, "VW Golf 7 GTI", 220),
39+
new Car(GASOLINE, "Porsche GT3 RS", 525),
40+
new Car(HYBRID, "Mercedes A250", 160),
41+
new Car(HYBRID, "VW Golf 8 eTSI", 150),
42+
new Car(ELECTRIC, "Tesla Model 3", 460),
43+
new Car(ELECTRIC, "BMW i4", 540),
44+
new Car(PLUTONIUM, "DeLorean DMC-12", 1_620_000)
4745
);
4846
}
4947
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package software.xdev.vaadin.ui.cars;
22

3-
public record Car(String fuelI18N, String name, int hp)
3+
public record Car(String fuelI18N, String model, int hp)
44
{
55
}

vaadin-breadcrumbs-demo/src/main/java/software/xdev/vaadin/ui/cars/CarGrid.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public CarGrid(final List<Car> cars)
1515
this.setItems(cars);
1616
this.addColumn(car -> this.getTranslation(car.fuelI18N()))
1717
.setHeader(this.getTranslation(TranslationKeys.FUEL));
18-
this.addColumn(Car::name).setHeader(this.getTranslation(TranslationKeys.MODEL));
18+
this.addColumn(Car::model).setHeader(this.getTranslation(TranslationKeys.MODEL));
1919
this.addColumn(Car::hp).setHeader(this.getTranslation(TranslationKeys.HP));
2020
}
2121
}

vaadin-breadcrumbs-demo/src/main/resources/vaadin-i18n/translations_de.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ cars=Autos
33
electric=Elektrisch
44
hybrid=Hybrid
55
gasoline=Benzin
6+
plutonium=Plutonium
67
fuel=Treibstoff
78
model=Modell
89
hp=PS

vaadin-breadcrumbs-demo/src/main/resources/vaadin-i18n/translations_en.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ cars=Cars
33
electric=Electric
44
hybrid=Hybrid
55
gasoline=Gasoline
6+
plutonium=Plutonium
67
fuel=Fuel
78
model=Model
89
hp=HP

0 commit comments

Comments
 (0)