org.vaadin.viritin.layouts.MHorizontalLayout Java Examples

The following examples show how to use org.vaadin.viritin.layouts.MHorizontalLayout. 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: 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 #2
Source File: ComponentSearchPanel.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public ComponentContainer constructBody() {
    MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true);
    basicSearchBody.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    Label nameLbl = new Label(UserUIContext.getMessage(GenericI18Enum.FORM_NAME) + ":");
    basicSearchBody.with(nameLbl);

    nameField = new MTextField().withPlaceholder(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
            .withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
    basicSearchBody.with(nameField);

    myItemCheckbox = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS));
    basicSearchBody.with(myItemCheckbox);

    MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction())
            .withIcon(VaadinIcons.SEARCH).withStyleName(WebThemes.BUTTON_ACTION)
            .withClickShortcut(ShortcutAction.KeyCode.ENTER);
    basicSearchBody.with(searchBtn);

    MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR), clickEvent -> nameField.setValue(""))
            .withStyleName(WebThemes.BUTTON_OPTION);
    basicSearchBody.with(cancelBtn);

    return basicSearchBody;
}
 
Example #3
Source File: PhoneBookEntryForm.java    From jpa-addressbook with The Unlicense 6 votes vote down vote up
@Override
protected Component createContent() {
    return new MVerticalLayout(
            getToolbar(),
            new MHorizontalLayout(
                    new MFormLayout(
                            name,
                            number,
                            email,
                            birthDate,
                            sendChristmasCard
                    ).withMargin(false),
                    groupsGrid
            ),
            addresses
    ).withMargin(new MMarginInfo(false, true));
}
 
Example #4
Source File: DefaultGenericSearchPanel.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
MHorizontalLayout getHeader() {
    if (headerLayout == null) {
        headerLayout = new MHorizontalLayout().withFullWidth().withMargin(new MarginInfo(true, false, true, false));
        headerRightComp = new MHorizontalLayout();
        headerTitleComp = buildSearchTitle();
        if (headerTitleComp != null) {
            headerLayout.with(headerTitleComp, headerRightComp).expand(headerRightComp);
        }

        Component extraControls = buildExtraControls();
        if (extraControls != null) {
            addHeaderRight(extraControls);
        }
    }
    return headerLayout;
}
 
Example #5
Source File: AboutWindow.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
public AboutWindow() {
    MHorizontalLayout content = new MHorizontalLayout().withMargin(true).withFullWidth();
    this.setContent(content);

    Image about = new Image("", new ExternalResource(StorageUtils.generateAssetRelativeLink(WebResourceIds._about)));

    MVerticalLayout rightPanel = new MVerticalLayout();
    ELabel versionLbl = ELabel.h2(String.format("MyCollab Community Edition %s", Version.getVersion())).withFullWidth();
    ELabel javaNameLbl = new ELabel(String.format("%s, %s", System.getProperty("java.vm.name"),
            System.getProperty("java.runtime.version"))).withFullWidth();
    Label homeFolderLbl = new Label("Home folder: " + AppContextUtil.getSpringBean(ServerConfiguration.class).getHomeDir().getAbsolutePath());
    WebBrowser browser = Page.getCurrent().getWebBrowser();
    ELabel osLbl = new ELabel(String.format("%s, %s", System.getProperty("os.name"), browser.getBrowserApplication())).withFullWidth();
    Div licenseDiv = new Div().appendChild(new Text("Powered by: "))
            .appendChild(new A("https://www.mycollab.com")
                    .appendText("MyCollab")).appendChild(new Text(". Open source under GPL license"));
    ELabel licenseLbl = ELabel.html(licenseDiv.write()).withFullWidth();
    Label copyRightLbl = ELabel.html(String.format("&copy; %s - %s MyCollab Ltd. All rights reserved", "2011",
            LocalDate.now().getYear() + "")).withFullWidth();
    rightPanel.with(versionLbl, javaNameLbl, osLbl, homeFolderLbl, licenseLbl, copyRightLbl).withAlign(copyRightLbl, Alignment.BOTTOM_LEFT);
    content.with(about, rightPanel).expand(rightPanel);
}
 
