org.vaadin.viritin.layouts.MVerticalLayout Java Examples

The following examples show how to use org.vaadin.viritin.layouts.MVerticalLayout. 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: 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 #2
Source File: SelectChildTicketWindow.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
public SelectChildTicketWindow(ProjectTicket parentTicket) {
    super(UserUIContext.getMessage(TaskI18nEnum.ACTION_SELECT_TASK));
    this.withModal(true).withResizable(false).withWidth(WebThemes.WINDOW_FORM_WIDTH);
    this.parentTicket = parentTicket;

    ProjectTicketSearchCriteria baseSearchCriteria = new ProjectTicketSearchCriteria();
    baseSearchCriteria.setProjectIds(new SetSearchField<>(CurrentProjectVariables.getProjectId()));
    baseSearchCriteria.setHasParentTicket(new BooleanSearchField(false));

    ticketSearchPanel = new TicketSearchPanel();
    DefaultBeanPagedList<ProjectTicketService, ProjectTicketSearchCriteria, ProjectTicket> ticketList = new DefaultBeanPagedList<>(
            AppContextUtil.getSpringBean(ProjectTicketService.class), new TicketRowRenderer(), 10);
    ticketSearchPanel.addSearchHandler(criteria -> {
        baseSearchCriteria.setProjectIds(new SetSearchField<>(CurrentProjectVariables.getProjectId()));
        criteria.setHasParentTicket(new BooleanSearchField(false));
        ticketList.setSearchCriteria(criteria);
    });
    MVerticalLayout content = new MVerticalLayout(ticketSearchPanel, ticketList).withSpacing(false);
    ticketList.setSearchCriteria(baseSearchCriteria);
    setContent(content);
}
 
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: 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 #5
Source File: LoginWindow.java    From jpa-invoicer with The Unlicense 6 votes vote down vote up
@Override
public void attach() {
    super.attach();

    service = createService();
    String url = service.getAuthorizationUrl(null);
    
    gplusLoginButton = new Link("Login with Google", new ExternalResource(url));
    gplusLoginButton.addStyleName(ValoTheme.LINK_LARGE);

    VaadinSession.getCurrent().addRequestHandler(this);

    setContent(new MVerticalLayout(gplusLoginButton).alignAll(
            Alignment.MIDDLE_CENTER).withFullHeight());
    setModal(true);
    setWidth("300px");
    setHeight("200px");

}
 
Example #6
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 #7
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 #8
Source File: RoleAddViewImpl.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
protected Layout createBottomPanel() {
     MVerticalLayout permissionsPanel = new MVerticalLayout().withMargin(false);

    PermissionMap perMap;
    if (role instanceof SimpleRole) {
        perMap = ((SimpleRole) role).getPermissionMap();
    } else {
        perMap = new PermissionMap();
    }

    permissionsPanel.addComponent(constructGridLayout(UserUIContext.getMessage(RoleI18nEnum.SECTION_PROJECT_MANAGEMENT_TITLE),
            perMap, RolePermissionCollections.PROJECT_PERMISSION_ARR));

    permissionsPanel.addComponent(constructGridLayout(UserUIContext.getMessage(RoleI18nEnum.SECTION_ACCOUNT_MANAGEMENT_TITLE),
            perMap, RolePermissionCollections.ACCOUNT_PERMISSION_ARR));

    return permissionsPanel;
}
 
Example #9
Source File: GeneratedPropertyListContainerExample.java    From viritin with Apache License 2.0 6 votes vote down vote up
@Override
public Component getTestComponent() {

    GeneratedPropertyListContainer<Person> container = new
            GeneratedPropertyListContainer(Person.class,
            "id", "fullname", "groupnumber", "details");
    container.addGeneratedProperty("fullname", p -> p.getFirstName() + " " + p.getLastName());
    container.addGeneratedProperty("groupnumber", Integer.class, p -> p.getGroups() != null ? p.getGroups().size() : 0);
    container.addGeneratedProperty("details", new DetailsGenerator());
    container.addAll(Service.getListOfPersons(100));
    legacyApiGrid.setContainerDataSource(container);
    legacyApiGrid.getColumn("details").setHeaderCaption("Details");
    legacyApiGrid.setSizeFull();

    return new MVerticalLayout(fashionableApiGrid, legacyApiGrid);
}
 
Example #10
Source File: VaadinLocaleDemo.java    From viritin with Apache License 2.0 6 votes vote down vote up
@Override
public Component getTestComponent() {
    dateField.setValue(LocalDate.now());
    localeSelect.setId("language-selection");
    localeSelect.addValueChangeListener(e
            -> vaadinLocale.setLocale(e.getValue())
    );
    Button addNewComponent = new Button("Create new component");

    final MVerticalLayout layout = new MVerticalLayout(localeSelect,
            dateField, new VaadinLocaleDemoComponent(), addNewComponent);

    addNewComponent.addClickListener(
            new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event
        ) {
            layout.add(new VaadinLocaleDemoComponent());
        }
    }
    );
    return layout;
}
 
Example #11
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 #12
Source File: ElementCollectionWithPopupEditor.java    From viritin with Apache License 2.0 6 votes vote down vote up
@Override
public Component getTestComponent() {
    PersonFormManualAddressAddition form = new PersonFormManualAddressAddition();

    Person p = Service.getPerson();
    form.setEntity(p);

    form.setSavedHandler(new AbstractForm.SavedHandler<Person>() {

        private static final long serialVersionUID = 5522176287160062623L;

        @Override
        public void onSave(Person entity) {
            Notification.show(entity.toString());
        }
    });

    return new MVerticalLayout(form);
}
 
Example #13
Source File: MButtonClickListeners.java    From viritin with Apache License 2.0 6 votes vote down vote up
@Override
public Component getTestComponent() {
    
    MButton b = new MButton("Say hola");
    
    // And the same without lambdas as the project is 1.6 compatible
    b.addClickListener(new MClickListener() {

        @Override
        public void onClick() {
            sayHola();
        }
    });
    b.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 5019806363620874205L;
        
        @Override
        public void buttonClick(ClickEvent event) {
            sayHolaOldSchool(event);
        }
    });
    
    return new MVerticalLayout(b);
}
 
Example #14
Source File: AbstractPreviewItemComp.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
private void initContent() {
    previewForm = initPreviewForm();
    HorizontalLayout actionControls = createButtonControls();
    if (actionControls != null) {
        headerLayout.with(actionControls).expand(actionControls).withAlign(actionControls, Alignment.TOP_RIGHT);
    }

    MCssLayout contentWrapper = new MCssLayout().withFullSize();

    if (previewLayout == null)
        previewLayout = new DefaultReadViewLayout("");

    contentWrapper.addComponent(previewLayout);

    bodyContent = new MVerticalLayout(previewForm).withSpacing(false).withMargin(false).withFullSize();
    previewLayout.addBody(bodyContent);

    this.addComponent(contentWrapper);
}
 
Example #15
Source File: DefaultTicketGroupComponent.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
DefaultTicketGroupComponent(String titleValue) {
    this.titleValue = titleValue;
    this.withMargin(new MarginInfo(true, false, true, false)).withSpacing(false);
    wrapBody = new MVerticalLayout().withSpacing(false).withFullWidth().withStyleName(WebThemes.BORDER_LIST);
    headerLbl = ELabel.h3("").withFullWidth();
    this.with(headerLbl, wrapBody);
    refresh();
}
 
