com.vaadin.shared.ui.MarginInfo Java Examples

The following examples show how to use com.vaadin.shared.ui.MarginInfo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StandupListViewImpl.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
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;
}
 
Example #2
Source File: SubTicketsComp.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
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;
}
 
Example #3
Source File: VersionReadViewImpl.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #4
Source File: RoleReadViewImpl.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
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);
    }
}
 
Example #5
Source File: GroupPageAddWindow.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@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;
}
 
Example #6
Source File: ComponentReadViewImpl.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #7
Source File: BugReadViewImpl.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #8
Source File: MilestoneReadViewImpl.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #9
Source File: CubaTokenList.java    From cuba with Apache License 2.0 6 votes vote down vote up
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);
}
 
Example #10
Source File: TaskReadViewImpl.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #11
Source File: ProjectActivityStreamPagedList.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
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);
}
 
Example #12
Source File: ProjectAddWindow.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
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);
}
 
Example #13
Source File: EditableTicketRowRenderer.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
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);
}
 
Example #14
Source File: RoleListViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
public RoleListViewImpl() {
    this.setMargin(new MarginInfo(false, true, false, true));

    searchPanel = new RoleSearchPanel();
    listLayout = new MVerticalLayout().withSpacing(false).withMargin(false);
    this.with(searchPanel, listLayout);
    this.generateDisplayTable();
}
 
Example #15
Source File: VersionListViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
public VersionListViewImpl() {
    this.setMargin(new MarginInfo(false, true, false, true));
    this.versionSearchPanel = new VersionSearchPanel();
    this.versionListLayout = new MVerticalLayout().withSpacing(false).withMargin(false);
    this.with(versionSearchPanel, versionListLayout);
    this.generateDisplayTable();
}
 
Example #16
Source File: ProjectRoleListViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
public ProjectRoleListViewImpl() {
    this.setMargin(new MarginInfo(false, true, true, true));
    searchPanel = new ProjectRoleSearchPanel();

    listLayout = new MVerticalLayout().withMargin(false).withSpacing(false);
    with(searchPanel, listLayout).expand(listLayout);

    this.generateDisplayTable();
}
 
Example #17
Source File: BuildCriterionComponent.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
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));
}
 
Example #18
Source File: SubTicketsComp.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@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;
}
 
Example #19
Source File: FileDashboardViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void displayProjectFiles() {
    this.withMargin(new MarginInfo(false, true, false, true)).withFullWidth();
    int projectId = CurrentProjectVariables.getProjectId();
    String rootPath = String.format("%d/project/%d", AppUI.getAccountId(), projectId);
    addComponent(new ResourcesDisplayComponent(new Folder(rootPath)));
}
 
Example #20
Source File: ReOpenWindow.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
public ReOpenWindow(final SimpleBug bugValue) {
    super(UserUIContext.getMessage(BugI18nEnum.OPT_REOPEN_BUG, bugValue.getName()));
    this.bug = BeanUtility.deepClone(bugValue);

    MVerticalLayout contentLayout = new MVerticalLayout().withSpacing(false).withMargin(new MarginInfo(false, false, true, false));
    EditForm editForm = new EditForm();
    editForm.setBean(bug);
    contentLayout.addComponent(editForm);

    withWidth("600px").withModal(true).withResizable(false).withContent(contentLayout).withCenter();
}
 
Example #21
Source File: PageListViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
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);
}
 
Example #22
Source File: UserReadViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
public UserReadViewImpl() {
    this.setMargin(new MarginInfo(false, true, true, true));
    header = new MHorizontalLayout().withMargin(new MarginInfo(true, false, false, false)).withFullWidth();
    addComponent(header);
    previewForm = new PreviewForm();
    addComponent(previewForm);
}
 
Example #23
Source File: BugReadViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private void displayPlanningInfo(SimpleBug bug) {
    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, 3);
    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(bug.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(bug.getEnddate()));
    layout.addComponent(endDateVal, 1, 1);

    ELabel dueDateLbl = new ELabel(UserUIContext.getMessage(GenericI18Enum.FORM_DUE_DATE)).withStyleName(WebThemes.META_COLOR).withUndefinedWidth();
    layout.addComponent(dueDateLbl, 0, 2);

    ELabel dueDateVal = new ELabel(UserUIContext.formatDate(bug.getDuedate()));
    layout.addComponent(dueDateVal, 1, 2);

    layout.setColumnExpandRatio(1, 1.0f);

    this.addComponent(layout);
}
 
