Java源码示例:com.vaadin.shared.ui.MarginInfo
示例1
public CubaTokenList(WebTokenList<T> owner) {
this.owner = owner;
composition = new CssLayout();
composition.setWidthUndefined();
composition.setStyleName(TOKENLIST_COMPOSITION_STYLENAME);
tokenContainerWrapper = new CssLayout();
tokenContainerWrapper.setStyleName(TOKENLIST_WRAPPER_STYLENAME);
tokenContainer = new CubaScrollBoxLayout();
tokenContainer.setStyleName(TOKENLIST_SCROLLBOX_STYLENAME);
tokenContainer.setWidthUndefined();
tokenContainer.setMargin(new MarginInfo(true, false, false, false));
tokenContainerWrapper.addComponent(tokenContainer);
composition.addComponent(tokenContainerWrapper);
setPrimaryStyleName(TOKENLIST_STYLENAME);
// do not trigger overridden method
super.setWidth(-1, Unit.PIXELS);
}
示例2
public RoleReadViewImpl() {
this.setMargin(new MarginInfo(false, true, true, true));
MHorizontalLayout header = new MHorizontalLayout().withMargin(new MarginInfo(true, false, true, false)).withFullWidth();
header.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
ELabel headerText = ELabel.h2(VaadinIcons.USERS.getHtml() + " " + UserUIContext.getMessage(RoleI18nEnum.DETAIL));
header.with(headerText).expand(headerText);
this.addComponent(header);
this.previewForm = new AdvancedPreviewBeanForm<>();
this.addComponent(this.previewForm);
Layout controlButtons = createTopPanel();
if (controlButtons != null) {
header.addComponent(controlButtons);
}
}
示例3
private HorizontalLayout generateSubTicketContent(ProjectTicket subTicket) {
MHorizontalLayout layout = new MHorizontalLayout().withStyleName(WebThemes.HOVER_EFFECT_NOT_BOX).withMargin(new MarginInfo(false, false, false, true));
layout.setDefaultComponentAlignment(Alignment.TOP_LEFT);
layout.with(ELabel.fontIcon(ProjectAssetsManager.getAsset(subTicket.getType())));
Span priorityLink = new Span().appendText(ProjectAssetsManager.getPriorityHtml(subTicket.getPriority()))
.setTitle(subTicket.getPriority());
layout.with(ELabel.html(priorityLink.write()).withUndefinedWidth());
String taskStatus = UserUIContext.getMessage(StatusI18nEnum.class, subTicket.getStatus());
ELabel statusLbl = new ELabel(taskStatus).withStyleName(WebThemes.FIELD_NOTE).withUndefinedWidth();
layout.with(statusLbl);
String avatarLink = StorageUtils.getAvatarPath(subTicket.getAssignUserAvatarId(), 16);
Img avatarImg = new Img(subTicket.getAssignUserFullName(), avatarLink).setCSSClass(WebThemes.CIRCLE_BOX)
.setTitle(subTicket.getAssignUserFullName());
layout.with(ELabel.html(avatarImg.write()).withUndefinedWidth());
ToggleTicketSummaryWithParentRelationshipField toggleTaskSummaryField = new ToggleTicketSummaryWithParentRelationshipField(parentTicket, subTicket);
layout.with(toggleTaskSummaryField).expand(toggleTaskSummaryField);
return layout;
}
示例4
@Override
protected void initRelatedComponents() {
activityComponent = new ProjectActivityComponent(ProjectTypeConstants.MILESTONE, CurrentProjectVariables.getProjectId());
dateInfoComp = new DateInfoComp();
peopleInfoComp = new PeopleInfoComp();
planningInfoComp = new PlanningInfoComp();
ProjectView projectView = UIUtils.getRoot(this, ProjectView.class);
MVerticalLayout detailLayout = new MVerticalLayout().withMargin(new MarginInfo(false, true, true, true));
if (SiteConfiguration.isCommunityEdition()) {
detailLayout.with(peopleInfoComp, planningInfoComp, dateInfoComp);
} else {
milestoneTimeLogComp = new MilestoneTimeLogComp();
detailLayout.with(peopleInfoComp, planningInfoComp, milestoneTimeLogComp, dateInfoComp);
}
Panel detailPanel = new Panel(UserUIContext.getMessage(GenericI18Enum.OPT_DETAILS), detailLayout);
UIUtils.makeStackPanel(detailPanel);
projectView.addComponentToRightBar(detailPanel);
}
示例5
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);
}
示例6
@Override
protected void initRelatedComponents() {
activityComponent = new ProjectActivityComponent(ProjectTypeConstants.TASK, CurrentProjectVariables.getProjectId());
dateInfoComp = new DateInfoComp();
peopleInfoComp = new PeopleInfoComp();
followerSheet = new ProjectFollowersComp<>(ProjectTypeConstants.TASK, ProjectRolePermissionCollections.TASKS);
planningInfoComp = new PlanningInfoComp();
ProjectView projectView = UIUtils.getRoot(this, ProjectView.class);
MVerticalLayout detailLayout = new MVerticalLayout().withMargin(new MarginInfo(false, true, true, true));
if (SiteConfiguration.isCommunityEdition()) {
detailLayout.with(peopleInfoComp, planningInfoComp, followerSheet, dateInfoComp);
} else {
timeLogComp = ViewManager.getCacheComponent(TaskTimeLogSheet.class);
detailLayout.with(peopleInfoComp, planningInfoComp, timeLogComp, followerSheet, dateInfoComp);
}
Panel detailPanel = new Panel(UserUIContext.getMessage(GenericI18Enum.OPT_DETAILS), detailLayout);
UIUtils.makeStackPanel(detailPanel);
projectView.addComponentToRightBar(detailPanel);
}
示例7
private MHorizontalLayout constructHeader() {
MHorizontalLayout header = new MHorizontalLayout().withSpacing(false).withMargin((new MarginInfo(true, false, true, false))).withFullWidth();
header.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
MHorizontalLayout headerLeft = new MHorizontalLayout();
HeaderWithIcon titleLbl = ComponentUtils.headerH2(ProjectTypeConstants.STANDUP,
UserUIContext.getMessage(StandupI18nEnum.VIEW_LIST_TITLE));
headerLeft.with(titleLbl, standupCalendar);
header.with(headerLeft).withAlign(headerLeft, Alignment.TOP_LEFT);
MButton newReportBtn = new MButton(UserUIContext.getMessage(StandupI18nEnum.BUTTON_ADD_REPORT_LABEL), clickEvent -> {
if (selectedProject != null) {
UI.getCurrent().addWindow(new StandupAddWindow(selectedProject, onDate));
} else {
NotificationUtil.showErrorNotification("You do not select any project");
}
}).withIcon(VaadinIcons.PLUS).withStyleName(WebThemes.BUTTON_ACTION);
header.with(newReportBtn).withAlign(newReportBtn, Alignment.TOP_RIGHT);
return header;
}
示例8
@Override
protected void initRelatedComponents() {
activityComponent = new ProjectActivityComponent(ProjectTypeConstants.BUG, CurrentProjectVariables.getProjectId());
dateInfoComp = new DateInfoComp();
peopleInfoComp = new PeopleInfoComp();
planningInfoComp = new PlanningInfoComp();
bugFollowersList = new ProjectFollowersComp<>(ProjectTypeConstants.BUG, ProjectRolePermissionCollections.BUGS);
ProjectView projectView = UIUtils.getRoot(this, ProjectView.class);
MVerticalLayout detailLayout = new MVerticalLayout().withMargin(new MarginInfo(false, true, true, true));
if (SiteConfiguration.isCommunityEdition()) {
detailLayout.with(peopleInfoComp, planningInfoComp, bugFollowersList, dateInfoComp);
} else {
bugTimeLogList = ViewManager.getCacheComponent(BugTimeLogSheet.class);
detailLayout.with(peopleInfoComp, planningInfoComp, bugTimeLogList, bugFollowersList, dateInfoComp);
}
Panel detailPanel = new Panel(UserUIContext.getMessage(GenericI18Enum.OPT_DETAILS), detailLayout);
UIUtils.makeStackPanel(detailPanel);
projectView.addComponentToRightBar(detailPanel);
}
示例9
@Override
protected void initRelatedComponents() {
activityComponent = new ProjectActivityComponent(ProjectTypeConstants.COMPONENT, CurrentProjectVariables.getProjectId());
dateInfoComp = new DateInfoComp();
peopleInfoComp = new PeopleInfoComp();
ProjectView projectView = UIUtils.getRoot(this, ProjectView.class);
MVerticalLayout detailLayout = new MVerticalLayout().withMargin(new MarginInfo(false, true, true, true));
if (SiteConfiguration.isCommunityEdition()) {
detailLayout.with(dateInfoComp, peopleInfoComp);
} else {
componentTimeLogComp = new ComponentTimeLogComp();
detailLayout.with(dateInfoComp, peopleInfoComp, componentTimeLogComp);
}
Panel detailPanel = new Panel(UserUIContext.getMessage(GenericI18Enum.OPT_DETAILS), detailLayout);
UIUtils.makeStackPanel(detailPanel);
projectView.addComponentToRightBar(detailPanel);
}
示例10
@Override
public AbstractComponent getLayout() {
final MVerticalLayout layout = new MVerticalLayout().withMargin(false);
informationLayout = GridFormLayoutHelper.defaultFormLayoutHelper(LayoutType.ONE_COLUMN);
layout.addComponent(informationLayout.getLayout());
final 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 -> {
if (EditForm.this.validateForm()) {
PageService pageService = AppContextUtil.getSpringBean(PageService.class);
pageService.createFolder(folder, UserUIContext.getUsername());
folder.setCreatedTime(new GregorianCalendar());
folder.setCreatedUser(UserUIContext.getUsername());
GroupPageAddWindow.this.close();
EventBusFactory.getInstance().post(new PageEvent.GotoList(GroupPageAddWindow.this, folder.getPath()));
}
}).withIcon(VaadinIcons.CLIPBOARD).withStyleName(WebThemes.BUTTON_ACTION)
.withClickShortcut(KeyCode.ENTER);
MHorizontalLayout controlsBtn = new MHorizontalLayout(cancelBtn, saveBtn).withMargin(new MarginInfo(true, false, true, false));
layout.with(controlsBtn).withAlign(controlsBtn, Alignment.MIDDLE_RIGHT);
return layout;
}
示例11
@Override
protected void initRelatedComponents() {
activityComponent = new ProjectActivityComponent(ProjectTypeConstants.VERSION,
CurrentProjectVariables.getProjectId());
ProjectView projectView = UIUtils.getRoot(this, ProjectView.class);
MVerticalLayout detailLayout = new MVerticalLayout().withMargin(new MarginInfo(false, true, true, true));
dateInfoComp = new DateInfoComp();
if (SiteConfiguration.isCommunityEdition()) {
detailLayout.with(dateInfoComp);
} else {
versionTimeLogComp = new VersionTimeLogComp();
detailLayout.with(dateInfoComp, versionTimeLogComp);
}
Panel detailPanel = new Panel(UserUIContext.getMessage(GenericI18Enum.OPT_DETAILS), detailLayout);
UIUtils.makeStackPanel(detailPanel);
projectView.addComponentToRightBar(detailPanel);
}
示例12
protected Component addFoldersLabel(AbstractLayout layout, Label label) {
HorizontalLayout l = new HorizontalLayout();
l.setMargin(new MarginInfo(false, true, false, true));
l.addComponent(label);
l.setWidth(100, Unit.PERCENTAGE);
layout.addComponent(l);
return l;
}
示例13
@Override
public com.haulmont.cuba.gui.components.MarginInfo getMargin() {
if (getContainer() instanceof Layout.MarginHandler) {
MarginInfo vMargin = ((Layout.MarginHandler) getContainer()).getMargin();
return new com.haulmont.cuba.gui.components.MarginInfo(vMargin.hasTop(), vMargin.hasRight(), vMargin.hasBottom(), vMargin.hasLeft());
}
return new com.haulmont.cuba.gui.components.MarginInfo(false);
}
示例14
@Override
public void setMargin(com.haulmont.cuba.gui.components.MarginInfo marginInfo) {
if (getContainer() instanceof Layout.MarginHandler) {
MarginInfo vMargin = new MarginInfo(marginInfo.hasTop(), marginInfo.hasRight(), marginInfo.hasBottom(),
marginInfo.hasLeft());
((Layout.MarginHandler) getContainer()).setMargin(vMargin);
}
}
示例15
public VerticalTabsheet() {
navigatorContainer = new MVerticalLayout().withStyleName("navigator-wrap").withSpacing(false)
.withMargin(new MarginInfo(true, false, true, false));
contentWrapper = new MCssLayout().withStyleName("container-wrap").withFullSize();
this.setCompositionRoot(new MCssLayout(navigatorContainer, contentWrapper).withFullWidth());
this.setStyleName(TABSHEET_STYLE);
}
示例16
public BuildCriterionComponent(SearchLayout<S> searchLayout, Param[] paramFields, String searchCategory) {
this.hostSearchLayout = searchLayout;
this.paramFields = paramFields;
this.searchCategory = searchCategory;
MHorizontalLayout headerBox = new MHorizontalLayout().withMargin(new MarginInfo(true, false, true, true));
headerBox.setDefaultComponentAlignment(Alignment.TOP_LEFT);
addComponent(headerBox);
Label filterLbl = new Label(UserUIContext.getMessage(GenericI18Enum.OPT_SAVED_FILTER));
headerBox.with(filterLbl).withAlign(filterLbl, Alignment.TOP_LEFT);
filterBox = new MHorizontalLayout();
headerBox.with(filterBox).withAlign(filterBox, Alignment.TOP_LEFT);
buildFilterBox(null);
searchContainer = new MVerticalLayout().withMargin(false);
searchContainer.setDefaultComponentAlignment(Alignment.TOP_LEFT);
MButton addCriteriaBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_ADD_CRITERIA), clickEvent -> {
CriteriaSelectionLayout newCriteriaBar = new CriteriaSelectionLayout(searchContainer.getComponentCount() + 1);
searchContainer.addComponent(newCriteriaBar);
}).withIcon(VaadinIcons.PLUS).withStyleName(WebThemes.BUTTON_ACTION);
this.with(searchContainer, new MHorizontalLayout(addCriteriaBtn).withMargin(true));
}
示例17
public ProfileReadViewImpl() {
this.setMargin(new MarginInfo(false, true, true, true));
this.avatarAndPass = new MHorizontalLayout().withMargin(new MarginInfo(true, true, true, false)).withFullWidth();
this.formItem = new PreviewForm();
this.formItem.setWidth("100%");
this.addComponent(this.formItem);
}
示例18
public void setOuterMargin(MarginInfo marginInfo) {
this.marginInfo = marginInfo;
if (marginInfo != null) {
setStyleName("c-outer-margin-top", marginInfo.hasTop());
setStyleName("c-outer-margin-right", marginInfo.hasRight());
setStyleName("c-outer-margin-bottom", marginInfo.hasBottom());
setStyleName("c-outer-margin-left", marginInfo.hasLeft());
}
}
示例19
public void displayEntryDateTime(ValuedBean bean) {
this.removeAllComponents();
this.withMargin(false);
Label dateInfoHeader = ELabel.html(VaadinIcons.CALENDAR.getHtml() + " " +
UserUIContext.getMessage(ProjectCommonI18nEnum.SUB_INFO_DATES)).withStyleName("info-hdr");
this.addComponent(dateInfoHeader);
GridLayout layout = new GridLayout(2, 2);
layout.setSpacing(true);
layout.setWidth("100%");
layout.setMargin(new MarginInfo(false, false, false, true));
layout.setColumnExpandRatio(1, 1.0f);
try {
LocalDateTime createdDate = (LocalDateTime) PropertyUtils.getProperty(bean, "createdtime");
layout.addComponent(new ELabel(UserUIContext.getMessage(ProjectCommonI18nEnum.ITEM_CREATED_DATE)).withStyleName(WebThemes.META_COLOR).withUndefinedWidth(), 0, 0);
layout.addComponent(new ELabel(UserUIContext.formatPrettyTime(createdDate)).withDescription(UserUIContext.formatDateTime(createdDate)), 1, 0);
LocalDateTime updatedDate = (LocalDateTime) PropertyUtils.getProperty(bean, "lastupdatedtime");
layout.addComponent(new ELabel(UserUIContext.getMessage(ProjectCommonI18nEnum.ITEM_UPDATED_DATE)).withStyleName(WebThemes.META_COLOR).withUndefinedWidth(), 0, 1);
layout.addComponent(new ELabel(UserUIContext.formatPrettyTime(updatedDate)).withDescription(UserUIContext.formatDateTime(updatedDate)), 1, 1);
this.addComponent(layout);
} catch (Exception e) {
LOG.error("Get date is failed {}", BeanUtility.printBeanObj(bean));
}
}
示例20
@Override
protected Component createSelectTab() {
VerticalLayout selLayout = new VerticalLayout();
selLayout.setSpacing(false);
selLayout.setMargin(new MarginInfo(false, false, true, false));
selLayout.addComponent(selPreview);
selLayout.addStyleName("seltab");
colorSelect = new CubaColorPickerSelect();
colorSelect.addValueChangeListener(this::colorChanged);
selLayout.addComponent(colorSelect);
return selLayout;
}
示例21
public CubaRowsCount() {
setStyleName("c-paging");
setMargin(new MarginInfo(false, false, false, true));
ComponentContainer contentLayout = createContentLayout();
addComponent(contentLayout);
setWidth(100, Unit.PERCENTAGE);
}
示例22
public ProjectAddWindow() {
super(new Project().withSaccountid(AppUI.getAccountId()));
MVerticalLayout contentLayout = new MVerticalLayout().withSpacing(false).withMargin(new MarginInfo(false, false, true, false));
setContent(contentLayout);
projectInfo = new ProjectGeneralInfoStep(project);
contentLayout.addComponent(projectInfo.getContent());
MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), clickEvent -> {
boolean isValid = projectInfo.commit();
if (isValid) {
ProjectService projectService = AppContextUtil.getSpringBean(ProjectService.class);
project.setSaccountid(AppUI.getAccountId());
projectService.saveWithSession(project, UserUIContext.getUsername());
EventBusFactory.getInstance().post(new ProjectEvent.GotoMyProject(this,
new PageActionChain(new ProjectScreenData.Goto(project.getId()))));
close();
}
}).withIcon(VaadinIcons.CLIPBOARD).withStyleName(WebThemes.BUTTON_ACTION).withClickShortcut(KeyCode.ENTER);
MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close())
.withStyleName(WebThemes.BUTTON_OPTION);
MHorizontalLayout buttonControls = new MHorizontalLayout(cancelBtn, saveBtn).withMargin(new MarginInfo(true,
false, false, false));
contentLayout.with(buttonControls).withAlign(buttonControls, Alignment.MIDDLE_RIGHT);
}
示例23
@Override
protected Component initContent() {
MHorizontalLayout contentLayout = new MHorizontalLayout().withFullWidth();
ticketsLayout = new VerticalRemoveInlineComponentMarker().withFullWidth().withMargin(new MarginInfo(false, true, true, false));
contentLayout.with(ticketsLayout).expand(ticketsLayout);
if (CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.TASKS)) {
MButton addNewTaskBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_ADD), clickEvent -> {
MWindow newTicketWindow = AppContextUtil.getSpringBean(TicketComponentFactory.class)
.createNewTicketWindow(null, parentTicket.getProjectId(), parentTicket.getMilestoneId(), true, null);
UI.getCurrent().addWindow(newTicketWindow);
}).withStyleName(WebThemes.BUTTON_ACTION).withIcon(VaadinIcons.PLUS);
SplitButton splitButton = new SplitButton(addNewTaskBtn);
splitButton.setWidthUndefined();
splitButton.addStyleName(WebThemes.BUTTON_ACTION);
OptionPopupContent popupButtonsControl = new OptionPopupContent();
Button selectBtn = new Button(UserUIContext.getMessage(GenericI18Enum.BUTTON_SELECT), clickEvent -> {
splitButton.setPopupVisible(false);
UI.getCurrent().addWindow(new SelectChildTicketWindow(parentTicket));
});
popupButtonsControl.addOption(selectBtn);
splitButton.setContent(popupButtonsControl);
contentLayout.addComponent(splitButton);
}
ProjectTicketService projectTicketService = AppContextUtil.getSpringBean(ProjectTicketService.class);
List<ProjectTicket> subTickets = projectTicketService.findSubTickets(ProjectTypeConstants.TASK, parentTicket.getTypeId());
if (CollectionUtils.isNotEmpty(subTickets)) {
for (ProjectTicket subTicket : subTickets) {
ticketsLayout.addComponent(generateSubTicketContent(subTicket));
}
}
return contentLayout;
}
示例24
public PageListViewImpl() {
withMargin(new MarginInfo(true));
headerLayout = new MHorizontalLayout().withFullWidth().withMargin(false);
this.addComponent(headerLayout);
initHeader();
pagesLayout = new MVerticalLayout().withMargin(false).withSpacing(false).withStyleName("pages-list-layout");
this.addComponent(pagesLayout);
}
示例25
public EditableTicketRowRenderer(ProjectTicket ticket) {
this.ticket = ticket;
withMargin(false).withFullWidth().addStyleName(WebThemes.BORDER_LIST_ROW);
if (ticket.isTask()) {
addStyleName("task");
} else if (ticket.isBug()) {
addStyleName("bug");
} else if (ticket.isRisk()) {
addStyleName("risk");
}
toggleTicketField = new ToggleTicketSummaryField(ticket);
MHorizontalLayout headerLayout = new MHorizontalLayout(ELabel.fontIcon(ProjectAssetsManager.getAsset(ticket.getType()))
.withUndefinedWidth(), toggleTicketField).expand(toggleTicketField).withFullWidth()
.withMargin(new MarginInfo(false, true, false, false));
TicketComponentFactory popupFieldFactory = AppContextUtil.getSpringBean(TicketComponentFactory.class);
AbstractComponent assigneeField = wrapListenerComponent(popupFieldFactory.createAssigneePopupField(ticket));
assigneeField.removeStyleName(WebThemes.BLOCK_POPUP_EDIT);
headerLayout.with(assigneeField, toggleTicketField).expand(toggleTicketField);
CssLayout footer = new CssLayout();
footer.addComponent(popupFieldFactory.createCommentsPopupField(ticket));
footer.addComponent(wrapListenerComponent(popupFieldFactory.createPriorityPopupField(ticket)));
footer.addComponent(popupFieldFactory.createFollowersPopupField(ticket));
footer.addComponent(wrapListenerComponent(popupFieldFactory.createStatusPopupField(ticket)));
footer.addComponent(wrapListenerComponent(popupFieldFactory.createStartDatePopupField(ticket)));
footer.addComponent(wrapListenerComponent(popupFieldFactory.createEndDatePopupField(ticket)));
footer.addComponent(wrapListenerComponent(popupFieldFactory.createDueDatePopupField(ticket)));
if (!SiteConfiguration.isCommunityEdition()) {
footer.addComponent(popupFieldFactory.createBillableHoursPopupField(ticket));
footer.addComponent(popupFieldFactory.createNonBillableHoursPopupField(ticket));
}
this.with(headerLayout, footer);
}
示例26
private void displayPlanningInfo(SimpleMilestone milestone) {
this.removeAllComponents();
this.withMargin(false);
Label peopleInfoHeader = ELabel.html(VaadinIcons.CALENDAR_CLOCK.getHtml() + " " + UserUIContext.getMessage(ProjectCommonI18nEnum.SUB_INFO_PLANNING));
peopleInfoHeader.setStyleName("info-hdr");
this.addComponent(peopleInfoHeader);
GridLayout layout = new GridLayout(2, 2);
layout.setSpacing(true);
layout.setWidth("100%");
layout.setMargin(new MarginInfo(false, false, false, true));
ELabel startDateLbl = new ELabel(UserUIContext.getMessage(GenericI18Enum.FORM_START_DATE)).withStyleName(WebThemes.META_COLOR)
.withUndefinedWidth();
layout.addComponent(startDateLbl, 0, 0);
ELabel startDateVal = new ELabel(UserUIContext.formatDate(milestone.getStartdate()));
layout.addComponent(startDateVal, 1, 0);
ELabel endDateLbl = new ELabel(UserUIContext.getMessage(GenericI18Enum.FORM_END_DATE)).withStyleName(WebThemes.META_COLOR).withUndefinedWidth();
layout.addComponent(endDateLbl, 0, 1);
ELabel endDateVal = new ELabel(UserUIContext.formatDate(milestone.getEnddate()));
layout.addComponent(endDateVal, 1, 1);
layout.setColumnExpandRatio(1, 1.0f);
this.addComponent(layout);
}
示例27
CriteriaSelectionLayout(int index) {
super(6, 1);
this.index = index;
this.setSpacing(true);
this.setMargin(new MarginInfo(false, true, false, true));
this.setDefaultComponentAlignment(Alignment.TOP_LEFT);
indexLbl = new Label(index + "");
indexLbl.setWidth("70px");
this.addComponent(indexLbl, 0, 0);
if (index == 1) {
this.addComponent(ELabel.html(" ").withWidth("80px"), 1, 0);
} else {
operatorSelectionBox = new StringValueComboBox(false, SearchField.AND, SearchField.OR);
operatorSelectionBox.setWidth("80px");
this.addComponent(operatorSelectionBox, 1, 0);
}
buildFieldSelectionBox();
valueBox = new MVerticalLayout().withMargin(false).withWidth("250px");
deleteBtn = new MButton("", event -> {
int compIndex = searchContainer.getComponentIndex(CriteriaSelectionLayout.this);
searchContainer.removeComponent(CriteriaSelectionLayout.this);
for (int i = compIndex; i < searchContainer.getComponentCount(); i++) {
CriteriaSelectionLayout searchCriteriaLayout = (CriteriaSelectionLayout) searchContainer.getComponent(i);
searchCriteriaLayout.updateIndex();
}
}).withIcon(VaadinIcons.TRASH).withStyleName(WebThemes.BUTTON_ICON_ONLY);
this.addComponent(fieldSelectionBox, 2, 0);
this.addComponent(compareSelectionBox, 3, 0);
this.addComponent(valueBox, 4, 0);
this.addComponent(deleteBtn, 5, 0);
}
示例28
void displayEntryPeople(SimpleTask task) {
this.removeAllComponents();
ELabel peopleInfoHeader = ELabel.html(VaadinIcons.USER.getHtml() + " " +
UserUIContext.getMessage(ProjectCommonI18nEnum.SUB_INFO_PEOPLE)).withStyleName("info-hdr");
this.addComponent(peopleInfoHeader);
GridLayout layout = new GridLayout(2, 2);
layout.setWidth("100%");
layout.setMargin(new MarginInfo(false, false, false, true));
ELabel createdLbl = new ELabel(UserUIContext.getMessage(ProjectCommonI18nEnum.ITEM_CREATED_PEOPLE)).withStyleName(WebThemes.META_COLOR).withUndefinedWidth();
layout.addComponent(createdLbl, 0, 0);
String createdUserName = task.getCreateduser();
String createdUserAvatarId = task.getLogByAvatarId();
String createdUserDisplayName = task.getLogByFullName();
ProjectMemberLink createdUserLink = new ProjectMemberLink(createdUserName,
createdUserAvatarId, createdUserDisplayName);
layout.addComponent(createdUserLink, 1, 0);
layout.setColumnExpandRatio(1, 1.0f);
ELabel assigneeLbl = new ELabel(UserUIContext.getMessage(ProjectCommonI18nEnum.ITEM_ASSIGN_PEOPLE)).withStyleName(WebThemes.META_COLOR)
.withUndefinedWidth();
layout.addComponent(assigneeLbl, 0, 1);
String assignUserName = task.getAssignuser();
String assignUserAvatarId = task.getAssignUserAvatarId();
String assignUserDisplayName = task.getAssignUserFullName();
ProjectMemberLink assignUserLink = new ProjectMemberLink(assignUserName, assignUserAvatarId, assignUserDisplayName);
layout.addComponent(assignUserLink, 1, 1);
this.addComponent(layout);
}
示例29
private HorizontalLayout createButtonControls() {
MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction())
.withStyleName(WebThemes.BUTTON_ACTION).withIcon(VaadinIcons.SEARCH);
MButton clearBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR), clickEvent -> clearFields())
.withStyleName(WebThemes.BUTTON_OPTION);
MButton basicSearchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_BASIC_SEARCH),
clickEvent -> searchPanel.moveToBasicSearchLayout())
.withStyleName(WebThemes.BUTTON_LINK);
return new MHorizontalLayout(searchBtn, clearBtn, basicSearchBtn).withMargin(new MarginInfo(false, true, false, true));
}
示例30
public AddViewLayout(String viewTitle, VaadinIcons viewIcon) {
super("addView");
this.viewIcon = viewIcon;
header = new MHorizontalLayout().withFullWidth().withMargin(new MarginInfo(true, false, true, false));
header.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
titleLbl = ELabel.h2("");
header.with(titleLbl).expand(titleLbl);
setHeader(viewTitle);
addComponent(header, "addViewHeader");
}