Example usage for com.vaadin.ui VerticalLayout addComponent

List of usage examples for com.vaadin.ui VerticalLayout addComponent

Introduction

In this page you can find the example usage for com.vaadin.ui VerticalLayout addComponent.

Prototype

@Override
public void addComponent(Component c) 

Source Link

Document

Add a component into this container.

Usage

From source file:com.hack23.cia.web.impl.ui.application.views.user.committee.pagemode.CommitteeRankingOverviewPageModContentFactoryImpl.java

License:Apache License

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override// w ww . ja v a 2 s . c  o  m
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    getCommitteeRankingMenuItemFactory().createCommitteeeRankingMenuBar(menuBar);

    final String pageId = getPageId(parameters);

    panelContent.addComponent(createDescription());

    getCommitteeRankingMenuItemFactory().createOverviewPage(panelContent);

    panel.setCaption(OVERVIEW + parameters);

    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_RANKING_VIEW,
            ApplicationEventGroup.USER, NAME, parameters, pageId);

    return panelContent;

}

From source file:com.hack23.cia.web.impl.ui.application.views.user.country.pagemode.CountryRankingOverviewPageModContentFactoryImpl.java

License:Apache License

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override//from w  w  w . j  a  v a  2s.c  om
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();
    getCountryMenuItemFactory().createCountryTopicMenu(menuBar);

    final String pageId = getPageId(parameters);

    panelContent.addComponent(new Label(OVERVIEW));

    getCountryMenuItemFactory().createOverviewPage(panelContent);

    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_TEST_CHART_VIEW, ApplicationEventGroup.USER,
            NAME, parameters, pageId);
    panel.setCaption(OVERVIEW);

    return panelContent;

}

From source file:com.hack23.cia.web.impl.ui.application.views.user.document.pagemode.DocumentAttachementsPageModContentFactoryImpl.java

License:Apache License

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override//from  w w  w . j av a2s  .  c om
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    final String pageId = getPageId(parameters);

    final DataContainer<DocumentElement, String> documentElementDataContainer = getApplicationManager()
            .getDataContainer(DocumentElement.class);

    final DataContainer<DocumentStatusContainer, String> documentStatusContainerDataContainer = getApplicationManager()
            .getDataContainer(DocumentStatusContainer.class);

    getApplicationManager().getDataContainer(CommitteeProposalComponentData.class);

    final DocumentElement documentElement = documentElementDataContainer.load(pageId);

    if (documentElement != null) {

        getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId);

        final DocumentStatusContainer documentStatusContainer = documentStatusContainerDataContainer
                .findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document,
                        DocumentData.class, DocumentData_.id, pageId);

        LabelFactory.createHeader2Label(panelContent, DOCUMENT_ATTACHMENTS);

        if (documentStatusContainer != null && documentStatusContainer.getDocumentAttachmentContainer() != null
                && documentStatusContainer.getDocumentAttachmentContainer()
                        .getDocumentAttachmentList() != null) {
            final BeanItemContainer<DocumentAttachment> documentAttachmentDataSource = new BeanItemContainer<>(
                    DocumentAttachment.class,
                    documentStatusContainer.getDocumentAttachmentContainer().getDocumentAttachmentList());

            getGridFactory().createBasicBeanItemGrid(panelContent, documentAttachmentDataSource,
                    "Document attachements", new String[] { "fileName", "fileSize", "fileType", "fileUrl" },
                    new String[] { "hjid" }, null, null, null);

            final List<DocumentAttachment> documentAttachmentList = documentStatusContainer
                    .getDocumentAttachmentContainer().getDocumentAttachmentList();

            final VerticalLayout verticalLayout = new VerticalLayout();
            panelContent.addComponent(verticalLayout);
            panelContent.setExpandRatio(verticalLayout, ContentRatio.SMALL);

            for (final DocumentAttachment documentAttachment : documentAttachmentList) {
                final ExternalAttachmentDownloadLink link = new ExternalAttachmentDownloadLink(
                        documentAttachment.getFileName(), documentAttachment.getFileType(),
                        documentAttachment.getFileUrl());
                verticalLayout.addComponent(link);
            }
        }

        panel.setContent(panelContent);
        getPageActionEventHelper().createPageEvent(ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER,
                NAME, parameters, pageId);
    }

    return panelContent;

}