Example #6
Source File: SelectChildTicketWindow.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public Component generateRow(IBeanList<ProjectTicket> host, ProjectTicket item, int rowIndex) {
    MButton ticketLink = new MButton(item.getName(), clickEvent -> {
        if (item.getTypeId().equals(parentTicket.getTypeId())) {
            NotificationUtil.showErrorNotification(UserUIContext.getMessage(TaskI18nEnum.ERROR_CAN_NOT_ASSIGN_PARENT_TASK_TO_ITSELF));
        } else {
            TicketHierarchy ticketHierarchy = new TicketHierarchy();
            ticketHierarchy.setParentid(parentTicket.getTypeId());
            ticketHierarchy.setParenttype(parentTicket.getType());
            ticketHierarchy.setProjectid(CurrentProjectVariables.getProjectId());
            ticketHierarchy.setTicketid(item.getTypeId());
            ticketHierarchy.setTickettype(item.getType());
            TicketHierarchyMapper ticketHierarchyMapper = AppContextUtil.getSpringBean(TicketHierarchyMapper.class);
            ticketHierarchyMapper.insert(ticketHierarchy);
            EventBusFactory.getInstance().post(new TicketEvent.SubTicketAdded(this, item.getType(), item.getTypeId()));
        }

        close();
    }).withStyleName(WebThemes.BUTTON_LINK, WebThemes.TEXT_ELLIPSIS).withFullWidth();
    return new MHorizontalLayout(ELabel.fontIcon(ProjectAssetsManager.getAsset(item.getType())), ticketLink).expand(ticketLink).withStyleName("list-row").withFullWidth()
            .alignAll(Alignment.MIDDLE_LEFT);
}
 
Example #7
Source File: TicketSearchPanel.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
    protected ComponentContainer buildSearchTitle() {
        if (canSwitchToAdvanceLayout) {
            savedFilterComboBox = new TicketSavedFilterComboBox();
            savedFilterComboBox.addQuerySelectListener((SavedFilterComboBox.QuerySelectListener) querySelectEvent -> {
                List<SearchFieldInfo<ProjectTicketSearchCriteria>> fieldInfos = querySelectEvent.getSearchFieldInfos();
                ProjectTicketSearchCriteria criteria = SearchFieldInfo.buildSearchCriteria(ProjectTicketSearchCriteria.class,
                        fieldInfos);
                criteria.setProjectIds(new SetSearchField<>(CurrentProjectVariables.getProjectId()));
                EventBusFactory.getInstance().post(new TicketEvent.SearchRequest(TicketSearchPanel.this, criteria));
//                    EventBusFactory.getInstance().post(new ShellEvent.AddQueryParam(this, fieldInfos));
            });
            ELabel taskIcon = ELabel.h2(ProjectAssetsManager.getAsset(ProjectTypeConstants.TICKET).getHtml()).withUndefinedWidth();
            return new MHorizontalLayout(taskIcon, savedFilterComboBox).withUndefinedWidth();
        } else return null;
    }
 
Example #8
Source File: RoleSearchPanel.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public ComponentContainer constructBody() {
    MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true)
            .with(new Label(UserUIContext.getMessage(GenericI18Enum.FORM_NAME) + ":"));

    nameField = new MTextField().withPlaceholder(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
            .withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
    basicSearchBody.addComponent(nameField);

    MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction())
            .withIcon(VaadinIcons.SEARCH).withStyleName(WebThemes.BUTTON_ACTION)
            .withClickShortcut(ShortcutAction.KeyCode.ENTER);
    basicSearchBody.addComponent(searchBtn);

    MButton clearBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR), clickEvent -> nameField.setValue(""))
            .withStyleName(WebThemes.BUTTON_OPTION);
    basicSearchBody.addComponent(clearBtn);
    basicSearchBody.setComponentAlignment(clearBtn, Alignment.MIDDLE_LEFT);
    return basicSearchBody;
}
 
Example #9
Source File: VersionSearchPanel.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public ComponentContainer constructBody() {
    MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true);
    basicSearchBody.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);

    Label nameLbl = new Label("Name:");
    basicSearchBody.with(nameLbl);

    nameField = new MTextField().withPlaceholder(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
            .withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
    basicSearchBody.with(nameField);

    MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction())
            .withIcon(VaadinIcons.SEARCH).withStyleName(WebThemes.BUTTON_ACTION)
            .withClickShortcut(ShortcutAction.KeyCode.ENTER);
    basicSearchBody.with(searchBtn);

    MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR), clickEvent -> nameField.setValue(""))
            .withStyleName(WebThemes.BUTTON_OPTION);
    basicSearchBody.with(cancelBtn);

    return basicSearchBody;
}
 
Example #10
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 #11
Source File: ProjectViewImpl.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
AskToAddMoreMembersWindow() {
    super(UserUIContext.getMessage(GenericI18Enum.OPT_QUESTION));
    MVerticalLayout content = new MVerticalLayout();
    this.withWidth("600px").withResizable(false).withModal(true).withContent(content).withCenter();

    content.with(new Label(UserUIContext.getMessage(ProjectI18nEnum.OPT_ASK_TO_ADD_MEMBERS)));

    MButton skipBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.ACTION_SKIP), clickEvent -> {
        ProjectService projectService = AppContextUtil.getSpringBean(ProjectService.class);
        SimpleProject project = CurrentProjectVariables.getProject();
        project.setContextask(false);
        projectService.updateSelectiveWithSession(project, UserUIContext.getUsername());
        close();
    }).withStyleName(WebThemes.BUTTON_OPTION);

    MButton addNewMembersBtn = new MButton(UserUIContext.getMessage(ProjectI18nEnum.ACTION_ADD_MEMBERS), clickEvent -> {
        close();
        EventBusFactory.getInstance().post(new ProjectMemberEvent.GotoInviteMembers(this, null));
    }).withStyleName(WebThemes.BUTTON_ACTION);

    MHorizontalLayout btnControls = new MHorizontalLayout(skipBtn, addNewMembersBtn);
    content.with(btnControls).withAlign(btnControls, Alignment.MIDDLE_RIGHT);
}
 
Example #12
Source File: ProjectSearchPanel.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public ComponentContainer constructBody() {
    MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true);

    nameField = new MTextField().withPlaceholder(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
            .withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
    basicSearchBody.with(nameField).withAlign(nameField, Alignment.MIDDLE_CENTER);

    MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent ->
            callSearchAction()).withIcon(VaadinIcons.SEARCH).withStyleName(WebThemes.BUTTON_ACTION)
            .withClickShortcut(ShortcutAction.KeyCode.ENTER);
    basicSearchBody.with(searchBtn).withAlign(searchBtn, Alignment.MIDDLE_LEFT);

    MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR),
            clickEvent -> nameField.setValue("")).withStyleName(WebThemes.BUTTON_OPTION);
    basicSearchBody.with(cancelBtn).withAlign(cancelBtn, Alignment.MIDDLE_CENTER);

    MButton advancedSearchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_ADVANCED_SEARCH),
            clickEvent -> moveToAdvancedSearchLayout()).withStyleName(WebThemes.BUTTON_LINK);
    basicSearchBody.with(advancedSearchBtn).withAlign(advancedSearchBtn, Alignment.MIDDLE_CENTER);

    return basicSearchBody;
}
 
Example #13
Source File: ProfileReadViewImpl.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public AbstractComponent getLayout() {
    FormContainer layout = new FormContainer();
    layout.addComponent(avatarAndPass);

    MButton btnChangeContactInfo = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_EDIT),
            clickEvent -> UI.getCurrent().addWindow(new ContactInfoChangeWindow(formItem.getBean())))
            .withStyleName(WebThemes.BUTTON_LINK);

    MHorizontalLayout contactInformationHeader = new MHorizontalLayout(new ELabel(UserUIContext.getMessage(UserI18nEnum.SECTION_CONTACT_INFORMATION))
            .withStyleName(ValoTheme.LABEL_H3, ValoTheme.LABEL_NO_MARGIN), btnChangeContactInfo).alignAll(Alignment.MIDDLE_LEFT);

    layout.addSection(new CssLayout(contactInformationHeader), contactLayout.getLayout());

    MButton btnChangeAdvanceInfo = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_EDIT),
            clickEvent -> UI.getCurrent().addWindow(new AdvancedInfoChangeWindow(formItem.getBean())))
            .withStyleName(WebThemes.BUTTON_LINK);

    MHorizontalLayout advanceInfoHeader = new MHorizontalLayout(new ELabel(UserUIContext.getMessage(UserI18nEnum.SECTION_ADVANCED_INFORMATION))
            .withStyleName(ValoTheme.LABEL_H3, ValoTheme.LABEL_NO_MARGIN), btnChangeAdvanceInfo).alignAll(Alignment.MIDDLE_LEFT);

    layout.addSection(new CssLayout(advanceInfoHeader), advancedInfoLayout.getLayout());
    return layout;
}
 
Example #14
Source File: GetStartedInstructionWindow.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
private void displayInfo(SimpleUser user) {
    Div infoDiv = new Div().appendText("You have not setup SMTP account properly. So we can not send the invitation by email automatically. Please copy/paste below paragraph and inform to the user by yourself").setStyle("font-weight:bold;color:red");
    Label infoLbl = new Label(infoDiv.write(), ContentMode.HTML);

    Div userInfoDiv = new Div().appendText("Your username is ").appendChild(new B().appendText(user.getEmail()));
    Label userInfoLbl = ELabel.html(userInfoDiv.write());

    if (Boolean.TRUE.equals(user.isAccountOwner())) {
        user.setRoleName(UserUIContext.getMessage(RoleI18nEnum.OPT_ACCOUNT_OWNER));
    }
    Div roleInfoDiv = new Div().appendText("Your role is ").appendChild(new B().appendText(user.getRoleName()));
    Label roleInfoLbl = new Label(roleInfoDiv.write(), ContentMode.HTML);
    contentLayout.with(infoLbl, userInfoLbl, roleInfoLbl);

    final Button addNewBtn = new Button("Create another user", clickEvent -> {
        EventBusFactory.getInstance().post(new UserEvent.GotoAdd(GetStartedInstructionWindow.this, null));
        close();
    });
    addNewBtn.setStyleName(WebThemes.BUTTON_ACTION);

    Button doneBtn = new Button(UserUIContext.getMessage(GenericI18Enum.ACTION_DONE), clickEvent -> close());
    doneBtn.setStyleName(WebThemes.BUTTON_ACTION);

    final MHorizontalLayout controlsBtn = new MHorizontalLayout(addNewBtn, doneBtn).withMargin(true);
    contentLayout.with(controlsBtn).withAlign(controlsBtn, Alignment.MIDDLE_RIGHT);
}
 
Example #15
Source File: SavedFilterComboBox.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
protected Component initContent() {
    componentsText = new TextField();
    componentsText.setReadOnly(true);
    componentsText.addStyleName("noBorderRight");
    componentsText.setWidth("100%");
    componentPopupSelection = new PopupButton();
    componentPopupSelection.addStyleName(WebThemes.MULTI_SELECT_BG);
    componentPopupSelection.setDirection(Alignment.BOTTOM_LEFT);
    componentPopupSelection.addClickListener(clickEvent -> initContentPopup());

    popupContent = new OptionPopupContent();
    componentPopupSelection.setContent(popupContent);

    MHorizontalLayout content = new MHorizontalLayout(componentsText).withAlign(componentsText, Alignment.MIDDLE_LEFT);

    MHorizontalLayout multiSelectComp = new MHorizontalLayout(componentsText, componentPopupSelection)
            .withSpacing(false).expand(componentsText);
    content.with(multiSelectComp);
    return content;
}
 
Example #16
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 #17
Source File: StandupAddWindow.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
StandupAddWindow(StandupReportStatistic standupReportStatistic, LocalDate onDate) {
    this.withModal(true).withClosable(true).withResizable(false).withCenter().withWidth(UIUtils.INSTANCE.getBrowserWidth() + "px")
            .withHeight(UIUtils.INSTANCE.getBrowserHeight() + "px");

    this.onDate = onDate;
    standupReportService = AppContextUtil.getSpringBean(StandupReportService.class);
    SimpleStandupReport report = standupReportService.findStandupReportByDateUser(standupReportStatistic.getProjectId(),
            UserUIContext.getUsername(), onDate, AppUI.getAccountId());
    if (report == null) {
        report = new SimpleStandupReport();
        report.setProjectid(standupReportStatistic.getProjectId());
        report.setSaccountid(AppUI.getAccountId());
        report.setForday(onDate);
        report.setLogby(UserUIContext.getUsername());
    }

    editForm = new AdvancedEditBeanForm<>();
    editForm.setFormLayoutFactory(new FormLayoutFactory());
    editForm.setBeanFormFieldFactory(new EditFormFieldFactory(editForm));
    editForm.setBean(report);
    Component projectLogo = ProjectAssetsUtil.projectLogoComp(standupReportStatistic.getProjectKey(), standupReportStatistic.getProjectId(),
            standupReportStatistic.getProjectAvatarId(), 32);
    ELabel projectLbl = ELabel.h2(standupReportStatistic.getProjectName()).withStyleName(WebThemes.TEXT_ELLIPSIS);
    setContent(new MVerticalLayout(new MHorizontalLayout(projectLogo, projectLbl).expand(projectLbl), editForm));
    editForm.addFormHandler(this);
}
 
Example #18
Source File: UploadField.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected Component initContent() {
    rootLayout = new VerticalLayout(progress,
            new MHorizontalLayout(display, upload, clearBtn)
                    .alignAll(Alignment.MIDDLE_LEFT)
    );
    return rootLayout;
}
 
Example #19
Source File: ProjectPagedList.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected MHorizontalLayout createPageControls() {
    MHorizontalLayout pageControls = super.createPageControls();
    if (pageControls != null) {
        Button browseProjectsBtn = new Button(UserUIContext.getMessage(ProjectI18nEnum.ACTION_BROWSE),
                clickEvent -> EventBusFactory.getInstance().post(new ProjectEvent.GotoList(this, null)));
        browseProjectsBtn.addStyleName(WebThemes.BUTTON_LINK);
        pageControls.addComponent(browseProjectsBtn, 0);
        pageControls.setComponentAlignment(browseProjectsBtn, Alignment.MIDDLE_LEFT);
    }
    return pageControls;
}
 
Example #20
Source File: ProjectListViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private ComponentContainer constructTableActionControls() {
    MHorizontalLayout layout = new MHorizontalLayout().withFullWidth().withStyleName(WebThemes.TABLE_ACTION_CONTROLS);

    selectOptionButton = new SelectionOptionButton(tableItem);
    selectOptionButton.setWidthUndefined();
    layout.addComponent(selectOptionButton);

    tableActionControls = new DefaultMassItemActionHandlerContainer();

    tableActionControls.addDownloadPdfActionItem();
    tableActionControls.addDownloadExcelActionItem();
    tableActionControls.addDownloadCsvActionItem();

    tableActionControls.setVisible(false);
    tableActionControls.setWidthUndefined();

    layout.addComponent(tableActionControls);
    selectedItemsNumberLabel.setWidth("100%");
    layout.with(selectedItemsNumberLabel).withAlign(selectedItemsNumberLabel, Alignment.MIDDLE_CENTER).expand(selectedItemsNumberLabel);

    MButton customizeViewBtn = new MButton("", clickEvent -> UI.getCurrent().addWindow(new ProjectListCustomizeWindow(tableItem)))
            .withStyleName(WebThemes.BUTTON_ACTION).withIcon(VaadinIcons.ADJUST);
    customizeViewBtn.setDescription(UserUIContext.getMessage(GenericI18Enum.OPT_LAYOUT_OPTIONS));
    layout.with(customizeViewBtn).withAlign(customizeViewBtn, Alignment.MIDDLE_RIGHT);

    return layout;
}
 