Example #16
Source File: ReportContainerImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void showDashboard() {
    body.removeAllComponents();
    body.with(ELabel.h2(VaadinIcons.PIE_CHART.getHtml() + " " + UserUIContext.getMessage(ProjectCommonI18nEnum.VIEW_REPORTS)));
    MCssLayout contentLayout = new MCssLayout().withStyleName(WebThemes.FLEX_DISPLAY);

    MVerticalLayout standupConsole = new MVerticalLayout().withWidth("300px").withStyleName("member-block");
    standupConsole.setDefaultComponentAlignment(Alignment.TOP_CENTER);
    standupConsole.addComponent(ELabel.fontIcon(VaadinIcons.CALENDAR_CLOCK).withStyleName("icon-38px"));
    A standupReportLink = new A(ProjectLinkGenerator.generateStandupDashboardLink())
            .appendText(UserUIContext.getMessage(ProjectReportI18nEnum.REPORT_STANDUP));
    standupConsole.addComponent(ELabel.h3(standupReportLink.write()).withUndefinedWidth());
    standupConsole.addComponent(new ELabel(UserUIContext.getMessage(ProjectReportI18nEnum.REPORT_STANDUP_HELP)).withFullWidth());
    contentLayout.addComponent(standupConsole);


    MVerticalLayout userWorkloadReport = new MVerticalLayout().withWidth("300px").withStyleName("member-block");
    userWorkloadReport.setDefaultComponentAlignment(Alignment.TOP_CENTER);
    userWorkloadReport.addComponent(ELabel.fontIcon(VaadinIcons.CALENDAR_CLOCK).withStyleName("icon-38px"));
    A userWorkloadReportLink = new A(ProjectLinkGenerator.generateUsersWorkloadReportLink())
            .appendText(UserUIContext.getMessage(ProjectReportI18nEnum.REPORT_TICKET_ASSIGNMENT));
    userWorkloadReport.addComponent(ELabel.h3(userWorkloadReportLink.write()).withUndefinedWidth());
    userWorkloadReport.addComponent(new ELabel(UserUIContext.getMessage(ProjectReportI18nEnum.REPORT_TICKET_ASSIGNMENT_HELP)).withFullWidth());
    contentLayout.addComponent(userWorkloadReport);

    body.with(contentLayout).expand(contentLayout).withAlign(contentLayout, Alignment.TOP_LEFT);
}
 
Example #17
Source File: TicketRelationWindow.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
public TicketRelationWindow(ProjectTicket ticket) {
    super(UserUIContext.getMessage(TicketI18nEnum.OPT_DEPENDENCIES));
    this.hostedTicket = ticket;
    MVerticalLayout contentLayout = new MVerticalLayout().withMargin(false).withFullWidth();

    editForm = new RelatedBugEditForm();
    ticketRelation = new TicketRelation();
    ticketRelation.setTicketid(ticket.getTypeId());
    ticketRelation.setTickettype(ticket.getType());
    ticketRelation.setRel(TicketRel.Duplicated.name());
    editForm.setBean(ticketRelation);
    contentLayout.add(editForm);

    this.withWidth("750px").withModal(true).withResizable(false).withContent(contentLayout).withCenter();
}
 
Example #18
Source File: ProjectMemberEditViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public AbstractComponent getLayout() {
    MVerticalLayout layout = new MVerticalLayout().withMargin(false).withSpacing(false);
    layout.addComponent(wrappedLayoutFactory.getLayout());

    FormContainer permissionsPanel = new FormContainer();
    projectFormHelper = GridFormLayoutHelper.defaultFormLayoutHelper(LayoutType.TWO_COLUMN);
    permissionsPanel.addSection(UserUIContext.getMessage(ProjectRoleI18nEnum.SECTION_PERMISSIONS),
            projectFormHelper.getLayout());
    layout.addComponent(permissionsPanel);

    return layout;
}
 
Example #19
Source File: TicketDashboardViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private void displayTicketsStatistic() {
    ProjectView rightBar = UIUtils.getRoot(this, ProjectView.class);
    UnresolvedTicketsByAssigneeWidget unresolvedTicketsByAssigneeWidget = new UnresolvedTicketsByAssigneeWidget();
    unresolvedTicketsByAssigneeWidget.setSearchCriteria(statisticSearchCriteria);
    UIUtils.makeStackPanel(unresolvedTicketsByAssigneeWidget);

    UnresolvedTicketByPriorityWidget unresolvedTicketByPriorityWidget = new UnresolvedTicketByPriorityWidget();
    unresolvedTicketByPriorityWidget.setSearchCriteria(statisticSearchCriteria);
    UIUtils.makeStackPanel(unresolvedTicketByPriorityWidget);

    rightBar.addComponentToRightBar(new MVerticalLayout(unresolvedTicketsByAssigneeWidget, unresolvedTicketByPriorityWidget).withMargin(false));
}
 
