Here are the examples of the java api org.vaadin.viritin.layouts.MVerticalLayout.setComponentAlignment() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
7 Examples
17
View Complete Implementation : PasswordChangeWindow.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private void initUI() {
final MVerticalLayout mainLayout = new MVerticalLayout().withFullWidth();
Label lbInstruct1 = new ELabel(UserUIContext.getMessage(UserI18nEnum.MSG_PreplacedWORD_INSTRUCT_LABEL_1)).withFullWidth();
mainLayout.addComponent(lbInstruct1);
mainLayout.setComponentAlignment(lbInstruct1, Alignment.MIDDLE_LEFT);
final Label lbInstruct2 = new ELabel(UserUIContext.getMessage(UserI18nEnum.MSG_PreplacedWORD_INSTRUCT_LABEL_2)).withFullWidth();
mainLayout.addComponent(lbInstruct2);
mainLayout.setComponentAlignment(lbInstruct2, Alignment.MIDDLE_LEFT);
GridFormLayoutHelper preplacedInfo = GridFormLayoutHelper.defaultFormLayoutHelper(LayoutType.ONE_COLUMN);
txtNewPreplacedword = new PreplacedwordField();
preplacedInfo.addComponent(txtNewPreplacedword, UserUIContext.getMessage(ShellI18nEnum.OPT_NEW_PreplacedWORD), 0, 0);
txtConfirmPreplacedword = new PreplacedwordField();
preplacedInfo.addComponent(txtConfirmPreplacedword, UserUIContext.getMessage(ShellI18nEnum.OPT_CONFIRMED_PreplacedWORD), 0, 1);
mainLayout.addComponent(preplacedInfo.getLayout());
mainLayout.setComponentAlignment(preplacedInfo.getLayout(), Alignment.MIDDLE_CENTER);
MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close()).withStyleName(WebThemes.BUTTON_OPTION);
MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), clickEvent -> changePreplacedword()).withIcon(VaadinIcons.CLIPBOARD).withStyleName(WebThemes.BUTTON_ACTION).withClickShortcut(KeyCode.ENTER);
MHorizontalLayout hlayoutControls = new MHorizontalLayout(cancelBtn, saveBtn).withMargin(false);
mainLayout.with(hlayoutControls).withAlign(hlayoutControls, Alignment.MIDDLE_RIGHT);
this.setContent(mainLayout);
}
16
View Complete Implementation : ContactInfoChangeWindow.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private void initUI() {
MVerticalLayout mainLayout = new MVerticalLayout().withMargin(true).withFullWidth();
GridFormLayoutHelper preplacedInfo = GridFormLayoutHelper.defaultFormLayoutHelper(LayoutType.ONE_COLUMN);
preplacedInfo.addComponent(txtWorkPhone, UserUIContext.getMessage(UserI18nEnum.FORM_WORK_PHONE), 0, 0);
preplacedInfo.addComponent(txtHomePhone, UserUIContext.getMessage(UserI18nEnum.FORM_HOME_PHONE), 0, 1);
preplacedInfo.addComponent(txtFaceBook, "Facebook", 0, 2);
preplacedInfo.addComponent(txtTwitter, "Twitter", 0, 3);
preplacedInfo.addComponent(txtSkype, "Skype", 0, 4);
txtWorkPhone.setValue(MoreObjects.firstNonNull(user.getWorkphone(), ""));
txtHomePhone.setValue(MoreObjects.firstNonNull(user.getHomephone(), ""));
txtFaceBook.setValue(MoreObjects.firstNonNull(user.getFacebookaccount(), ""));
txtTwitter.setValue(MoreObjects.firstNonNull(user.getTwitteraccount(), ""));
txtSkype.setValue(MoreObjects.firstNonNull(user.getSkypecontact(), ""));
mainLayout.addComponent(preplacedInfo.getLayout());
mainLayout.setComponentAlignment(preplacedInfo.getLayout(), Alignment.TOP_LEFT);
MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close()).withStyleName(WebThemes.BUTTON_OPTION);
MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), clickEvent -> changeUserInfo()).withIcon(VaadinIcons.CLIPBOARD).withStyleName(WebThemes.BUTTON_ACTION).withClickShortcut(KeyCode.ENTER);
MHorizontalLayout hlayoutControls = new MHorizontalLayout(cancelBtn, saveBtn);
mainLayout.with(hlayoutControls).withAlign(hlayoutControls, Alignment.MIDDLE_RIGHT);
this.setContent(mainLayout);
}
15
View Complete Implementation : MailFormWindow.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private void initUI() {
MVerticalLayout mainLayout = new MVerticalLayout().withFullWidth();
inputLayout = new GridLayout(3, 4);
inputLayout.setSpacing(true);
inputLayout.setWidth("100%");
inputLayout.setColumnExpandRatio(0, 1.0f);
mainLayout.addComponent(inputLayout);
tokenFieldMailTo = new EmailTokenField();
inputLayout.addComponent(createTextFieldMailWithHelp("To:", tokenFieldMailTo), 0, 0);
if (mails != null) {
mails.stream().filter(mail -> mail.indexOf("<") > 0).map(mail -> {
String strMail = mail.substring(mail.indexOf("<") + 1, mail.lastIndexOf(">"));
if (strMail != null && !strMail.equalsIgnoreCase("null")) {
return strMail;
} else {
return "";
}
});
}
final MTextField subject = new MTextField().withRequiredIndicatorVisible(true).withFullWidth();
subjectField = createTextFieldMail("Subject:", subject);
inputLayout.addComponent(subjectField, 0, 1);
initButtonLinkCcBcc();
ccField = createTextFieldMailWithHelp("Cc:", tokenFieldMailCc);
bccField = createTextFieldMailWithHelp("Bcc:", tokenFieldMailBcc);
final RichTextArea noteArea = new RichTextArea();
noteArea.setWidth("100%");
noteArea.setHeight("200px");
mainLayout.addComponent(noteArea);
mainLayout.setComponentAlignment(noteArea, Alignment.MIDDLE_CENTER);
final AttachmentPanel attachments = new AttachmentPanel();
MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close()).withStyleName(WebThemes.BUTTON_OPTION);
MButton sendBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.ACTION_SEND_EMAIL), clickEvent -> {
if (tokenFieldMailTo.getListRecipients().size() <= 0 || subject.getValue().equals("")) {
NotificationUtil.showErrorNotification("To Email field and Subject field must be not empty! Please fulfil them before sending email.");
return;
}
if (UserUIContext.getUser().getEmail() != null && UserUIContext.getUser().getEmail().length() > 0) {
ExtMailService systemMailService = AppContextUtil.getSpringBean(ExtMailService.clreplaced);
List<File> files = attachments.files();
List<AttachmentSource> attachmentSource = new ArrayList<>();
if (CollectionUtils.isNotEmpty(files)) {
files.forEach(file -> attachmentSource.add(new FileAttachmentSource(file)));
}
if (reportTemplateExecutor != null) {
attachmentSource.add(new FileAttachmentSource(reportTemplateExecutor.getDefaultExportFileName(), reportTemplateExecutor.exportStream()));
}
systemMailService.sendHTMLMail(UserUIContext.getUser().getEmail(), UserUIContext.getUser().getDisplayName(), tokenFieldMailTo.getListRecipients(), tokenFieldMailCc.getListRecipients(), tokenFieldMailBcc.getListRecipients(), subject.getValue(), noteArea.getValue(), attachmentSource, true);
close();
} else {
NotificationUtil.showErrorNotification("Your email is empty value, please fulfil it before sending email!");
}
}).withIcon(VaadinIcons.PAPERPLANE).withStyleName(WebThemes.BUTTON_ACTION);
MHorizontalLayout controlsLayout = new MHorizontalLayout(cancelBtn, sendBtn).withMargin(new MarginInfo(false, true, true, false));
mainLayout.with(attachments);
mainLayout.addStyleName(WebThemes.SCROLLABLE_CONTAINER);
this.setContent(new MVerticalLayout(mainLayout, controlsLayout).withMargin(false).withSpacing(false).withAlign(controlsLayout, Alignment.TOP_RIGHT));
}
10
View Complete Implementation : ProfileReadViewImpl.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private void displayUserAvatar() {
avatarAndPreplaced.removeAllComponents();
Image cropField = UserAvatarControlFactory.createUserAvatarEmbeddedComponent(UserUIContext.getUserAvatarId(), 100);
cropField.addStyleName(WebThemes.CIRCLE_BOX);
CssLayout avatarWrapper = new CssLayout();
avatarWrapper.addComponent(cropField);
MVerticalLayout userAvatar = new MVerticalLayout().withMargin(false).with(avatarWrapper);
userAvatar.setSizeUndefined();
UploadImageField avatarUploadField = new UploadImageField(this);
avatarUploadField.setButtonCaption(UserUIContext.getMessage(UserI18nEnum.BUTTON_CHANGE_AVATAR));
userAvatar.addComponent(avatarUploadField);
avatarAndPreplaced.with(userAvatar);
User user = formItem.getBean();
MVerticalLayout basicLayout = new MVerticalLayout().withMargin(false);
ELabel usernameLbl = ELabel.h2(UserUIContext.getUser().getDisplayName()).withUndefinedWidth();
MButton btnChangeBasicInfo = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_EDIT), clickEvent -> UI.getCurrent().addWindow(new BasicInfoChangeWindow(formItem.getBean()))).withStyleName(WebThemes.BUTTON_LINK);
MHorizontalLayout userWrapper = new MHorizontalLayout(usernameLbl, btnChangeBasicInfo);
basicLayout.addComponent(userWrapper);
basicLayout.setComponentAlignment(userWrapper, Alignment.MIDDLE_LEFT);
GridFormLayoutHelper userFormLayout = GridFormLayoutHelper.defaultFormLayoutHelper(LayoutType.ONE_COLUMN);
userFormLayout.getLayout().addStyleName(WebThemes.GRIDFORM_BORDERLESS);
userFormLayout.addComponent(new Label(UserUIContext.formatDate(user.getBirthday())), UserUIContext.getMessage(UserI18nEnum.FORM_BIRTHDAY), 0, 0);
userFormLayout.addComponent(ELabel.html(new A("mailto:" + user.getEmail()).appendText(user.getEmail()).setTarget("_blank").write()), UserUIContext.getMessage(GenericI18Enum.FORM_EMAIL), 0, 1);
userFormLayout.addComponent(new Label(TimezoneVal.getDisplayName(UserUIContext.getUserLocale(), user.getTimezone())), UserUIContext.getMessage(UserI18nEnum.FORM_TIMEZONE), 0, 2);
userFormLayout.addComponent(new Label(LocalizationHelper.getLocaleInstance(user.getLanguage()).getDisplayLanguage(UserUIContext.getUserLocale())), UserUIContext.getMessage(UserI18nEnum.FORM_LANGUAGE), UserUIContext.getMessage(ShellI18nEnum.OPT_SUPPORTED_LANGUAGES_INTRO), 0, 3);
MButton btnChangePreplacedword = new MButton(UserUIContext.getMessage(GenericI18Enum.ACTION_CHANGE), clickEvent -> UI.getCurrent().addWindow(new PreplacedwordChangeWindow(formItem.getBean()))).withStyleName(WebThemes.BUTTON_LINK);
userFormLayout.addComponent(new CssLayout(new MHorizontalLayout(new ELabel("***********"), btnChangePreplacedword).withAlign(btnChangePreplacedword, Alignment.TOP_RIGHT)), UserUIContext.getMessage(ShellI18nEnum.FORM_PreplacedWORD), 0, 4);
basicLayout.addComponent(userFormLayout.getLayout());
avatarAndPreplaced.with(basicLayout).expand(basicLayout);
}
9
View Complete Implementation : UserReadViewImpl.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private void displayUserAvatar() {
header.removeAllComponents();
MHorizontalLayout avatarAndPreplaced = new MHorizontalLayout().withFullWidth();
Image cropField = UserAvatarControlFactory.createUserAvatarEmbeddedComponent(user.getAvatarid(), 100);
cropField.addStyleName(WebThemes.CIRCLE_BOX);
CssLayout userAvatar = new CssLayout();
userAvatar.addComponent(cropField);
avatarAndPreplaced.addComponent(userAvatar);
MVerticalLayout basicLayout = new MVerticalLayout().withMargin(new MarginInfo(false, true, false, true));
CssLayout userWrapper = new CssLayout();
String nickName = user.getNickname();
ELabel userName = ELabel.h2(user.getDisplayName() + (StringUtils.isEmpty(nickName) ? "" : (String.format(" ( %s )", nickName))));
userWrapper.addComponent(userName);
basicLayout.addComponent(userWrapper);
basicLayout.setComponentAlignment(userWrapper, Alignment.MIDDLE_LEFT);
GridFormLayoutHelper userFormLayout = GridFormLayoutHelper.defaultFormLayoutHelper(LayoutType.ONE_COLUMN);
userFormLayout.getLayout().addStyleName(WebThemes.GRIDFORM_BORDERLESS);
basicLayout.addComponent(userFormLayout.getLayout());
Node roleDiv;
if (Boolean.TRUE.equals(user.isAccountOwner())) {
roleDiv = new Div().appendText(UserUIContext.getMessage(RoleI18nEnum.OPT_ACCOUNT_OWNER));
} else {
roleDiv = new A(AccountLinkGenerator.generateRoleLink(user.getRoleId())).appendText(user.getRoleName());
}
userFormLayout.addComponent(ELabel.html(roleDiv.write()), UserUIContext.getMessage(UserI18nEnum.FORM_ROLE), 0, 0);
userFormLayout.addComponent(new Label(UserUIContext.formatDate(user.getBirthday())), UserUIContext.getMessage(UserI18nEnum.FORM_BIRTHDAY), 0, 1);
if (Boolean.TRUE.equals(AppUI.showEmailPublicly())) {
userFormLayout.addComponent(ELabel.html(new A("mailto:" + user.getEmail()).appendText(user.getEmail()).write()), UserUIContext.getMessage(GenericI18Enum.FORM_EMAIL), 0, 2);
} else {
userFormLayout.addComponent(ELabel.html("******"), UserUIContext.getMessage(GenericI18Enum.FORM_EMAIL), 0, 2);
}
userFormLayout.addComponent(new Label(TimezoneVal.getDisplayName(UserUIContext.getUserLocale(), user.getTimezone())), UserUIContext.getMessage(UserI18nEnum.FORM_TIMEZONE), 0, 3);
userFormLayout.addComponent(new Label(LocalizationHelper.getLocaleInstance(user.getLanguage()).getDisplayLanguage(UserUIContext.getUserLocale())), UserUIContext.getMessage(UserI18nEnum.FORM_LANGUAGE), 0, 4);
if (UserUIContext.isAdmin()) {
MButton btnChangePreplacedword = new MButton(UserUIContext.getMessage(GenericI18Enum.ACTION_CHANGE), clickEvent -> UI.getCurrent().addWindow(new PreplacedwordChangeWindow(user))).withStyleName(WebThemes.BUTTON_LINK);
ELabel label = ELabel.EMPTY_SPACE();
userFormLayout.addComponent(new MHorizontalLayout(new ELabel("***********"), btnChangePreplacedword, label).expand(label), UserUIContext.getMessage(ShellI18nEnum.FORM_PreplacedWORD), 0, 5);
}
avatarAndPreplaced.with(basicLayout).withAlign(basicLayout, Alignment.TOP_LEFT).expand(basicLayout);
Layout controlButtons = createTopPanel();
CssLayout avatarAndPreplacedWrapper = new CssLayout();
avatarAndPreplaced.setWidthUndefined();
avatarAndPreplacedWrapper.addComponent(avatarAndPreplaced);
header.with(avatarAndPreplaced, controlButtons).withAlign(avatarAndPreplaced, Alignment.TOP_LEFT).withAlign(controlButtons, Alignment.TOP_RIGHT);
}
0
View Complete Implementation : ProjectMemberListViewImpl.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private Component generateMemberBlock(final SimpleProjectMember member) {
MHorizontalLayout blockContent = new MHorizontalLayout().withSpacing(false).withStyleName("member-block").withWidth("350px");
if (ProjectMemberStatusConstants.NOT_ACCESS_YET.equals(member.getStatus())) {
blockContent.addStyleName("inactive");
}
Image memberAvatar = UserAvatarControlFactory.createUserAvatarEmbeddedComponent(member.getMemberAvatarId(), 100);
memberAvatar.addStyleName(WebThemes.CIRCLE_BOX);
memberAvatar.setWidthUndefined();
blockContent.addComponent(memberAvatar);
MVerticalLayout blockTop = new MVerticalLayout().withMargin(new MarginInfo(false, false, false, true)).withFullWidth();
MButton editBtn = new MButton("", clickEvent -> EventBusFactory.getInstance().post(new ProjectMemberEvent.GotoEdit(this, member))).withIcon(VaadinIcons.EDIT).withStyleName(WebThemes.BUTTON_LINK).withVisible(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.USERS));
editBtn.setDescription("Edit user '" + member.getDisplayName() + "' information");
MButton deleteBtn = new MButton("", clickEvent -> {
ConfirmDialogExt.show(UI.getCurrent(), UserUIContext.getMessage(GenericI18Enum.DIALOG_DELETE_replacedLE, AppUI.getSiteName()), UserUIContext.getMessage(GenericI18Enum.DIALOG_DELETE_SINGLE_ITEM_MESSAGE), UserUIContext.getMessage(GenericI18Enum.ACTION_YES), UserUIContext.getMessage(GenericI18Enum.ACTION_NO), confirmDialog -> {
if (confirmDialog.isConfirmed()) {
ProjectMemberService prjMemberService = AppContextUtil.getSpringBean(ProjectMemberService.clreplaced);
prjMemberService.removeWithSession(member, UserUIContext.getUsername(), AppUI.getAccountId());
EventBusFactory.getInstance().post(new ProjectMemberEvent.GotoList(ProjectMemberListViewImpl.this, CurrentProjectVariables.getProjectId()));
}
});
}).withIcon(VaadinIcons.TRASH).withStyleName(WebThemes.BUTTON_LINK).withVisible(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.USERS)).withDescription("Remove user '" + member.getDisplayName() + "' out of this project");
MHorizontalLayout buttonControls = new MHorizontalLayout(editBtn, deleteBtn);
blockTop.addComponent(buttonControls);
blockTop.setComponentAlignment(buttonControls, Alignment.TOP_RIGHT);
A memberLink = new A(ProjectLinkGenerator.generateProjectMemberLink(member.getProjectid(), member.getUsername())).appendText(member.getMemberFullName()).setreplacedle(member.getMemberFullName());
ELabel memberNameLbl = ELabel.h3(memberLink.write()).withStyleName(WebThemes.TEXT_ELLIPSIS).withFullWidth();
blockTop.with(memberNameLbl, ELabel.hr());
A roleLink = new A(ProjectLinkGenerator.generateRolePreviewLink(member.getProjectid(), member.getProjectroleid())).appendText(member.getRoleName());
blockTop.addComponent(ELabel.html(roleLink.write()).withFullWidth().withStyleName(WebThemes.TEXT_ELLIPSIS));
if (Boolean.TRUE.equals(AppUI.showEmailPublicly())) {
Label memberEmailLabel = ELabel.html(String.format("<a href='mailto:%s'>%s</a>", member.getUsername(), member.getUsername())).withStyleName(WebThemes.META_INFO).withFullWidth();
blockTop.addComponent(memberEmailLabel);
}
ELabel memberSinceLabel = ELabel.html(UserUIContext.getMessage(UserI18nEnum.OPT_MEMBER_SINCE, UserUIContext.formatPrettyTime(member.getCreatedtime()))).withDescription(UserUIContext.formatDateTime(member.getCreatedtime())).withFullWidth();
blockTop.addComponent(memberSinceLabel);
if (ProjectMemberStatusConstants.ACTIVE.equals(member.getStatus())) {
ELabel lastAccessTimeLbl = ELabel.html(UserUIContext.getMessage(UserI18nEnum.OPT_MEMBER_LOGGED_IN, UserUIContext.formatPrettyTime(member.getLastAccessTime()))).withDescription(UserUIContext.formatDateTime(member.getLastAccessTime()));
blockTop.addComponent(lastAccessTimeLbl);
}
String memberWorksInfo = ProjectreplacedetsManager.getreplacedet(ProjectTypeConstants.TASK).getHtml() + " " + new Span().appendText("" + member.getNumOpenTasks()).setreplacedle(UserUIContext.getMessage(ProjectCommonI18nEnum.OPT_OPEN_TASKS)) + " " + ProjectreplacedetsManager.getreplacedet(ProjectTypeConstants.BUG).getHtml() + " " + new Span().appendText("" + member.getNumOpenBugs()).setreplacedle(UserUIContext.getMessage(ProjectCommonI18nEnum.OPT_OPEN_BUGS)) + " " + VaadinIcons.MONEY.getHtml() + " " + new Span().appendText("" + NumberUtils.roundDouble(2, member.getTotalBillableLogTime())).setreplacedle(UserUIContext.getMessage(TimeTrackingI18nEnum.OPT_BILLABLE_HOURS)) + " " + VaadinIcons.GIFT.getHtml() + " " + new Span().appendText("" + NumberUtils.roundDouble(2, member.getTotalNonBillableLogTime())).setreplacedle(UserUIContext.getMessage(TimeTrackingI18nEnum.OPT_NON_BILLABLE_HOURS));
blockTop.addComponent(ELabel.html(memberWorksInfo).withStyleName(WebThemes.META_INFO));
blockContent.with(blockTop);
blockContent.setExpandRatio(blockTop, 1.0f);
return blockContent;
}
0
View Complete Implementation : BasicInfoChangeWindow.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private void initUI() {
MVerticalLayout mainLayout = new MVerticalLayout().withMargin(true).withFullWidth();
GridFormLayoutHelper preplacedInfo = GridFormLayoutHelper.defaultFormLayoutHelper(LayoutType.ONE_COLUMN);
preplacedInfo.addComponent(txtFirstName, UserUIContext.getMessage(UserI18nEnum.FORM_FIRST_NAME), 0, 0);
preplacedInfo.addComponent(txtLastName, UserUIContext.getMessage(UserI18nEnum.FORM_LAST_NAME), 0, 1);
txtLastName.setRequiredIndicatorVisible(true);
preplacedInfo.addComponent(txtEmail, UserUIContext.getMessage(GenericI18Enum.FORM_EMAIL), 0, 2);
txtEmail.setRequiredIndicatorVisible(true);
preplacedInfo.addComponent(birthdayField, UserUIContext.getMessage(UserI18nEnum.FORM_BIRTHDAY), 0, 3);
birthdayField.setValue(user.getBirthday());
preplacedInfo.addComponent(timeZoneField, UserUIContext.getMessage(UserI18nEnum.FORM_TIMEZONE), 0, 4);
timeZoneField.setValue(user.getTimezone());
preplacedInfo.addComponent(languageBox, UserUIContext.getMessage(UserI18nEnum.FORM_LANGUAGE), UserUIContext.getMessage(ShellI18nEnum.OPT_SUPPORTED_LANGUAGES_INTRO), 0, 5);
languageBox.setValue(user.getLanguage());
txtFirstName.setValue(MoreObjects.firstNonNull(user.getFirstname(), ""));
txtLastName.setValue(MoreObjects.firstNonNull(user.getLastname(), ""));
txtEmail.setValue(MoreObjects.firstNonNull(user.getEmail(), ""));
mainLayout.addComponent(preplacedInfo.getLayout());
mainLayout.setComponentAlignment(preplacedInfo.getLayout(), Alignment.TOP_LEFT);
MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close()).withStyleName(WebThemes.BUTTON_OPTION);
MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), clickEvent -> changeUserInfo()).withStyleName(WebThemes.BUTTON_ACTION).withIcon(VaadinIcons.CLIPBOARD).withClickShortcut(KeyCode.ENTER);
MHorizontalLayout hlayoutControls = new MHorizontalLayout(cancelBtn, saveBtn);
mainLayout.with(hlayoutControls).withAlign(hlayoutControls, Alignment.MIDDLE_RIGHT);
this.setContent(mainLayout);
}