Example #24
Source File: BugReadViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private void displayEntryPeople(SimpleBug bug) {
    this.removeAllComponents();
    this.withMargin(false);

    Label peopleInfoHeader = ELabel.html(VaadinIcons.USER.getHtml() + " " + UserUIContext.getMessage(ProjectCommonI18nEnum.SUB_INFO_PEOPLE));
    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 createdLbl = new ELabel(UserUIContext.getMessage(ProjectCommonI18nEnum.ITEM_CREATED_PEOPLE)).withStyleName(WebThemes.META_COLOR).withUndefinedWidth();
    layout.addComponent(createdLbl, 0, 0);

    String createdUserName = bug.getCreateduser();
    String createdUserAvatarId = bug.getLoguserAvatarId();
    String createdUserDisplayName = bug.getLoguserFullName();

    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 = bug.getAssignuser();
    String assignUserAvatarId = bug.getAssignUserAvatarId();
    String assignUserDisplayName = bug.getAssignuserFullName();

    ProjectMemberLink assignUserLink = new ProjectMemberLink(assignUserName, assignUserAvatarId, assignUserDisplayName);
    layout.addComponent(assignUserLink, 1, 1);

    this.addComponent(layout);
}
 
Example #25
Source File: StandupReportFormLayoutFactory.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public AbstractComponent getLayout() {
    AddViewLayout reportAddLayout = new AddViewLayout(title, ProjectAssetsManager.getAsset(ProjectTypeConstants.STANDUP));
    reportAddLayout.addHeaderRight(this.createTopPanel());

    MHorizontalLayout mainLayout = new MHorizontalLayout().withFullWidth();
    final MVerticalLayout layoutField = new MVerticalLayout().withMargin(new MarginInfo(false, false, true,
            false)).withFullWidth();

    final ELabel whatYesterdayLbl = ELabel.h3(UserUIContext.getMessage(StandupI18nEnum.STANDUP_LASTDAY));
    layoutField.addComponent(whatYesterdayLbl);
    whatYesterdayField = new StandupCustomField();
    layoutField.addComponent(whatYesterdayField);

    final ELabel whatTodayLbl = ELabel.h3(UserUIContext.getMessage(StandupI18nEnum.STANDUP_TODAY));
    layoutField.with(whatTodayLbl);
    whatTodayField = new StandupCustomField();
    layoutField.addComponent(whatTodayField);

    final ELabel roadblockLbl = ELabel.h3(UserUIContext.getMessage(StandupI18nEnum.STANDUP_ISSUE)).withStyleName(WebThemes.LABEL_WORD_WRAP);
    layoutField.with(roadblockLbl);
    whatProblemField = new StandupCustomField();
    layoutField.addComponent(whatProblemField);

    mainLayout.addComponent(layoutField);
    mainLayout.setExpandRatio(layoutField, 2.0f);

    MVerticalLayout instructionLayout = new MVerticalLayout(ELabel.html(UserUIContext.getMessage(StandupI18nEnum.HINT1_MSG)).withFullWidth(),
            ELabel.html(UserUIContext.getMessage(StandupI18nEnum.HINT2_MG)).withFullWidth()).withStyleName("instruction-box").withWidth("300px");

    mainLayout.addComponent(instructionLayout);
    mainLayout.setExpandRatio(instructionLayout, 1.0f);
    mainLayout.setComponentAlignment(instructionLayout, Alignment.TOP_CENTER);

    reportAddLayout.addBody(mainLayout);
    return reportAddLayout;
}
 
Example #26
Source File: MilestoneReadViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
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);
}
 
Example #27
Source File: AddViewLayout.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
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");
}
 
Example #28
Source File: DynamicQueryParamLayout.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
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));
}
 
Example #29
Source File: BuildCriterionComponent.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
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("&nbsp;").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);
}
 
Example #30
Source File: TaskReadViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
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);
}