Listado-General-Vacaciones #52

Merged
jesus.pelaez merged 23 commits from Listado-General-Vacaciones into En-desarrollo 2024-10-11 19:30:22 +00:00
Showing only changes of commit 379e822572 - Show all commits

View File

@ -45,9 +45,36 @@ public class HoursWorkedView extends VerticalLayout {
grid.addColumn(Actividad::getDomingo).setHeader("Domingo"); grid.addColumn(Actividad::getDomingo).setHeader("Domingo");
grid.setItems( grid.setItems(
new Actividad("Actividad 1", 3, 3, 3, 3, 3, 1, 2), new Actividad.Builder()
new Actividad("Actividad 2", 2, 2, 2, 2, 2, 0, 1), .nombre("Actividad 1")
new Actividad("Meeting 1", 0, 0.5, 0.5, 0, 0, 0.5, 0) .lunes(3)
.martes(3)
.miercoles(3)
.jueves(3)
.viernes(3)
.sabado(1)
.domingo(2)
.build(),
new Actividad.Builder()
.nombre("Actividad 2")
.lunes(2)
.martes(2)
.miercoles(2)
.jueves(2)
.viernes(2)
.sabado(0)
.domingo(1)
.build(),
new Actividad.Builder()
.nombre("Meeting 1")
.lunes(0)
.martes(0.5)
.miercoles(0.5)
.jueves(0)
.viernes(0)
.sabado(0.5)
.domingo(0)
.build()
); );
Button actualizarButton = new Button("Actualizar"); Button actualizarButton = new Button("Actualizar");
@ -59,30 +86,80 @@ public class HoursWorkedView extends VerticalLayout {
add(title, datePicker, filtersLayout, grid, buttonsLayout); add(title, datePicker, filtersLayout, grid, buttonsLayout);
} }
public static class Actividad { public static final class Actividad {
final private String nombre; private final String nombre;
final private double lunes; private final double lunes;
final private double martes; private final double martes;
final private double miercoles; private final double miercoles;
final private double jueves; private final double jueves;
final private double viernes; private final double viernes;
final private double sabado; private final double sabado;
final private double domingo; private final double domingo;
public Actividad( private Actividad(final Builder builder) {
final String nombre, final double lunes, this.nombre = builder.nombre;
final double martes, final double miercoles, this.lunes = builder.lunes;
final double jueves, final double viernes, this.martes = builder.martes;
final double sabado, final double domingo) this.miercoles = builder.miercoles;
{ this.jueves = builder.jueves;
this.viernes = builder.viernes;
this.sabado = builder.sabado;
this.domingo = builder.domingo;
}
public static class Builder {
private String nombre;
private double lunes;
private double martes;
private double miercoles;
private double jueves;
private double viernes;
private double sabado;
private double domingo;
public Builder nombre(final String nombre) {
this.nombre = nombre; this.nombre = nombre;
return this;
}
public Builder lunes(final double lunes) {
this.lunes = lunes; this.lunes = lunes;
return this;
}
public Builder martes(final double martes) {
this.martes = martes; this.martes = martes;
return this;
}
public Builder miercoles(final double miercoles) {
this.miercoles = miercoles; this.miercoles = miercoles;
return this;
}
public Builder jueves(final double jueves) {
this.jueves = jueves; this.jueves = jueves;
return this;
}
public Builder viernes(final double viernes) {
this.viernes = viernes; this.viernes = viernes;
return this;
}
public Builder sabado(final double sabado) {
this.sabado = sabado; this.sabado = sabado;
return this;
}
public Builder domingo(final double domingo) {
this.domingo = domingo; this.domingo = domingo;
return this;
}
public Actividad build() {
return new Actividad(this);
}
} }
public String getNombre() { public String getNombre() {