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);
}
}
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));
}
}
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);
}
}
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));
}
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;
}
Aggregations