From source file:com.hack23.cia.web.impl.ui.application.views.user.document.pagemode.DocumentDataPageModContentFactoryImpl.java

License:Apache License

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override//from  ww  w.j a va2 s .  c o m
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    final String pageId = getPageId(parameters);

    final DataContainer<DocumentElement, String> documentElementDataContainer = getApplicationManager()
            .getDataContainer(DocumentElement.class);

    final DataContainer<DocumentContentData, String> documentContentDataDataContainer = getApplicationManager()
            .getDataContainer(DocumentContentData.class);

    getApplicationManager().getDataContainer(CommitteeProposalComponentData.class);

    final DocumentElement documentElement = documentElementDataContainer.load(pageId);

    if (documentElement != null) {

        getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId);

        LabelFactory.createHeader2Label(panelContent, DOCUMENT_DATA);

        final List<DocumentContentData> documentContentlist = documentContentDataDataContainer
                .getAllBy(DocumentContentData_.id, pageId);

        if (!documentContentlist.isEmpty()) {

            final Panel formPanel = new Panel();
            formPanel.setSizeFull();

            panelContent.addComponent(formPanel);

            final FormLayout formContent = new FormLayout();
            formPanel.setContent(formContent);

            final Label htmlContent = new Label(documentContentlist.get(0).getContent(), ContentMode.HTML);

            formContent.addComponent(htmlContent);

            panelContent.setExpandRatio(formPanel, ContentRatio.GRID);

        }

        panel.setContent(panelContent);
        getPageActionEventHelper().createPageEvent(ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER,
                NAME, parameters, pageId);
    }

    return panelContent;

}

From source file:com.hack23.cia.web.impl.ui.application.views.user.document.pagemode.DocumentOverviewPageModContentFactoryImpl.java

License:Apache License

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override//from  w  ww . j  a  va 2  s .  c  om
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    final String pageId = getPageId(parameters);

    final DataContainer<DocumentElement, String> documentElementDataContainer = getApplicationManager()
            .getDataContainer(DocumentElement.class);

    final DataContainer<DocumentStatusContainer, String> documentStatusContainerDataContainer = getApplicationManager()
            .getDataContainer(DocumentStatusContainer.class);

    getApplicationManager().getDataContainer(CommitteeProposalComponentData.class);

    final DocumentElement documentElement = documentElementDataContainer.load(pageId);

    if (documentElement != null) {

        getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId);

        final DocumentStatusContainer documentStatusContainer = documentStatusContainerDataContainer
                .findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document,
                        DocumentData.class, DocumentData_.id, pageId);

        LabelFactory.createHeader2Label(panelContent, OVERVIEW);

        final VerticalLayout overviewLayout = new VerticalLayout();
        overviewLayout.setSizeFull();

        panelContent.addComponent(overviewLayout);
        panelContent.setExpandRatio(overviewLayout, ContentRatio.LARGE_FORM);

        getDocumentMenuItemFactory().createOverviewPage(overviewLayout, pageId);

        getFormFactory().addFormPanelTextFields(panelContent, new BeanItem<>(documentElement),
                DocumentElement.class,
                Arrays.asList(new String[] { "id", "org", "documentType", "subType", "rm", "status", "title",
                        "subTitle", "madePublicDate", "createdDate", "systemDate", "relatedId", "label",
                        "tempLabel", "numberValue", "kallId", "documentFormat" }));

        if (documentStatusContainer != null) {
            getFormFactory().addFormPanelTextFields(panelContent, new BeanItem<>(documentStatusContainer),
                    DocumentStatusContainer.class, Arrays.asList(new String[] { "documentCategory" }));

            getFormFactory().addFormPanelTextFields(panelContent,
                    new BeanItem<>(documentStatusContainer.getDocument()), DocumentData.class,
                    Arrays.asList(new String[] { "id", "org", "documentType", "subType", "rm", "status",
                            "title", "subTitle", "madePublicDate", "label", "tempLabel", "numberValue",
                            "hangarId", }));
        }

        panel.setContent(panelContent);
        getPageActionEventHelper().createPageEvent(ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER,
                NAME, parameters, pageId);
    }

    return panelContent;

}

