|
|
@ -1,7 +1,11 @@ |
|
|
|
package mx.gob.jumapacelaya.ui; |
|
|
|
import com.vaadin.flow.component.button.Button; |
|
|
|
import com.vaadin.flow.component.button.ButtonVariant; |
|
|
|
import com.vaadin.flow.component.grid.ColumnPathRenderer; |
|
|
|
import com.vaadin.flow.component.grid.Grid; |
|
|
|
import com.vaadin.flow.component.html.H2; |
|
|
|
import com.vaadin.flow.component.html.H3; |
|
|
|
import com.vaadin.flow.component.icon.VaadinIcon; |
|
|
|
import com.vaadin.flow.component.orderedlayout.HorizontalLayout; |
|
|
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout; |
|
|
|
import com.vaadin.flow.data.renderer.ComponentRenderer; |
|
|
@ -18,7 +22,7 @@ import java.util.*; |
|
|
|
|
|
|
|
|
|
|
|
@PermitAll |
|
|
|
@PageTitle("Home") |
|
|
|
@PageTitle("Actividades Diarias") |
|
|
|
@Route(value = "actdiaria", layout = MainLayout.class) |
|
|
|
public class ActDiariaView extends VerticalLayout { |
|
|
|
|
|
|
@ -29,6 +33,8 @@ public class ActDiariaView extends VerticalLayout { |
|
|
|
|
|
|
|
H2 titulo = new H2(); |
|
|
|
|
|
|
|
Button btnCorrectivo = new Button("Correctivo"); |
|
|
|
|
|
|
|
Grid<ActividadDiaria> grdColumnas = new Grid<>(ActividadDiaria.class,false); |
|
|
|
|
|
|
|
List<ActividadDiaria> people = Arrays.asList( |
|
|
@ -38,10 +44,15 @@ public class ActDiariaView extends VerticalLayout { |
|
|
|
//new ActividadDiaria("Johannes Kepler", 1571)); |
|
|
|
|
|
|
|
public ActDiariaView() { |
|
|
|
|
|
|
|
titulo.setText("Listado de Actividades"); |
|
|
|
VerticalLayout headerLayout = new VerticalLayout(); |
|
|
|
headerLayout.getStyle().set("background-color", "#3e8bea"); |
|
|
|
headerLayout.add(titulo); |
|
|
|
titulo.setText("Listado de Actividades Diarias"); |
|
|
|
header.setAlignSelf(Alignment.CENTER, titulo); |
|
|
|
|
|
|
|
|
|
|
|
VerticalLayout gridLayout = new VerticalLayout(); |
|
|
|
gridLayout.add(grdColumnas); |
|
|
|
//Tabla echa con un grid |
|
|
|
grdColumnas.addColumn(ActividadDiaria::getNumero).setHeader("Numero"); |
|
|
|
grdColumnas.addColumn(ActividadDiaria::getProyecto).setHeader("Proyecto"); |
|
|
@ -54,11 +65,23 @@ public class ActDiariaView extends VerticalLayout { |
|
|
|
grdColumnas.addColumn(date->{ |
|
|
|
return formato.format(date.getFechaCierre()); |
|
|
|
}).setHeader("Fecha de cierre"); |
|
|
|
Button btnCorrectivo = new Button("Correctivo"); |
|
|
|
|
|
|
|
grdColumnas.setItems(people); |
|
|
|
// grdColumnas.addColumn( |
|
|
|
// new ColumnPathRenderer<>(Button::new, (btnCorrectivo, ActividadDiaria) ->{ |
|
|
|
// btnCorrectivo.addThemeVariants(ButtonVariant.LUMO_ICON, |
|
|
|
// ButtonVariant.LUMO_ERROR, |
|
|
|
// ButtonVariant.LUMO_TERTIARY); |
|
|
|
// btnCorrectivo.setIcon(new Icon(VaadinIcon.TRASH)); |
|
|
|
// })).setHeader("Prueba"); |
|
|
|
|
|
|
|
add(titulo, header, grdColumnas); |
|
|
|
|
|
|
|
// add(titulo, header, grdColumnas); |
|
|
|
this.setPadding(false); |
|
|
|
this.setMargin(false); |
|
|
|
this.setSpacing(false); |
|
|
|
add(headerLayout, gridLayout); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |