Example usage for com.vaadin.ui VerticalLayout setSizeFull

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

Introduction

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

Prototype

@Override
    public void setSizeFull() 

Source Link

Usage

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

License:Apache License

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override/* w  w w  .  j  a v  a 2s.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<ViewRiksdagenCommittee, String> dataContainer = getApplicationManager()
            .getDataContainer(ViewRiksdagenCommittee.class);

    final ViewRiksdagenCommittee viewRiksdagenCommittee = dataContainer.load(pageId);

    if (viewRiksdagenCommittee != null) {

        getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId);

        LabelFactory.createHeader2Label(panelContent, OVERVIEW);

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

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

        getCommitteeMenuItemFactory().createOverviewPage(overviewLayout, pageId);

        final Link addCommitteePageLink = getPageLinkFactory().addCommitteePageLink(viewRiksdagenCommittee);
        panelContent.addComponent(addCommitteePageLink);

        getFormFactory().addFormPanelTextFields(panelContent, new BeanItem<>(viewRiksdagenCommittee),
                ViewRiksdagenCommittee.class,
                Arrays.asList(new String[] { "embeddedId.detail", "active", "firstAssignmentDate",
                        "lastAssignmentDate", "totalAssignments", "totalDaysServed", "currentMemberSize" }));

        panelContent.setExpandRatio(addCommitteePageLink, ContentRatio.SMALL);

        panel.setCaption(COMMITTEE + viewRiksdagenCommittee.getEmbeddedId().getDetail());
        getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_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/* www . j  a v  a 2 s. com*/
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// w w  w.  ja  v  a  2s.  c om
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//from w w  w .ja va  2 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<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.party.pagemode.PartyOverviewPageModContentFactoryImpl.java

License:Apache License

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override/*from w  w w. j a  v  a 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<ViewRiksdagenParty, String> dataContainer = getApplicationManager()
            .getDataContainer(ViewRiksdagenParty.class);

    final DataContainer<ViewRiksdagenPartySummary, String> partySummarydataContainer = getApplicationManager()
            .getDataContainer(ViewRiksdagenPartySummary.class);

    final ViewRiksdagenParty viewRiksdagenParty = dataContainer.load(pageId);

    if (viewRiksdagenParty != null) {

        getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);

        LabelFactory.createHeader2Label(panelContent, OVERVIEW);

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

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

        getPartyMenuItemFactory().createOverviewPage(overviewLayout, pageId);

        final Link addPartyPageLink = getPageLinkFactory().addPartyPageLink(viewRiksdagenParty);
        panelContent.addComponent(addPartyPageLink);

        panelContent.setExpandRatio(addPartyPageLink, ContentRatio.SMALL);

        getFormFactory().addFormPanelTextFields(panelContent, new BeanItem<>(viewRiksdagenParty),
                ViewRiksdagenParty.class, Arrays.asList(new String[] { "partyName", "partyId", "headCount",
                        "partyNumber", "registeredDate", "website" }));

        final ViewRiksdagenPartySummary viewRiksdagenPartySummary = partySummarydataContainer.load(pageId);

        if (viewRiksdagenPartySummary != null) {

            getFormFactory().addFormPanelTextFields(panelContent, new BeanItem<>(viewRiksdagenPartySummary),
                    ViewRiksdagenPartySummary.class,
                    Arrays.asList(new String[] { "active", "firstAssignmentDate", "lastAssignmentDate",
                            "currentAssignments", "totalAssignments", "totalDaysServed", "activeEu",
                            "totalActiveEu", "totalDaysServedEu", "activeGovernment", "totalActiveGovernment",
                            "totalDaysServedGovernment", "activeCommittee", "totalActiveCommittee",
                            "totalDaysServedCommittee", "activeParliament", "totalActiveParliament",
                            "totalDaysServedParliament" }));

        }

        pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
    }
    return panelContent;

}

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

License:Apache License

/**
 * Creates the overview content.//w  w  w.  j a v a2s  .c  o m
 *
 * @param panelContent
 *            the panel content
 * @param personData
 *            the person data
 * @param viewRiksdagenPolitician
 *            the view riksdagen politician
 * @param pageId
 */
private void createOverviewContent(final VerticalLayout panelContent, final PersonData personData,
        final ViewRiksdagenPolitician viewRiksdagenPolitician, final String pageId) {
    LabelFactory.createHeader2Label(panelContent, OVERVIEW);

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

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

    getPoliticianMenuItemFactory().createOverviewPage(overviewLayout, pageId);

    final Link createPoliticianPageLink = getPageLinkFactory().createPoliticianPageLink(personData);
    panelContent.addComponent(createPoliticianPageLink);

    final Image image = new Image("",
            new ExternalResource(personData.getImageUrl192().replace("http://", "https://")));

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

    panelContent.addComponent(horizontalLayout);

    horizontalLayout.addComponent(image);

    getFormFactory().addFormPanelTextFields(horizontalLayout, new BeanItem<>(viewRiksdagenPolitician),
            ViewRiksdagenPolitician.class,
            Arrays.asList(new String[] { "firstName", "lastName", "gender", "bornYear", "party", "active",
                    "firstAssignmentDate", "lastAssignmentDate", "currentAssignments",
                    "currentMinistryAssignments", "currentSpeakerAssignments", "currentCommitteeAssignments",
                    "currentPartyAssignments", "totalMinistryAssignments", "totalCommitteeAssignments",
                    "totalSpeakerAssignments", "totalPartyAssignments", "totalAssignments", "totalDaysServed",
                    "activeEu", "totalDaysServedEu", "activeGovernment", "totalDaysServedGovernment",
                    "activeSpeaker", "totalDaysServedSpeaker", "activeCommittee", "totalDaysServedCommittee",
                    "activeParliament", "totalDaysServedParliament", "activeParty", "totalDaysServedParty" }));

    getGridFactory().createBasicBeanItemGrid(panelContent,
            new BeanItemContainer<>(DetailData.class, personData.getPersonDetailData().getDetailList()),
            "Detail", new String[] { "code", "detail" }, new String[] { "hjid", "intressentId", "detailType" },
            null, null, null);

    panelContent.setExpandRatio(createPoliticianPageLink, ContentRatio.SMALL);
    panelContent.setExpandRatio(horizontalLayout, ContentRatio.GRID);

}

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

License:Apache License

/**
 * Creates the role summary.//from  w  ww  . jav  a 2 s.c o m
 *
 * @param roleSummaryLayoutTabsheet
 *            the role summary layout tabsheet
 * @param assignmentList
 *            the assignment list
 * @param viewRiksdagenPolitician
 *            the view riksdagen politician
 */
private void createRoleSummary(final VerticalLayout roleSummaryLayoutTabsheet,
        final List<AssignmentData> assignmentList, final ViewRiksdagenPolitician viewRiksdagenPolitician) {

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

    layout.addComponent(new Label(TOTAL_ASSIGNMENTS + assignmentList.size()));

    if (viewRiksdagenPolitician != null) {

        layout.addComponent(new Label(GOVERNMENT_EXPERIENCE
                + convertToYearsString(viewRiksdagenPolitician.getTotalDaysServedGovernment())));
        layout.addComponent(new Label(SPEAKER_EXPERIENCE
                + convertToYearsString(viewRiksdagenPolitician.getTotalDaysServedSpeaker())));
        layout.addComponent(new Label(COMMITTEE_EXPERIENCE
                + convertToYearsString(viewRiksdagenPolitician.getTotalDaysServedCommittee())));
        layout.addComponent(new Label(
                EU_EXPERIENCE + convertToYearsString(viewRiksdagenPolitician.getTotalDaysServedEu())));
        layout.addComponent(new Label(PARLIAMENT_EXPERIENCE
                + convertToYearsString(viewRiksdagenPolitician.getTotalDaysServedParliament())));
        layout.addComponent(new Label(
                PARTY_EXPERIENCE + convertToYearsString(viewRiksdagenPolitician.getTotalDaysServedParty())));
    }

    roleSummaryLayoutTabsheet.addComponent(layout);
    roleSummaryLayoutTabsheet.setExpandRatio(layout, ContentRatio.GRID);

}

From source file:com.haulmont.cuba.web.app.folders.CubaFoldersPane.java

License:Apache License

protected void createFoldersPaneLayout(Component appFoldersPane, Component searchFoldersPane) {
    if (appFoldersPane != null && searchFoldersPane != null) {
        vertSplit = new VerticalSplitPanel();
        vertSplit.setSplitPosition(verticalSplitPos);

        VerticalLayout afLayout = new VerticalLayout();
        afLayout.setSpacing(true);//  www  .j a va2  s  .co m
        afLayout.setSizeFull();
        if (appFoldersLabel != null)
            addFoldersLabel(afLayout, appFoldersLabel);
        afLayout.addComponent(appFoldersPane);
        afLayout.setExpandRatio(appFoldersPane, 1);
        vertSplit.setFirstComponent(afLayout);

        VerticalLayout sfLayout = new VerticalLayout();
        sfLayout.setSpacing(true);
        sfLayout.setSizeFull();
        if (searchFoldersLabel != null)
            addFoldersLabel(sfLayout, searchFoldersLabel);
        sfLayout.addComponent(searchFoldersPane);
        sfLayout.setExpandRatio(searchFoldersPane, 1);
        vertSplit.setSecondComponent(sfLayout);

        addComponent(vertSplit);
    } else {
        if (appFoldersPane != null) {
            if (appFoldersLabel != null)
                addFoldersLabel(this, appFoldersLabel);
            addComponent(appFoldersPane);
            setExpandRatio(appFoldersPane, 1);
        }
        if (searchFoldersPane != null) {
            if (searchFoldersLabel != null)
                addFoldersLabel(this, searchFoldersLabel);
            addComponent(searchFoldersPane);
            setExpandRatio(searchFoldersPane, 1);
        }
    }
}

