Here are the examples of the java api com.vaadin.ui.Alignment.TOP_LEFT taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
25 Examples
19
View Complete Implementation : AbstractGridHeader.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private void buildLayout() {
final HorizontalLayout replacedleFilterIconsLayout = createHeaderFilterIconLayout();
replacedleFilterIconsLayout.addComponents(headerCaptionLayout);
if (isAllowSearch() && isRollout()) {
replacedleFilterIconsLayout.addComponents(searchField, searchResetIcon);
replacedleFilterIconsLayout.setExpandRatio(headerCaptionLayout, 0.3F);
replacedleFilterIconsLayout.setExpandRatio(searchField, 0.7F);
}
if (hasCreatePermission() && isRollout()) {
replacedleFilterIconsLayout.addComponent(addButton);
replacedleFilterIconsLayout.setComponentAlignment(addButton, Alignment.TOP_LEFT);
}
if (showCloseButton()) {
replacedleFilterIconsLayout.addComponent(closeButton);
replacedleFilterIconsLayout.setComponentAlignment(closeButton, Alignment.TOP_RIGHT);
}
replacedleFilterIconsLayout.setHeight("40px");
addComponent(replacedleFilterIconsLayout);
addStyleName("bordered-layout");
addStyleName("no-border-bottom");
}
19
View Complete Implementation : DefaultGridHeader.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
/**
* Builds the layout for the header component.
*/
protected void buildComponent() {
addComponent(replacedleLayout);
setComponentAlignment(replacedleLayout, Alignment.TOP_LEFT);
setWidth(100, Unit.PERCENTAGE);
setImmediate(true);
addStyleName("action-history-header");
addStyleName("bordered-layout");
addStyleName("no-border-bottom");
}
18
View Complete Implementation : AbstractTableDetailsLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
protected void buildLayout() {
nameEditLayout = new HorizontalLayout();
nameEditLayout.setWidth(100.0F, Unit.PERCENTAGE);
nameEditLayout.addComponent(caption);
nameEditLayout.setComponentAlignment(caption, Alignment.TOP_LEFT);
if (hasEditPermission()) {
nameEditLayout.addComponent(editButton);
nameEditLayout.setComponentAlignment(editButton, Alignment.TOP_RIGHT);
nameEditLayout.addComponent(manageMetadataBtn);
nameEditLayout.setComponentAlignment(manageMetadataBtn, Alignment.TOP_RIGHT);
}
nameEditLayout.setExpandRatio(caption, 1.0F);
nameEditLayout.addStyleName(SPUIStyleDefinitions.WIDGET_replacedLE);
addComponent(nameEditLayout);
setComponentAlignment(nameEditLayout, Alignment.TOP_CENTER);
addComponent(detailsTab);
setComponentAlignment(nameEditLayout, Alignment.TOP_CENTER);
setSizeFull();
setHeightUndefined();
addStyleName(SPUIStyleDefinitions.WIDGET_STYLE);
}
18
View Complete Implementation : CountryMenuItemFactoryImpl.java
Copyright Apache License 2.0
Author : Hack23
Copyright Apache License 2.0
Author : Hack23
@Override
public void createOverviewPage(final VerticalLayout panelContent) {
final MenuBar menuBar = new MenuBar();
panelContent.addComponent(menuBar);
panelContent.setComponentAlignment(menuBar, Alignment.TOP_LEFT);
panelContent.setExpandRatio(menuBar, ContentRatio.LARGE);
addSourcesAndIndicatorsToMenu(menuBar.addItem("By Topic", VaadinIcons.LINE_CHART, null), getTopicIndicatorMap());
menuBar.setAutoOpen(true);
}
17
View Complete Implementation : DeploymentView.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private void maximizeActionHistory() {
removeComponent(countMessageLabel);
mainLayout.removeAllComponents();
mainLayout.setColumns(3);
mainLayout.setRows(1);
mainLayout.addComponent(actionHistoryLayout, 0, 0);
mainLayout.addComponent(actionStatusLayout, 1, 0);
mainLayout.addComponent(actionStatusMsgLayout, 2, 0);
mainLayout.setColumnExpandRatio(0, 0.55F);
mainLayout.setColumnExpandRatio(1, 0.18F);
mainLayout.setColumnExpandRatio(2, 0.27F);
mainLayout.setComponentAlignment(actionHistoryLayout, Alignment.TOP_LEFT);
}
17
View Complete Implementation : AddViewLayout.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
Copyright GNU Affero General Public License v3.0
Author : MyCollab
public void addHeaderreplacedle(Component headerContainer) {
header.addComponent(headerContainer, 0);
header.withAlign(headerContainer, Alignment.TOP_LEFT).expand(headerContainer);
}
16
View Complete Implementation : DefaultGridHeader.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
/**
* Builds the replacedle layout.
*
* @return replacedle-layout
*/
protected HorizontalLayout buildreplacedleLayout() {
replacedleLayout = new HorizontalLayout();
replacedleLayout.addStyleName(SPUIStyleDefinitions.WIDGET_replacedLE);
replacedleLayout.setSpacing(false);
replacedleLayout.setMargin(false);
replacedleLayout.setSizeFull();
replacedleLayout.addComponent(replacedle);
replacedleLayout.setComponentAlignment(replacedle, Alignment.TOP_LEFT);
replacedleLayout.setExpandRatio(replacedle, 0.8F);
if (hasHeaderMaximizeSupport()) {
replacedleLayout.addComponents(getHeaderMaximizeSupport().maxMinButton);
replacedleLayout.setComponentAlignment(getHeaderMaximizeSupport().maxMinButton, Alignment.TOP_RIGHT);
replacedleLayout.setExpandRatio(getHeaderMaximizeSupport().maxMinButton, 0.2F);
}
return replacedleLayout;
}
15
View Complete Implementation : TargetFilterHeader.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private void buildLayout() {
final HorizontalLayout replacedleFilterIconsLayout = createHeaderFilterIconLayout();
replacedleFilterIconsLayout.addComponents(headerCaption, searchField, searchResetIcon);
if (permissionChecker.hasCreateTargetPermission()) {
replacedleFilterIconsLayout.addComponent(createfilterButton);
replacedleFilterIconsLayout.setComponentAlignment(createfilterButton, Alignment.TOP_LEFT);
}
replacedleFilterIconsLayout.setExpandRatio(headerCaption, 0.3F);
replacedleFilterIconsLayout.setExpandRatio(searchField, 0.7F);
replacedleFilterIconsLayout.setHeight("40px");
addComponent(replacedleFilterIconsLayout);
addStyleName("bordered-layout");
addStyleName("no-border-bottom");
}
15
View Complete Implementation : AdvancedInfoChangeWindow.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(txtWebsite, UserUIContext.getMessage(UserI18nEnum.FORM_WEBSITE), 0, 0);
preplacedInfo.addComponent(txtCompany, UserUIContext.getMessage(UserI18nEnum.FORM_COMPANY), 0, 1);
preplacedInfo.addComponent(cboCountry, UserUIContext.getMessage(UserI18nEnum.FORM_COUNTRY), 0, 2);
txtWebsite.setValue(MoreObjects.firstNonNull(user.getWebsite(), ""));
txtCompany.setValue(MoreObjects.firstNonNull(user.getCompany(), ""));
cboCountry.setValue(MoreObjects.firstNonNull(user.getCountry(), ""));
mainLayout.with(preplacedInfo.getLayout()).withAlign(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 -> changeInfo()).withStyleName(WebThemes.BUTTON_ACTION).withIcon(VaadinIcons.CLIPBOARD).withClickShortcut(KeyCode.ENTER);
MHorizontalLayout buttonControls = new MHorizontalLayout(cancelBtn, saveBtn);
mainLayout.with(buttonControls).withAlign(buttonControls, Alignment.MIDDLE_RIGHT);
this.setModal(true);
this.setContent(mainLayout);
}
15
View Complete Implementation : UserBulkInviteViewImpl.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
Copyright GNU Affero General Public License v3.0
Author : MyCollab
@Override
public void display() {
removeAllComponents();
ELabel replacedleLbl = ELabel.h2(UserUIContext.getMessage(UserI18nEnum.BULK_INVITE));
MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), (Button.ClickListener) clickEvent -> {
EventBusFactory.getInstance().post(new UserEvent.GotoList(this, null));
}).withStyleName(WebThemes.BUTTON_OPTION);
MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), (Button.ClickListener) clickEvent -> {
sendInviteBulkUsers();
}).withStyleName(WebThemes.BUTTON_ACTION);
this.with(new MHorizontalLayout(replacedleLbl, cancelBtn, saveBtn).withExpand(replacedleLbl, 1.0f).withFullWidth());
roleComboBox = new RoleComboBox();
roleComboBox.addValueChangeListener((HasValue.ValueChangeListener<SimpleRole>) valueChangeEvent -> {
displayRolePermission(valueChangeEvent.getSource().getValue());
});
this.with(new MHorizontalLayout(ELabel.html(UserUIContext.getMessage(RoleI18nEnum.SINGLE)).withStyleName(WebThemes.META_COLOR), roleComboBox).alignAll(Alignment.TOP_LEFT));
ResponsiveLayout mainLayout = new ResponsiveLayout().withStyleName(WebThemes.MARGIN_TOP);
ResponsiveRow mainRow = mainLayout.addRow();
bulkInviteUsersLayout = new GridLayout(3, 1);
bulkInviteUsersLayout.setSpacing(true);
ResponsiveColumn column1 = new ResponsiveColumn(12, 12, 6, 6).withComponent(bulkInviteUsersLayout);
ResponsiveColumn column2 = new ResponsiveColumn(12, 12, 6, 6).withVisibilityRules(false, false, true, true).withComponent(rolePermissionDisplayLayout);
mainRow.addColumn(column1);
mainRow.addColumn(column2);
bulkInviteUsersLayout.addComponent(ELabel.h3(UserUIContext.getMessage(GenericI18Enum.FORM_EMAIL)).withWidth("220px"), 0, 0);
bulkInviteUsersLayout.addComponent(ELabel.h3(UserUIContext.getMessage(ShellI18nEnum.FORM_PreplacedWORD)), 1, 0);
this.with(mainLayout);
displayRolePermission(roleComboBox.getValue());
buildInviteUserBlock();
}
14
View Complete Implementation : LoginView.java
Copyright Apache License 2.0
Author : chelu
Copyright Apache License 2.0
Author : chelu
@Override
protected Component buildPanel() {
Label greeting = new Label(getMessage("loginView.greeting"));
greeting.addStyleName("jd-login-greeting");
greeting.addStyleName(Reindeer.LABEL_H2);
Label applicationNameLabel = new Label(getMessage(applicationName));
applicationNameLabel.addStyleName("jd-login-appname");
applicationNameLabel.addStyleName(Reindeer.LABEL_H2);
applicationNameLabel.setSizeUndefined();
loginButton.addClickListener(this);
loginButton.setCaption(getMessage("loginView.loginButtonCaption"));
loginButton.addStyleName("jd-login-button");
// add shortcut listener for enter key
loginButton.addShortcutListener(new ShortcutListener("Sign In", KeyCode.ENTER, null) {
@Override
public void handleAction(Object sender, Object target) {
loginButton.click();
}
});
Image image = null;
HorizontalLayout imageWrapper = null;
if (applicationIcon != null) {
image = new Image(null, applicationIcon);
image.setSizeUndefined();
image.setStyleName("jd-login-icon");
imageWrapper = new HorizontalLayout();
imageWrapper.setMargin(false);
imageWrapper.addComponent(image);
imageWrapper.setComponentAlignment(image, Alignment.MIDDLE_CENTER);
}
BoxFormBuilder fb = new BoxFormBuilder();
fb.setDefaultWidth(BoxFormBuilder.SIZE_FULL);
fb.row();
fb.startBox();
fb.setFixedHeight();
fb.row(false);
fb.add(greeting, Alignment.TOP_LEFT);
fb.add(applicationNameLabel, Alignment.TOP_RIGHT);
fb.endBox();
// add application icon
if (image != null) {
fb.row(BoxFormBuilder.SIZE_FULL);
fb.add(imageWrapper, BoxFormBuilder.SIZE_FULL, Alignment.MIDDLE_CENTER);
}
fb.row();
fb.startBox();
fb.row(30);
fb.add(errorLabel, BoxFormBuilder.SIZE_FULL, Alignment.BOTTOM_CENTER);
fb.endBox();
fb.row();
fb.startBox();
fb.setFixedHeight();
fb.row();
fb.add(username, getMessage("loginView.username"), Alignment.BOTTOM_CENTER);
fb.add(preplacedword, getMessage("loginView.preplacedword"), Alignment.BOTTOM_CENTER);
fb.add(loginButton, 100, Alignment.BOTTOM_CENTER);
fb.endBox();
Component form = fb.getForm();
form.setWidth(this.getWidth(), Unit.PIXELS);
form.setHeight(getHeight(), Unit.PIXELS);
form.setStyleName("jd-login");
HorizontalLayout hl = new HorizontalLayout();
hl.setMargin(false);
hl.addComponent(form);
hl.setComponentAlignment(form, Alignment.MIDDLE_CENTER);
hl.setSizeFull();
hl.setStyleName("jd-login-layout");
return hl;
}
14
View Complete Implementation : ArtifactDetailsLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private void buildLayout() {
final HorizontalLayout header = new HorizontalLayout();
header.addStyleName("artifact-details-header");
header.addStyleName("bordered-layout");
header.addStyleName("no-border-bottom");
header.setSpacing(false);
header.setMargin(false);
header.setSizeFull();
header.setHeightUndefined();
header.setImmediate(true);
header.addComponents(replacedleOfArtifactDetails, maxMinButton);
header.setComponentAlignment(replacedleOfArtifactDetails, Alignment.TOP_LEFT);
header.setComponentAlignment(maxMinButton, Alignment.TOP_RIGHT);
header.setExpandRatio(replacedleOfArtifactDetails, 1.0F);
setSizeFull();
setImmediate(true);
addStyleName("artifact-table");
addStyleName("table-layout");
addComponent(header);
setComponentAlignment(header, Alignment.MIDDLE_CENTER);
addComponent(artifactDetailsTable);
setComponentAlignment(artifactDetailsTable, Alignment.MIDDLE_CENTER);
setExpandRatio(artifactDetailsTable, 1.0F);
}
14
View Complete Implementation : AbstractFilterHeader.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private void buildLayout() {
setStyleName("filter-btns-header-layout");
typeHeaderLayout = new HorizontalLayout();
typeHeaderLayout.setHeight(32, Unit.PIXELS);
typeHeaderLayout.setWidth(100.0F, Unit.PERCENTAGE);
typeHeaderLayout.addComponentAsFirst(replacedle);
typeHeaderLayout.addStyleName(SPUIStyleDefinitions.WIDGET_replacedLE);
typeHeaderLayout.setComponentAlignment(replacedle, Alignment.TOP_LEFT);
if (menu != null) {
typeHeaderLayout.addComponent(menu);
typeHeaderLayout.setComponentAlignment(menu, Alignment.TOP_RIGHT);
}
typeHeaderLayout.addComponent(hideIcon);
typeHeaderLayout.setComponentAlignment(hideIcon, Alignment.TOP_RIGHT);
typeHeaderLayout.setExpandRatio(replacedle, 1.0F);
addComponent(typeHeaderLayout);
}
14
View Complete Implementation : ProjectActivityStreamPagedList.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
Copyright GNU Affero General Public License v3.0
Author : MyCollab
protected void feedBlocksPut(LocalDate currentDate, LocalDate nextDate, ComponentContainer currentBlock) {
MHorizontalLayout blockWrapper = new MHorizontalLayout().withSpacing(false).withFullWidth().withStyleName("feed-block-wrap");
blockWrapper.setDefaultComponentAlignment(Alignment.TOP_LEFT);
if (currentDate.getYear() != nextDate.getYear()) {
int currentYear = nextDate.getYear();
ELabel yearLbl = ELabel.html("<div>" + currentYear + "</div>").withStyleName("year-lbl").withUndefinedWidth();
this.addComponent(yearLbl);
} else {
blockWrapper.setMargin(new MarginInfo(true, false, false, false));
}
ELabel dateLbl = new ELabel(UserUIContext.formatShortDate(nextDate)).withStyleName("date-lbl").withUndefinedWidth();
blockWrapper.with(dateLbl, currentBlock).expand(currentBlock);
this.addComponent(blockWrapper);
}
14
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);
}
14
View Complete Implementation : ReportContainerImpl.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
Copyright GNU Affero General Public License v3.0
Author : MyCollab
@Override
public void showDashboard() {
body.removeAllComponents();
body.with(ELabel.h2(VaadinIcons.PIE_CHART.getHtml() + " " + UserUIContext.getMessage(ProjectCommonI18nEnum.VIEW_REPORTS)));
MCssLayout contentLayout = new MCssLayout().withStyleName(WebThemes.FLEX_DISPLAY);
MVerticalLayout standupConsole = new MVerticalLayout().withWidth("300px").withStyleName("member-block");
standupConsole.setDefaultComponentAlignment(Alignment.TOP_CENTER);
standupConsole.addComponent(ELabel.fontIcon(VaadinIcons.CALENDAR_CLOCK).withStyleName("icon-38px"));
A standupReportLink = new A(ProjectLinkGenerator.generateStandupDashboardLink()).appendText(UserUIContext.getMessage(ProjectReportI18nEnum.REPORT_STANDUP));
standupConsole.addComponent(ELabel.h3(standupReportLink.write()).withUndefinedWidth());
standupConsole.addComponent(new ELabel(UserUIContext.getMessage(ProjectReportI18nEnum.REPORT_STANDUP_HELP)).withFullWidth());
contentLayout.addComponent(standupConsole);
MVerticalLayout userWorkloadReport = new MVerticalLayout().withWidth("300px").withStyleName("member-block");
userWorkloadReport.setDefaultComponentAlignment(Alignment.TOP_CENTER);
userWorkloadReport.addComponent(ELabel.fontIcon(VaadinIcons.CALENDAR_CLOCK).withStyleName("icon-38px"));
A userWorkloadReportLink = new A(ProjectLinkGenerator.generateUsersWorkloadReportLink()).appendText(UserUIContext.getMessage(ProjectReportI18nEnum.REPORT_TICKET_replacedIGNMENT));
userWorkloadReport.addComponent(ELabel.h3(userWorkloadReportLink.write()).withUndefinedWidth());
userWorkloadReport.addComponent(new ELabel(UserUIContext.getMessage(ProjectReportI18nEnum.REPORT_TICKET_replacedIGNMENT_HELP)).withFullWidth());
contentLayout.addComponent(userWorkloadReport);
body.with(contentLayout).expand(contentLayout).withAlign(contentLayout, Alignment.TOP_LEFT);
}
14
View Complete Implementation : SensorAdminPanel.java
Copyright Mozilla Public License 2.0
Author : sensiasoft
Copyright Mozilla Public License 2.0
Author : sensiasoft
protected Panel newPanel(String replacedle) {
Panel panel = new Panel(replacedle);
VerticalLayout layout = new VerticalLayout();
layout.setSizeFull();
layout.setMargin(true);
layout.setSpacing(true);
layout.setDefaultComponentAlignment(Alignment.TOP_LEFT);
panel.setContent(layout);
return panel;
}
13
View Complete Implementation : TicketRowDisplayHandler.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
Copyright GNU Affero General Public License v3.0
Author : MyCollab
@Override
public Component generateRow(IBeanList<ProjectTicket> host, ProjectTicket ticket, int rowIndex) {
MHorizontalLayout rowComp = new MHorizontalLayout().withStyleName("list-row").withFullWidth();
rowComp.setDefaultComponentAlignment(Alignment.TOP_LEFT);
Div issueDiv = new Div().appendText(ProjectreplacedetsManager.getreplacedet(ticket.getType()).getHtml());
String status = "";
if (ticket.isBug()) {
status = UserUIContext.getMessage(StatusI18nEnum.clreplaced, ticket.getStatus());
rowComp.addStyleName("bug");
} else if (ticket.isMilestone()) {
status = UserUIContext.getMessage(MilestoneStatus.clreplaced, ticket.getStatus());
rowComp.addStyleName("milestone");
} else if (ticket.isRisk()) {
status = UserUIContext.getMessage(StatusI18nEnum.clreplaced, ticket.getStatus());
rowComp.addStyleName("risk");
} else if (ticket.isTask()) {
status = UserUIContext.getMessage(StatusI18nEnum.clreplaced, ticket.getStatus());
rowComp.addStyleName("task");
}
issueDiv.appendChild(new Span().appendText(status).setCSSClreplaced(WebThemes.BLOCK));
String avatarLink = StorageUtils.getAvatarPath(ticket.getreplacedignUserAvatarId(), 16);
Img img = new Img(ticket.getreplacedignUserFullName(), avatarLink).setCSSClreplaced(WebThemes.CIRCLE_BOX).setreplacedle(ticket.getreplacedignUserFullName());
issueDiv.appendChild(img, DivLessFormatter.EMPTY_SPACE);
A ticketLink = new A().setId("tag" + TooltipHelper.TOOLTIP_ID);
ticketLink.setAttribute("onmouseover", TooltipHelper.projectHoverJsFunction(ticket.getType(), ticket.getTypeId() + ""));
ticketLink.setAttribute("onmouseleave", TooltipHelper.itemMouseLeaveJsFunction());
if (displayPrjShortname) {
ticketLink.appendText(String.format("[%s] - %s", ticket.getProjectShortName(), ticket.getName()));
} else {
ticketLink.appendText(ticket.getName());
}
ticketLink.setHref(ProjectLinkGenerator.generateProjecreplacedemLink(ticket.getProjectShortName(), ticket.getProjectId(), ticket.getType(), ticket.getExtraTypeId() + ""));
issueDiv.appendChild(ticketLink);
if (ticket.isClosed()) {
ticketLink.setCSSClreplaced("completed");
} else if (ticket.isOverdue()) {
ticketLink.setCSSClreplaced("overdue");
issueDiv.appendChild(new Span().appendText(" - " + UserUIContext.getMessage(ProjectCommonI18nEnum.OPT_DUE_IN, UserUIContext.formatDuration(ticket.getDueDate()))).setCSSClreplaced(WebThemes.META_INFO));
}
rowComp.with(ELabel.html(issueDiv.write()).withFullWidth());
return rowComp;
}
13
View Complete Implementation : LogoEditWindow.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private void editPhoto(byte[] imageData) {
try {
originalImage = ImageIO.read(new ByteArrayInputStream(imageData));
} catch (IOException e) {
throw new UserInvalidInputException("Invalid image type");
}
originalImage = ImageUtil.scaleImage(originalImage, 650, 650);
MHorizontalLayout previewBox = new MHorizontalLayout().withMargin(new MarginInfo(false, true, true, false)).withFullWidth();
final String logoPath = AppUI.getBillingAccount().getLogopath();
Resource defaultPhoto = AccountreplacedetsResolver.createLogoResource(logoPath, 150);
previewImage = new Embedded(null, defaultPhoto);
previewImage.setWidth("100px");
previewBox.addComponent(previewImage);
previewBox.setComponentAlignment(previewImage, Alignment.TOP_LEFT);
MVerticalLayout previewBoxRight = new MVerticalLayout().withSpacing(false).withMargin(new MarginInfo(false, true, false, true));
previewBoxRight.addComponent(ELabel.html(UserUIContext.getMessage(ShellI18nEnum.OPT_IMAGE_EDIT_INSTRUCTION)));
MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> EventBusFactory.getInstance().post(new SettingEvent.GotoGeneralSetting(LogoEditWindow.this, null))).withStyleName(WebThemes.BUTTON_OPTION);
MButton acceptBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_ACCEPT), clickEvent -> {
if (scaleImageData != null && scaleImageData.length > 0) {
try {
BufferedImage image = ImageIO.read(new ByteArrayInputStream(scaleImageData));
AccountLogoService accountLogoService = AppContextUtil.getSpringBean(AccountLogoService.clreplaced);
accountLogoService.upload(UserUIContext.getUsername(), image, AppUI.getAccountId());
UIUtils.reloadPage();
} catch (IOException e) {
throw new MyCollabException("Error when saving account logo", e);
}
}
}).withStyleName(WebThemes.BUTTON_ACTION).withIcon(VaadinIcons.CLIPBOARD).withClickShortcut(ShortcutAction.KeyCode.ENTER);
MHorizontalLayout controlBtns = new MHorizontalLayout(acceptBtn, cancelBtn);
previewBoxRight.with(controlBtns).withAlign(controlBtns, Alignment.TOP_LEFT);
previewBox.with(previewBoxRight).expand(previewBoxRight);
content.addComponent(previewBox);
CssLayout cropBox = new CssLayout();
cropBox.setWidth("100%");
VerticalLayout currentPhotoBox = new VerticalLayout();
Resource resource = new ByteArrayImageResource(ImageUtil.convertImageToByteArray(originalImage), "image/png");
Cropper cropField = new Cropper(resource);
cropField.setAspectRatio(150 / 28);
cropField.addCropSelectionChangedListener(valueChangeEvent -> {
CropSelection newSelection = valueChangeEvent.getSelection();
int x1 = newSelection.getX();
int y1 = newSelection.getY();
int x2 = newSelection.getWidth();
int y2 = newSelection.getHeight();
if (x2 > x1 && y2 > y1) {
BufferedImage subImage = originalImage.getSubimage(x1, y1, x2, y2);
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
try {
ImageIO.write(subImage, "png", outStream);
scaleImageData = outStream.toByteArray();
displayPreviewImage();
} catch (IOException e) {
LOG.error("Error while scale image: ", e);
}
}
});
currentPhotoBox.setWidth("650px");
currentPhotoBox.setHeight("650px");
currentPhotoBox.addComponent(cropField);
cropBox.addComponent(currentPhotoBox);
content.with(previewBox, ELabel.hr(), cropBox);
}
12
View Complete Implementation : StorageAdminPanel.java
Copyright Mozilla Public License 2.0
Author : sensiasoft
Copyright Mozilla Public License 2.0
Author : sensiasoft
protected Panel newPanel(String replacedle) {
Panel panel = new Panel(replacedle);
GridLayout layout = new GridLayout(2, 2);
layout.setWidth(100.0f, Unit.PERCENTAGE);
layout.setMargin(true);
layout.setSpacing(true);
layout.setColumnExpandRatio(0, 0.2f);
layout.setColumnExpandRatio(1, 0.8f);
layout.setDefaultComponentAlignment(Alignment.TOP_LEFT);
panel.setContent(layout);
return panel;
}
11
View Complete Implementation : CreateOrUpdateFilterHeader.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private void buildLayout() {
captionLayout = new HorizontalLayout();
captionLayout.setDescription(i18n.getMessage("tooltip.click.to.edit"));
captionLayout.setId(UIComponentIdProvider.TARGET_FILTER_QUERY_NAME_LAYOUT_ID);
replacedleFilterIconsLayout = new HorizontalLayout();
replacedleFilterIconsLayout.addComponents(headerCaption, captionLayout);
replacedleFilterIconsLayout.setSpacing(true);
final HorizontalLayout breadcrumbLayout = new HorizontalLayout();
breadcrumbLayout.addComponent(breadcrumbButton);
breadcrumbLayout.addComponent(new Label(">"));
breadcrumbName = new LabelBuilder().buildCaptionLabel();
breadcrumbLayout.addComponent(breadcrumbName);
breadcrumbName.addStyleName("breadcrumbPaddingLeft");
final HorizontalLayout replacedleFilterLayout = new HorizontalLayout();
replacedleFilterLayout.setSizeFull();
replacedleFilterLayout.addComponents(replacedleFilterIconsLayout, closeIcon);
replacedleFilterLayout.setExpandRatio(replacedleFilterIconsLayout, 1.0F);
replacedleFilterLayout.setComponentAlignment(replacedleFilterIconsLayout, Alignment.TOP_LEFT);
replacedleFilterLayout.setComponentAlignment(closeIcon, Alignment.TOP_RIGHT);
final HorizontalLayout iconLayout = new HorizontalLayout();
iconLayout.setSizeUndefined();
iconLayout.setSpacing(false);
iconLayout.addComponents(helpLink, searchIcon, saveButton);
final HorizontalLayout queryLayout = new HorizontalLayout();
queryLayout.setSizeUndefined();
queryLayout.setSpacing(true);
queryLayout.addComponents(queryTextField, iconLayout);
addComponent(breadcrumbLayout);
addComponent(replacedleFilterLayout);
addComponent(queryLayout);
setSpacing(true);
addStyleName(SPUIStyleDefinitions.WIDGET_replacedLE);
addStyleName("bordered-layout");
}
11
View Complete Implementation : TicketRowRenderer.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
Copyright GNU Affero General Public License v3.0
Author : MyCollab
@Override
public Component generateRow(IBeanList<ProjectTicket> host, ProjectTicket genericTask, int rowIndex) {
MHorizontalLayout rowComp = new MHorizontalLayout().withMargin(new MarginInfo(false, false, false, true)).withStyleName(WebThemes.HOVER_EFFECT_NOT_BOX, WebThemes.MARGIN_BOTTOM);
rowComp.setDefaultComponentAlignment(Alignment.TOP_LEFT);
rowComp.with(ELabel.fontIcon(ProjectreplacedetsManager.getreplacedet(genericTask.getType())).withUndefinedWidth());
String status;
if (genericTask.isMilestone()) {
status = UserUIContext.getMessage(OptionI18nEnum.MilestoneStatus.clreplaced, genericTask.getStatus());
} else {
status = UserUIContext.getMessage(com.mycollab.common.i18n.OptionI18nEnum.StatusI18nEnum.clreplaced, genericTask.getStatus());
}
rowComp.with(new ELabel(status).withStyleName(WebThemes.BLOCK).withUndefinedWidth());
String avatarLink = StorageUtils.getAvatarPath(genericTask.getreplacedignUserAvatarId(), 16);
Img img = new Img(genericTask.getreplacedignUserFullName(), avatarLink).setCSSClreplaced(WebThemes.CIRCLE_BOX).setreplacedle(genericTask.getreplacedignUserFullName());
ToggleTicketSummaryField toggleTicketSummaryField = new ToggleTicketSummaryField(genericTask);
rowComp.with(ELabel.html(img.write()).withUndefinedWidth(), toggleTicketSummaryField).expand(toggleTicketSummaryField);
return rowComp;
}
9
View Complete Implementation : AbstractTableHeader.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private void buildLayout() {
final HorizontalLayout replacedleFilterIconsLayout = createHeaderFilterIconLayout();
replacedleFilterIconsLayout.addComponents(headerCaption, searchField, searchResetIcon, showFilterButtonLayout);
replacedleFilterIconsLayout.setComponentAlignment(headerCaption, Alignment.TOP_LEFT);
replacedleFilterIconsLayout.setComponentAlignment(searchField, Alignment.TOP_RIGHT);
replacedleFilterIconsLayout.setComponentAlignment(searchResetIcon, Alignment.TOP_RIGHT);
replacedleFilterIconsLayout.setComponentAlignment(showFilterButtonLayout, Alignment.TOP_RIGHT);
if (hasCreatePermission() && isAddNewItemAllowed()) {
replacedleFilterIconsLayout.addComponent(addIcon);
replacedleFilterIconsLayout.setComponentAlignment(addIcon, Alignment.TOP_RIGHT);
}
if (hasCreatePermission() && isBulkUploadAllowed()) {
replacedleFilterIconsLayout.addComponent(bulkUploadIcon);
replacedleFilterIconsLayout.setComponentAlignment(bulkUploadIcon, Alignment.TOP_RIGHT);
}
replacedleFilterIconsLayout.addComponent(maxMinIcon);
replacedleFilterIconsLayout.setComponentAlignment(maxMinIcon, Alignment.TOP_RIGHT);
replacedleFilterIconsLayout.setExpandRatio(headerCaption, 0.4F);
replacedleFilterIconsLayout.setExpandRatio(searchField, 0.6F);
addComponent(replacedleFilterIconsLayout);
final HorizontalLayout dropHintDropFilterLayout = new HorizontalLayout();
dropHintDropFilterLayout.addStyleName("filter-drop-hint-layout");
dropHintDropFilterLayout.setWidth(100, Unit.PERCENTAGE);
if (isDropFilterRequired()) {
filterDroppedInfo = new HorizontalLayout();
filterDroppedInfo.setImmediate(true);
filterDroppedInfo.setStyleName("target-dist-filter-info");
filterDroppedInfo.setHeightUndefined();
filterDroppedInfo.setSizeUndefined();
displayFilterDropedInfoOnLoad();
final DragAndDropWrapper dropFilterLayout = new DragAndDropWrapper(filterDroppedInfo);
dropFilterLayout.setId(getDropFilterId());
dropFilterLayout.setDropHandler(getDropFilterHandler());
dropHintDropFilterLayout.addComponent(dropFilterLayout);
dropHintDropFilterLayout.setComponentAlignment(dropFilterLayout, Alignment.TOP_CENTER);
dropHintDropFilterLayout.setExpandRatio(dropFilterLayout, 1.0F);
}
addComponent(dropHintDropFilterLayout);
setComponentAlignment(dropHintDropFilterLayout, Alignment.TOP_CENTER);
addStyleName("bordered-layout");
addStyleName("no-border-bottom");
}
1
View Complete Implementation : JobView.java
Copyright Apache License 2.0
Author : opensecuritycontroller
Copyright Apache License 2.0
Author : opensecuritycontroller
@SuppressWarnings("serial")
private void buildGraph() {
try {
this.embeddedImage = new Embedded();
this.embeddedImage.setSizeFull();
refreshGraph();
Button refresh = new Button("Refresh");
refresh.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
try {
refreshGraph();
} catch (Exception e) {
ViewUtil.showError("Error while building task graph DOT file.", e);
}
}
});
final HorizontalLayout toolbarLayout = new HorizontalLayout();
toolbarLayout.addComponent(refresh);
toolbarLayout.setSizeFull();
toolbarLayout.setMargin(true);
final VerticalLayout imageLayout = new VerticalLayout();
imageLayout.addComponent(this.embeddedImage);
imageLayout.setComponentAlignment(this.embeddedImage, Alignment.MIDDLE_CENTER);
imageLayout.setSizeUndefined();
final VerticalLayout layout = new VerticalLayout();
layout.addComponent(refresh);
layout.setComponentAlignment(refresh, Alignment.TOP_LEFT);
layout.addComponent(imageLayout);
layout.setSizeUndefined();
final Window window = new Window();
window.setContent(layout);
window.setModal(true);
window.setHeight("80%");
window.setWidth("80%");
window.setClosable(true);
window.setResizable(true);
window.setCaption("Task Graph for Job " + getParenreplacedemId());
window.center();
window.setWindowMode(WindowMode.MAXIMIZED);
window.addCloseShortcut(ShortcutAction.KeyCode.ESCAPE, null);
ViewUtil.addWindow(window);
window.focus();
} catch (Exception e) {
ViewUtil.showError("Error while building task graph DOT file.", e);
}
}
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);
}