From source file:com.hack23.cia.web.impl.ui.application.views.user.document.pagemode.SearchDocumentPageModContentFactoryImpl.java

License:Apache License

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override//from  www.j av a  2 s .co  m
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    final String pageId = getPageId(parameters);

    getMenuItemFactory().createMainPageMenuBar(menuBar);

    final VerticalLayout searchLayout = new VerticalLayout();
    searchLayout.setSizeFull();
    panelContent.addComponent(searchLayout);

    final VerticalLayout searchresultLayout = new VerticalLayout();
    searchresultLayout.setSizeFull();

    final Panel formPanel = new Panel();
    formPanel.setSizeFull();

    searchresultLayout.addComponent(formPanel);

    final FormLayout formContent = new FormLayout();
    formPanel.setContent(formContent);

    panelContent.addComponent(searchresultLayout);

    final SearchDocumentRequest searchRequest = new SearchDocumentRequest();
    searchRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
    searchRequest.setMaxResults(MAX_RESULT_SIZE);
    searchRequest.setSearchExpression("");
    final SearchDocumentResponseHandler handler = new SearchDocumentResponseHandler() {

        /** The Constant serialVersionUID. */
        private static final long serialVersionUID = 1L;

        @Override
        public void handle(final SearchDocumentResponse response) {
            searchresultLayout.removeAllComponents();

            final BeanItemContainer<DocumentElement> documentActivityDataDataDataSource = new BeanItemContainer<>(
                    DocumentElement.class, response.getResultElement());

            getGridFactory().createBasicBeanItemGrid(searchresultLayout, documentActivityDataDataDataSource,
                    "Document",
                    new String[] { "rm", "createdDate", "madePublicDate", "documentType", "subType", "title",
                            "subTitle", "status" },
                    new String[] { "label", "id", "hit", "relatedId", "org", "tempLabel", "numberValue",
                            "systemDate", "kallId", "documentFormat", "documentUrlText", "documentUrlHtml",
                            "documentStatusUrlXml", "committeeReportUrlXml" },
                    null, null, null);

        }
    };
    final ClickListener searchListener = new SearchDocumentClickListener(searchRequest, getApplicationManager(),
            handler);
    getFormFactory().addRequestInputFormFields(formContent, new BeanItem<>(searchRequest),
            SearchDocumentRequest.class, Arrays.asList(new String[] { "searchExpression" }), "Search",
            searchListener);

    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER, NAME,
            parameters, pageId);

    return panelContent;

}

From source file:com.hack23.cia.web.impl.ui.application.views.user.goverment.pagemode.MinistryOverviewPageModContentFactoryImpl.java