From source file:com.haulmont.cuba.web.AppUI.java

License:Apache License

protected void showCriticalExceptionMessage(Exception exception) {
    String initErrorCaption = messages.getMainMessage("app.initErrorCaption");
    String initErrorMessage = messages.getMainMessage("app.initErrorMessage");

    VerticalLayout content = new VerticalLayout();
    content.setStyleName("c-init-error-view");
    content.setSizeFull();

    VerticalLayout errorPanel = new VerticalLayout();
    errorPanel.setStyleName("c-init-error-panel");
    errorPanel.setWidthUndefined();// w w  w  .  j a  v a2 s. c om
    errorPanel.setSpacing(true);

    Label captionLabel = new Label(initErrorCaption);
    captionLabel.setWidthUndefined();
    captionLabel.setStyleName("c-init-error-caption");
    captionLabel.addStyleName("h2");
    captionLabel.setValue(initErrorCaption);

    errorPanel.addComponent(captionLabel);

    Label messageLabel = new Label(initErrorCaption);
    messageLabel.setWidthUndefined();
    messageLabel.setStyleName("c-init-error-message");
    messageLabel.setValue(initErrorMessage);

    errorPanel.addComponent(messageLabel);

    Button retryButton = new Button(messages.getMainMessage("app.initRetry"));
    retryButton.setStyleName("c-init-error-retry");
    retryButton.addClickListener(event -> {
        // always restart UI
        String url = ControllerUtils.getLocationWithoutParams() + "?restartApp";
        getPage().open(url, "_self");
    });

    errorPanel.addComponent(retryButton);
    errorPanel.setComponentAlignment(retryButton, Alignment.MIDDLE_CENTER);

    content.addComponent(errorPanel);
    content.setComponentAlignment(errorPanel, Alignment.MIDDLE_CENTER);

    setContent(content);
}

From source file:com.haulmont.cuba.web.log.LogWindow.java

License:Apache License

private void initUI() {
    ClientConfig clientConfig = AppBeans.<Configuration>get(Configuration.NAME).getConfig(ClientConfig.class);

    String closeShortcut = clientConfig.getCloseShortcut();
    KeyCombination closeCombination = KeyCombination.create(closeShortcut);

    com.vaadin.event.ShortcutAction closeShortcutAction = new com.vaadin.event.ShortcutAction(
            "closeShortcutAction", closeCombination.getKey().getCode(),
            KeyCombination.Modifier.codes(closeCombination.getModifiers()));

    addActionHandler(new com.vaadin.event.Action.Handler() {
        @Override//from  w w w. j  av a2s .  c  o m
        public com.vaadin.event.Action[] getActions(Object target, Object sender) {
            return new com.vaadin.event.Action[] { closeShortcutAction };
        }

        @Override
        public void handleAction(com.vaadin.event.Action action, Object sender, Object target) {
            if (Objects.equals(action, closeShortcutAction)) {
                close();
            }
        }
    });

    VerticalLayout layout = new VerticalLayout();
    layout.setSpacing(true);
    layout.setSizeFull();
    setContent(layout);

    Panel scrollablePanel = new Panel();
    scrollablePanel.setSizeFull();
    VerticalLayout scrollContent = new VerticalLayout();
    scrollContent.setSizeUndefined();
    scrollablePanel.setContent(scrollContent);

    final Label label = new Label();
    label.setContentMode(ContentMode.HTML);
    label.setValue(writeLog());
    label.setSizeUndefined();
    label.setStyleName("c-log-content");

    ((Layout) scrollablePanel.getContent()).addComponent(label);

    HorizontalLayout topLayout = new HorizontalLayout();
    topLayout.setWidth("100%");
    topLayout.setHeightUndefined();

    Messages messages = AppBeans.get(Messages.NAME);
    Button refreshBtn = new CubaButton(messages.getMessage(getClass(), "logWindow.refreshBtn"),
            (Button.ClickListener) event -> label.setValue(writeLog()));

    topLayout.addComponent(refreshBtn);

    layout.addComponent(topLayout);
    layout.addComponent(scrollablePanel);

    layout.setExpandRatio(scrollablePanel, 1.0f);
}