Example #21
Source File: PageListNoItemView.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
protected MHorizontalLayout createControlButtons() {
    if (hasPermission()) {
        MButton createPageBtn = new MButton(actionMessage(), actionListener()).withStyleName(WebThemes.BUTTON_ACTION);

        MButton createPageGroupBtn = new MButton(UserUIContext.getMessage(PageI18nEnum.NEW_GROUP), clickEvent -> UI.getCurrent().addWindow(new GroupPageAddWindow())).withStyleName(WebThemes.BUTTON_ACTION);

        return new MHorizontalLayout(createPageBtn, new Label(" or "), createPageGroupBtn)
                .alignAll(Alignment.MIDDLE_CENTER);
    } else {
        return new MHorizontalLayout();
    }
}
 
Example #22
Source File: MilestoneListViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private Component buildHeader() {
    HeaderWithIcon headerText = ComponentUtils.headerH2(ProjectTypeConstants.MILESTONE,
            UserUIContext.getMessage(MilestoneI18nEnum.LIST));

    return new MHorizontalLayout(headerText, createHeaderRight()).withMargin(true)
            .withAlign(headerText, Alignment.MIDDLE_LEFT).expand(headerText);
}
 
Example #23
Source File: AbstractMainView.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void addModule(IModule module) {
    if (module != attachedModule) {
        attachedModule = module;
        headerLayout.removeComponent("serviceMenu");
        ModuleHelper.setCurrentModule(module);
        bodyLayout.removeAllComponents();
        bodyLayout.addComponent(module);

        MHorizontalLayout serviceMenu = module.buildMenu();
        if (serviceMenu != null) {
            headerLayout.addComponent(serviceMenu, "serviceMenu");
        }
    }
}
 
Example #24
Source File: PreviewFormControlsGenerator.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
public PreviewFormControlsGenerator(AdvancedPreviewBeanForm<T> editForm) {
    this.previewForm = editForm;
    layout = new MHorizontalLayout();
    layout.setSizeUndefined();
    popupButtonsControl = new OptionPopupContent();
    editButtons = new MHorizontalLayout();
    editButtons.setDefaultComponentAlignment(Alignment.TOP_RIGHT);
}
 
Example #25
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 #26
Source File: Depot.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
public Depot(String title, ComponentContainer content) {
    this.setSpacing(false);
    this.setMargin(false);
    this.addStyleName("depot");
    header = new MHorizontalLayout().withStyleName("depot-header");
    bodyContent = content;
    bodyContent.setWidth("100%");
    headerContent = new MHorizontalLayout().withFullHeight().withUndefinedWidth().withVisible(false);
    this.addComponent(header);

    headerLbl = ELabel.h3("");
    setTitle(title);
    final MHorizontalLayout headerLeft = new MHorizontalLayout(headerLbl).withStyleName("depot-title")
            .withAlign(headerLbl, Alignment.MIDDLE_LEFT).withFullWidth();
    headerLeft.addLayoutClickListener(layoutClickEvent -> {
        isOpened = !isOpened;
        if (isOpened) {
            bodyContent.setVisible(true);
            header.removeStyleName(WebThemes.BORDER_BOTTOM);
        } else {
            bodyContent.setVisible(false);
            header.addStyleName(WebThemes.BORDER_BOTTOM);
        }
        setTitle(this.title);
    });
    header.with(headerLeft, headerContent).withAlign(headerLeft, Alignment.MIDDLE_LEFT).withAlign(headerContent,
            Alignment.MIDDLE_RIGHT).expand(headerLeft);

    bodyContent.addStyleName("depot-content");
    this.addComponent(bodyContent);
}
 