License:Apache License

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override/*  w  w w.  j a v a2 s  .  co m*/
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    final String pageId = getPageId(parameters);

    final DataContainer<ViewRiksdagenMinistry, String> dataContainer = getApplicationManager()
            .getDataContainer(ViewRiksdagenMinistry.class);

    final ViewRiksdagenMinistry viewRiksdagenMinistry = dataContainer.load(pageId);

    if (viewRiksdagenMinistry != null) {

        getMinistryMenuItemFactory().createMinistryMenuBar(menuBar, pageId);

        LabelFactory.createHeader2Label(panelContent, OVERVIEW);

        final VerticalLayout overviewLayout = new VerticalLayout();
        overviewLayout.setSizeFull();

        panelContent.addComponent(overviewLayout);
        panelContent.setExpandRatio(overviewLayout, ContentRatio.LARGE_FORM);

        getMinistryMenuItemFactory().createOverviewPage(overviewLayout, pageId);

        final Link addMinistryPageLink = getPageLinkFactory().addMinistryPageLink(viewRiksdagenMinistry);
        panelContent.addComponent(addMinistryPageLink);

        getFormFactory().addFormPanelTextFields(panelContent, new BeanItem<>(viewRiksdagenMinistry),
                ViewRiksdagenMinistry.class,
                Arrays.asList(new String[] { "nameId", "active", "firstAssignmentDate", "lastAssignmentDate",
                        "totalAssignments", "totalDaysServed", "currentMemberSize" }));

        panelContent.setExpandRatio(addMinistryPageLink, ContentRatio.SMALL);

        panel.setCaption(MINISTRY + viewRiksdagenMinistry.getNameId());
        getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_VIEW, ApplicationEventGroup.USER,
                NAME, parameters, pageId);

    }

    return panelContent;

}

From source file:com.hack23.cia.web.impl.ui.application.views.user.goverment.pagemode.MinistryRankingAllMinistriesChartsPageModContentFactoryImpl.java

License:Apache License

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override/*ww w  . ja  va  2 s .  c om*/
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    getMinistryRankingMenuItemFactory().createMinistryRankingMenuBar(menuBar);

    final String pageId = getPageId(parameters);

    final HorizontalLayout chartLayout = new HorizontalLayout();
    chartLayout.setSizeFull();

    chartDataManager.createChartPanel(chartLayout, dataSeriesFactory.createMinistryChartTimeSeriesAll(), "All");

    panelContent.addComponent(chartLayout);

    panel.setCaption(CHARTS + parameters);

    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_RANKING_VIEW,
            ApplicationEventGroup.USER, NAME, parameters, pageId);

    return panelContent;

}

From source file:com.hack23.cia.web.impl.ui.application.views.user.goverment.pagemode.MinistryRankingAllPartiesChartsPageModContentFactoryImpl.java

License:Apache License

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override/*from w  w  w  .  j  a v a 2  s  . com*/
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    getMinistryRankingMenuItemFactory().createMinistryRankingMenuBar(menuBar);

    final String pageId = getPageId(parameters);

    final HorizontalLayout chartLayout = new HorizontalLayout();
    chartLayout.setSizeFull();

    chartDataManager.createChartPanel(chartLayout,
            dataSeriesFactory.createChartTimeSeriesTotalDaysServedGovernmentByParty(),
            "All Parties, total days served");

    panelContent.addComponent(chartLayout);

    panel.setCaption(CHARTS + parameters);

    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_RANKING_VIEW,
            ApplicationEventGroup.USER, NAME, parameters, pageId);

    return panelContent;

}

From source file:com.hack23.cia.web.impl.ui.application.views.user.goverment.pagemode.MinistryRankingCurrentMinistriesChartsPageModContentFactoryImpl.java

License:Apache License

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override/*from   w w  w  .  j  a v  a  2 s  . c  o m*/
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    getMinistryRankingMenuItemFactory().createMinistryRankingMenuBar(menuBar);

    final String pageId = getPageId(parameters);

    final HorizontalLayout chartLayout = new HorizontalLayout();
    chartLayout.setSizeFull();

    chartDataManager.createChartPanel(chartLayout, dataSeriesFactory.createMinistryChartTimeSeriesCurrent(),
            "Current Ministies, by headcount");
    panelContent.addComponent(chartLayout);

    panel.setCaption(CHARTS + parameters);

    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_RANKING_VIEW,
            ApplicationEventGroup.USER, NAME, parameters, pageId);

    return panelContent;

}