Example #20
Source File: TicketRelationWindow.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public AbstractComponent getLayout() {
    MVerticalLayout layout = new MVerticalLayout();
    informationLayout = GridFormLayoutHelper.defaultFormLayoutHelper(LayoutType.ONE_COLUMN);
    layout.addComponent(informationLayout.getLayout());

    MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), clickEvent -> {
        ProjectTicket relatedTicket = ticketRelationSelectField.getSelectedTicket();
        ticketRelation.setType(relatedTicket.getType());
        ticketRelation.setTypeid(relatedTicket.getTypeId());

        if (editForm.validateForm()) {
            TicketRelationService relatedBugService = AppContextUtil.getSpringBean(TicketRelationService.class);

            ProjectTicket relationTicket = ticketRelationSelectField.getSelectedTicket();
            if (relationTicket == null) {
                throw new UserInvalidInputException("The related ticket must be not null");
            }

            if (relationTicket.getTypeId().equals(hostedTicket.getTypeId()) && relationTicket.getType().equals(hostedTicket.getType())) {
                throw new UserInvalidInputException("The relation is invalid since the both entries are the same");
            }

            ticketRelation.setTypeid(relationTicket.getTypeId());
            ticketRelation.setType(relationTicket.getType());
            relatedBugService.saveWithSession(ticketRelation, UserUIContext.getUsername());
            close();

            EventBusFactory.getInstance().post(new TicketEvent.DependencyChange(this, hostedTicket.getType(), hostedTicket.getTypeId()));
        }
    }).withIcon(VaadinIcons.CLIPBOARD).withStyleName(WebThemes.BUTTON_ACTION);

    MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close())
            .withStyleName(WebThemes.BUTTON_OPTION);

    MHorizontalLayout controlsBtn = new MHorizontalLayout(cancelBtn, saveBtn).withMargin(false);
    layout.with(controlsBtn).withAlign(controlsBtn, Alignment.MIDDLE_RIGHT);
    return layout;
}
 
Example #21
Source File: ProjectLogoUploadWindow.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
public ProjectLogoUploadWindow(String shortName, Integer projectId, String projectAvatar) {
    super(UserUIContext.getMessage(GenericI18Enum.OPT_UPLOAD_IMAGE));
    withModal(true).withResizable(false).withWidth("200px").withCenter();
    Component projectIcon = ProjectAssetsUtil.projectLogoComp(shortName, projectId, projectAvatar, 100);
    projectIcon.setWidthUndefined();
    UploadImageField avatarUploadField = new UploadImageField(this);
    withContent(new MVerticalLayout(projectIcon, avatarUploadField)
            .withDefaultComponentAlignment(Alignment.TOP_CENTER));
}
 
Example #22
Source File: MBeanFieldGroupRequiredErrorMessage.java    From viritin with Apache License 2.0 5 votes vote down vote up
@Override
public Component getTestComponent() {
    street = new TextField();
    street.setLocale(getLocale());
    street.setId("txtStreet");
    BeanBinder.bind(new Address(),this);
    return new MVerticalLayout(street);
}
 
Example #23
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 #24
Source File: ProjectAddViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private MHorizontalLayout buildHeaderTitle() {
    ELabel titleLbl = ELabel.h2(project.getName());

    MVerticalLayout logoLayout = new MVerticalLayout(ProjectAssetsUtil.projectLogoComp(project.getShortname(),
            project.getId(), project.getAvatarid(), 32))
            .withMargin(false).withWidth("-1px").alignAll(Alignment.TOP_CENTER);
    return new MHorizontalLayout(logoLayout, titleLbl).expand(titleLbl);
}
 
