Search in sources :

Example 1 with H2

use of com.vaadin.flow.component.html.H2 in project karnak by OsiriX-Foundation.

the class ProfileComponent method setProfile.

public void setProfile() {
    removeAll();
    H2 title = new H2("Profile");
    ProfileMetadata name = new ProfileMetadata("Name", profileEntity.getName(), profileEntity.getByDefault());
    name.getValidateEditButton().addClickListener(event -> {
        profileEntity.setName(name.getValue());
        updatedProfilePipes();
    });
    ProfileMetadata version = new ProfileMetadata("Profile version", profileEntity.getVersion(), profileEntity.getByDefault());
    version.getValidateEditButton().addClickListener(event -> {
        profileEntity.setVersion(version.getValue());
        updatedProfilePipes();
    });
    ProfileMetadata minVersion = new ProfileMetadata("Min. version KARNAK required", profileEntity.getMinimumKarnakVersion(), profileEntity.getByDefault());
    minVersion.getValidateEditButton().addClickListener(event -> {
        profileEntity.setMinimumKarnakVersion(minVersion.getValue());
        updatedProfilePipes();
    });
    createDownloadButton(profileEntity);
    ProfileMasksView profileMasksView = new ProfileMasksView(profileEntity.getMaskEntities());
    if (profileEntity.getByDefault().booleanValue()) {
        add(new HorizontalLayout(title, download), name, version, minVersion, profileMasksView);
    } else {
        createDeleteButton(profileEntity);
        add(new HorizontalLayout(title, download, deleteButton), name, version, minVersion, profileMasksView);
    }
}
Also used : H2(com.vaadin.flow.component.html.H2) HorizontalLayout(com.vaadin.flow.component.orderedlayout.HorizontalLayout)

Example 2 with H2

use of com.vaadin.flow.component.html.H2 in project karnak by OsiriX-Foundation.

the class ProfileElementMainView method profilesView.

private void profilesView() {
    removeAll();
    add(new HorizontalLayout(// new horizontalelayout because fix padding
    new H2("Profile element(s)")));
    for (ProfileElementEntity profileElementEntity : profilesOrder) {
        add(setProfileName((profileElementEntity.getPosition() + 1) + ". " + profileElementEntity.getName()));
        add(new ProfileElementView(profileElementEntity));
    }
}
Also used : ProfileElementEntity(org.karnak.backend.data.entity.ProfileElementEntity) H2(com.vaadin.flow.component.html.H2) HorizontalLayout(com.vaadin.flow.component.orderedlayout.HorizontalLayout)

Example 3 with H2

use of com.vaadin.flow.component.html.H2 in project karnak by OsiriX-Foundation.

the class ProfileErrorView method setView.

public void setView(ArrayList<ProfileError> profileErrors) {
    removeAll();
    add(new H2("Errors occured in profile elements"));
    for (ProfileError profileError : profileErrors) {
        ProfileElementEntity profileElementEntity = profileError.getProfileElement();
        Div profileName = setProfileName((profileElementEntity.getPosition() + 1) + ". " + profileElementEntity.getName());
        add(profileName);
        if (profileError.getError() != null) {
            profileName.add(setErrorIcon());
            add(setProfileError("Error : " + profileError.getError()));
        } else {
            profileName.add(setSuccessIcon());
        }
        setProfileShowHide(profileElementEntity);
    }
}
Also used : Div(com.vaadin.flow.component.html.Div) ProfileElementEntity(org.karnak.backend.data.entity.ProfileElementEntity) H2(com.vaadin.flow.component.html.H2)

Example 4 with H2

use of com.vaadin.flow.component.html.H2 in project karnak by OsiriX-Foundation.

the class ProfileErrorView method setView.

public void setView(String text) {
    removeAll();
    add(new H2("Error occured"));
    add(setProfileError(text));
}
Also used : H2(com.vaadin.flow.component.html.H2)

Example 5 with H2

use of com.vaadin.flow.component.html.H2 in project docs by vaadin.

the class DialogBasic method createDialogLayout.

private static VerticalLayout createDialogLayout(Dialog dialog) {
    H2 headline = new H2("Create new employee");
    headline.getStyle().set("margin", "var(--lumo-space-m) 0 0 0").set("font-size", "1.5em").set("font-weight", "bold");
    TextField firstNameField = new TextField("First name");
    TextField lastNameField = new TextField("Last name");
    VerticalLayout fieldLayout = new VerticalLayout(firstNameField, lastNameField);
    fieldLayout.setSpacing(false);
    fieldLayout.setPadding(false);
    fieldLayout.setAlignItems(FlexComponent.Alignment.STRETCH);
    Button cancelButton = new Button("Cancel", e -> dialog.close());
    Button saveButton = new Button("Save", e -> dialog.close());
    saveButton.addThemeVariants(ButtonVariant.LUMO_PRIMARY);
    HorizontalLayout buttonLayout = new HorizontalLayout(cancelButton, saveButton);
    buttonLayout.setJustifyContentMode(FlexComponent.JustifyContentMode.END);
    VerticalLayout dialogLayout = new VerticalLayout(headline, fieldLayout, buttonLayout);
    dialogLayout.setPadding(false);
    dialogLayout.setAlignItems(FlexComponent.Alignment.STRETCH);
    dialogLayout.getStyle().set("width", "300px").set("max-width", "100%");
    return dialogLayout;
}
Also used : Button(com.vaadin.flow.component.button.Button) TextField(com.vaadin.flow.component.textfield.TextField) VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) H2(com.vaadin.flow.component.html.H2) HorizontalLayout(com.vaadin.flow.component.orderedlayout.HorizontalLayout)

Aggregations

H2 (com.vaadin.flow.component.html.H2)68 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)29 Div (com.vaadin.flow.component.html.Div)25 Grid (com.vaadin.flow.component.grid.Grid)11 ComboBox (com.vaadin.flow.component.combobox.ComboBox)10 Button (com.vaadin.flow.component.button.Button)8 Paragraph (com.vaadin.flow.component.html.Paragraph)7 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)7 Route (com.vaadin.flow.router.Route)6 List (java.util.List)6 IntStream (java.util.stream.IntStream)6 NativeButton (com.vaadin.flow.component.html.NativeButton)5 ArrayList (java.util.ArrayList)5 Html (com.vaadin.flow.component.Html)4 TextField (com.vaadin.flow.component.textfield.TextField)4 Faker (com.github.javafaker.Faker)3 ItemFilter (com.vaadin.flow.component.combobox.ComboBox.ItemFilter)3 Label (com.vaadin.flow.component.html.Label)3 CallbackDataProvider (com.vaadin.flow.data.provider.CallbackDataProvider)3 ComponentRenderer (com.vaadin.flow.data.renderer.ComponentRenderer)3