Example #27
Source File: VersionPreviewForm.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
TicketsComp(Version beanItem) {
    withMargin(false).withFullWidth().withStyleName(WebThemes.NO_SCROLLABLE_CONTAINER);

    CheckBox openSelection = new CheckBox(UserUIContext.getMessage(StatusI18nEnum.Open), true);
    openSelection.addValueChangeListener(valueChangeEvent -> {
        if (openSelection.getValue()) {
            searchCriteria.setOpen(new SearchField());
        } else {
            searchCriteria.setOpen(null);
        }
        updateSearchStatus();
    });

    CheckBox overdueSelection = new CheckBox(UserUIContext.getMessage(StatusI18nEnum.Overdue), false);
    overdueSelection.addValueChangeListener(valueChangeEvent -> {
        if (overdueSelection.getValue()) {
            searchCriteria.setDueDate(new DateSearchField(DateTimeUtils.getCurrentDateWithoutMS().toLocalDate(),
                    DateSearchField.LESS_THAN));
        } else {
            searchCriteria.setDueDate(null);
        }
        updateSearchStatus();
    });

    MHorizontalLayout header = new MHorizontalLayout(openSelection, overdueSelection);

    ticketList = new DefaultBeanPagedList<>(AppContextUtil.getSpringBean(ProjectTicketService.class), new TicketRowRenderer());

    searchCriteria = new ProjectTicketSearchCriteria();
    searchCriteria.setProjectIds(new SetSearchField<>(CurrentProjectVariables.getProjectId()));
    searchCriteria.setTypes(new SetSearchField<>(ProjectTypeConstants.BUG, ProjectTypeConstants.TASK));
    searchCriteria.setVersionIds(new SetSearchField<>(beanItem.getId()));
    searchCriteria.setOpen(new SearchField());
    updateSearchStatus();

    this.with(header, ticketList);
}
 
Example #28
Source File: AbstractBeanPagedList.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private Component msgWhenEmptyList() {
    String value = stringWhenEmptyList();
    if (StringUtils.isNotBlank(value)) {
        return new MHorizontalLayout().withStyleName(WebThemes.BORDER_BOTTOM, WebThemes.BORDER_LEFT, WebThemes.BORDER_RIGHT).withMargin(true).withFullWidth().with(new Label(value));
    } else {
        return null;
    }
}
 
Example #29
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 #30
Source File: MilestoneListViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private Component buildBody() {
    CustomLayout bodyContent = CustomLayoutExt.createLayout("milestoneView");

    MHorizontalLayout closedHeaderLayout = new MHorizontalLayout();

    closedHeader = ELabel.html("").withUndefinedWidth();
    closedHeaderLayout.with(closedHeader).withAlign(closedHeader, Alignment.MIDDLE_CENTER);

    bodyContent.addComponent(closedHeaderLayout, "closed-header");
    closeContainer = new MVerticalLayout().withStyleName("milestone-col").withFullWidth();
    bodyContent.addComponent(closeContainer, "closed-milestones");

    MHorizontalLayout inProgressHeaderLayout = new MHorizontalLayout();
    inProgressHeader = ELabel.html("").withUndefinedWidth();
    inProgressHeaderLayout.addComponent(inProgressHeader);
    inProgressHeaderLayout.setComponentAlignment(inProgressHeader, Alignment.MIDDLE_CENTER);

    bodyContent.addComponent(inProgressHeaderLayout, "in-progress-header");
    inProgressContainer = new MVerticalLayout().withStyleName("milestone-col").withFullWidth();
    bodyContent.addComponent(this.inProgressContainer, "in-progress-milestones");

    MHorizontalLayout futureHeaderLayout = new MHorizontalLayout();
    futureHeader = ELabel.html("").withUndefinedWidth();
    futureHeaderLayout.addComponent(futureHeader);
    futureHeaderLayout.setComponentAlignment(futureHeader, Alignment.MIDDLE_CENTER);

    bodyContent.addComponent(futureHeaderLayout, "future-header");
    futureContainer = new MVerticalLayout().withStyleName("milestone-col").withFullWidth();
    bodyContent.addComponent(this.futureContainer, "future-milestones");

    return bodyContent;
}