Erweiterungen
This commit is contained in:
@@ -11,16 +11,25 @@ import com.vaadin.flow.theme.lumo.LumoUtility.*;
|
||||
public final class ViewToolbar extends Composite<Header> {
|
||||
|
||||
public ViewToolbar(String viewTitle, Component... components) {
|
||||
this(viewTitle, true, components);
|
||||
}
|
||||
|
||||
public ViewToolbar(String viewTitle, boolean showDrawerToggle, Component... components) {
|
||||
addClassNames(Display.FLEX, FlexDirection.COLUMN, JustifyContent.BETWEEN, AlignItems.STRETCH, Gap.MEDIUM,
|
||||
FlexDirection.Breakpoint.Medium.ROW, AlignItems.Breakpoint.Medium.CENTER);
|
||||
|
||||
var drawerToggle = new DrawerToggle();
|
||||
drawerToggle.addClassNames(Margin.NONE);
|
||||
|
||||
var title = new H1(viewTitle);
|
||||
title.addClassNames(FontSize.XLARGE, Margin.NONE, FontWeight.LIGHT);
|
||||
|
||||
var toggleAndTitle = new Div(drawerToggle, title);
|
||||
Div toggleAndTitle;
|
||||
if (showDrawerToggle) {
|
||||
var drawerToggle = new DrawerToggle();
|
||||
drawerToggle.addClassNames(Margin.NONE);
|
||||
var title = new H1(viewTitle);
|
||||
title.addClassNames(FontSize.XLARGE, Margin.NONE, FontWeight.LIGHT);
|
||||
toggleAndTitle = new Div(drawerToggle, title);
|
||||
} else {
|
||||
var title = new H1(viewTitle);
|
||||
title.addClassNames(FontSize.XLARGE, Margin.NONE, FontWeight.LIGHT);
|
||||
toggleAndTitle = new Div(title);
|
||||
}
|
||||
toggleAndTitle.addClassNames(Display.FLEX, AlignItems.CENTER);
|
||||
getContent().add(toggleAndTitle);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.vaadin.flow.component.checkbox.Checkbox;
|
||||
import com.vaadin.flow.component.combobox.ComboBox;
|
||||
|
||||
import com.vaadin.flow.component.datepicker.DatePicker;
|
||||
import com.vaadin.flow.component.html.H2;
|
||||
import com.vaadin.flow.component.timepicker.TimePicker;
|
||||
import com.vaadin.flow.component.html.H3;
|
||||
import com.vaadin.flow.component.html.Main;
|
||||
@@ -364,7 +365,8 @@ public class AddJobView extends Main {
|
||||
addClassNames(LumoUtility.BoxSizing.BORDER, LumoUtility.Display.FLEX, LumoUtility.FlexDirection.COLUMN,
|
||||
LumoUtility.Padding.MEDIUM, LumoUtility.Gap.SMALL);
|
||||
|
||||
add(new ViewToolbar("Neuen Auftrag anlegen"));
|
||||
H2 title = new H2("Neuen Auftrag anlegen");
|
||||
add(title);
|
||||
|
||||
// Create TabSheet for organizing the form
|
||||
// TabSheet and Tab references for dynamic label updates
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.vaadin.flow.component.UI;
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.button.ButtonVariant;
|
||||
import com.vaadin.flow.component.grid.Grid;
|
||||
import com.vaadin.flow.component.html.H2;
|
||||
import com.vaadin.flow.component.html.Main;
|
||||
import com.vaadin.flow.component.textfield.TextField;
|
||||
import com.vaadin.flow.router.Menu;
|
||||
@@ -44,7 +45,9 @@ public class CustomersView extends Main {
|
||||
addClassNames(LumoUtility.BoxSizing.BORDER, LumoUtility.Display.FLEX, LumoUtility.FlexDirection.COLUMN,
|
||||
LumoUtility.Padding.MEDIUM, LumoUtility.Gap.SMALL);
|
||||
|
||||
add(new ViewToolbar("Kunden", ViewToolbar.group(description, createBtn)));
|
||||
H2 title = new H2("Aufträge");
|
||||
add(title);
|
||||
|
||||
add(todoGrid);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,9 @@ public class ShowJobsView extends VerticalLayout {
|
||||
setPadding(true);
|
||||
setSpacing(true);
|
||||
|
||||
H2 title = new H2("Aufträge");
|
||||
add(title);
|
||||
|
||||
// Configure status filter
|
||||
statusFilter.setItems("Alle", "Offen", "Erledigt");
|
||||
statusFilter.setValue("Offen");
|
||||
@@ -64,8 +67,6 @@ public class ShowJobsView extends VerticalLayout {
|
||||
filterBar.setAlignItems(Alignment.END);
|
||||
add(filterBar);
|
||||
|
||||
H2 title = new H2("Aufträge");
|
||||
add(title);
|
||||
// Init default period: last 30 days
|
||||
java.time.LocalDate today = java.time.LocalDate.now();
|
||||
startDate.setValue(today.minusDays(30));
|
||||
|
||||
Reference in New Issue
Block a user