Example #25
Source File: VaadinLocaleDemoComponent.java    From viritin with Apache License 2.0 5 votes vote down vote up
public VaadinLocaleDemoComponent() {
    dateField.setValue(new Date());
    setCompositionRoot(new MVerticalLayout(new Label(
            VaadinLocaleDemoComponent.class.getSimpleName()), dateField));
    // don't call getLocale() here, because it will return null until the
    // component is attached to a parent
}
 
Example #26
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;
}
 
Example #27
Source File: ElementCollections.java    From viritin with Apache License 2.0 5 votes vote down vote up
@Override
protected Component createContent() {

    /**
     * In simple cases the editor row instance don't need to be
     * configured or it can be instantiated automatically with empty
     * parameter constructor. This would work here as well, but as an
     * example lets override the instantiation strategy, where in real
     * life you could e.g. populate options to selects from your
     * backend.
     */
    addresses.setEditorInstantiator(
            new AbstractElementCollection.Instantiator<AddressRow2>() {

                private static final long serialVersionUID = -5211408262496520519L;

                @Override
                public AddressRow2 create() {
                    AddressRow2 addressRow = new AddressRow2();
                    // Not using EnumSelect here as an example, so 
                    // populating manually.
                    addressRow.type.addItems((Object[]) AddressType.values());
                    return addressRow;
                }
            });

    return new MVerticalLayout(
            addresses,
            add,
            remove,
            getToolbar()
    );
}
 
Example #28
Source File: StandupListViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private void showReports() {
    removeAllComponents();
    if (CollectionUtils.isNotEmpty(projectIds)) {
        MHorizontalLayout headerLayout = constructHeader();
        ELabel listLnl = ELabel.h3("Projects (" + projectIds.size() + ")");
        MHorizontalLayout favoriteListHeaderPanel = new MHorizontalLayout(listLnl).expand(listLnl).withMargin(new
                MarginInfo(false, false, false, true)).withStyleName(WebThemes.PANEL_HEADER).withFullWidth().alignAll(Alignment.MIDDLE_LEFT);
        projectListComp = new ProjectListComp();
        MVerticalLayout projectListPanel = new MVerticalLayout(favoriteListHeaderPanel, projectListComp).withMargin(false).withSpacing(false).withWidth("300px");

        standupPerProjectView = new StandupPerProjectView();
        standupPerProjectView.setMargin(new MarginInfo(false, false, false, true));
        MHorizontalLayout bodyLayout = new MHorizontalLayout(projectListPanel, standupPerProjectView).expand(standupPerProjectView);
        with(headerLayout, bodyLayout).expand(bodyLayout);

        int totalCount = projectListComp.display(projectIds, onDate);
        if (totalCount > 0) {
            StandupReportStatistic firstProject = projectListComp.getItemAt(0);
            if (firstProject != null) {
                viewStandupReportsForProject(firstProject);
            }
            Component firstRow = projectListComp.getRowAt(0);
            if (firstRow != null) {
                projectListComp.setSelectedRow(firstRow);
            }
        }
    }
}
 
Example #29
Source File: RoleReadViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected Layout createBottomPanel() {
    MVerticalLayout permissionsPanel = new MVerticalLayout().withMargin(false);

    PermissionMap permissionMap = role.getPermissionMap();

    permissionsPanel.addComponent(constructPermissionSectionView(UserUIContext.getMessage(RoleI18nEnum.SECTION_PROJECT_MANAGEMENT_TITLE),
            permissionMap, RolePermissionCollections.PROJECT_PERMISSION_ARR));

    permissionsPanel.addComponent(constructPermissionSectionView(UserUIContext.getMessage(RoleI18nEnum.SECTION_ACCOUNT_MANAGEMENT_TITLE),
            permissionMap, RolePermissionCollections.ACCOUNT_PERMISSION_ARR));

    return permissionsPanel;
}
 
Example #30
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();
}