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.setItems(
new Actividad("Actividad 1", 3, 3, 3, 3, 3, 1, 2),
new Actividad("Actividad 2", 2, 2, 2, 2, 2, 0, 1),
new Actividad("Meeting 1", 0, 0.5, 0.5, 0, 0, 0.5, 0)
new Actividad.Builder()
.nombre("Actividad 1")
.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");
@ -59,30 +86,80 @@ public class HoursWorkedView extends VerticalLayout {
add(title, datePicker, filtersLayout, grid, buttonsLayout);
}
public static class Actividad {
final private String nombre;
final private double lunes;
final private double martes;
final private double miercoles;
final private double jueves;
final private double viernes;
final private double sabado;
final private double domingo;
public static final class Actividad {
private final String nombre;
private final double lunes;
private final double martes;
private final double miercoles;
private final double jueves;
private final double viernes;
private final double sabado;
private final double domingo;
public Actividad(
final String nombre, final double lunes,
final double martes, final double miercoles,
final double jueves, final double viernes,
final double sabado, final double domingo)
{
this.nombre = nombre;
this.lunes = lunes;
this.martes = martes;
this.miercoles = miercoles;
this.jueves = jueves;
this.viernes = viernes;
this.sabado = sabado;
this.domingo = domingo;
private Actividad(final Builder builder) {
this.nombre = builder.nombre;
this.lunes = builder.lunes;
this.martes = builder.martes;
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;
return this;
}
public Builder lunes(final double lunes) {
this.lunes = lunes;
return this;
}
public Builder martes(final double martes) {
this.martes = martes;
return this;
}
public Builder miercoles(final double miercoles) {
this.miercoles = miercoles;
return this;
}
public Builder jueves(final double jueves) {
this.jueves = jueves;
return this;
}
public Builder viernes(final double viernes) {
this.viernes = viernes;
return this;
}
public Builder sabado(final double sabado) {
this.sabado = sabado;
return this;
}
public Builder domingo(final double domingo) {
this.domingo = domingo;
return this;
}
public Actividad build() {
return new Actividad(this);
}
}
public String getNombre() {