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.hivesys.dashboard.view.search.TextualView.java

public void UpdateSearchPane(String searchString) {
    css.removeAllComponents();/*from  ww  w. j a  v  a  2  s  .  co  m*/

    SearchResponse response = ElasticSearchContext.getInstance().searchSimpleQuery(searchString);
    logResponse(response);
    SearchHits results = response.getHits();

    Label labelResultSummary = new Label("About " + results.getHits().length + " results found <br><br>",
            ContentMode.HTML);
    css.addComponent(labelResultSummary);

    for (SearchHit hit : results) {
        CssLayout cssResult = new CssLayout();
        cssResult.setStyleName("search-result");

        try {
            String filename = DocumentDB.getInstance().getDocumentNameFromHash(hit.getId());
            String boxviewID = DocumentDB.getInstance().getBoxViewIDFromHash(hit.getId());

            String highlight = "";
            HighlightField objhighlight = hit.highlightFields().get("file");
            if (objhighlight != null) {
                for (Text fgmt : objhighlight.getFragments()) {
                    highlight += fgmt.string() + "<br>";
                }
            }

            Button lblfileName = new Button(filename);
            lblfileName.addClickListener((Button.ClickEvent event) -> {
                if (boxviewID != null) {
                    String url = BoxViewDocuments.getInstance().getViewURL(boxviewID);
                    if (url != null || !url.equals("")) {
                        url = BoxViewDocuments.getInstance().getViewURL(boxviewID);
                        BrowserFrame bframe = new BrowserFrame(filename, new ExternalResource(url));
                        VerticalLayout vlayout = new VerticalLayout(bframe);

                        final Window w = new Window();
                        w.setSizeFull();
                        w.setModal(true);
                        w.setWindowMode(WindowMode.MAXIMIZED);
                        w.setContent(vlayout);
                        vlayout.setSizeFull();
                        vlayout.setMargin(true);
                        w.setResizable(false);
                        w.setDraggable(false);

                        UI.getCurrent().addWindow(w);
                        bframe.setSizeFull();
                        return;
                    }
                    Notification.show("Preview not available for this document!");
                }
            });
            lblfileName.setPrimaryStyleName("filename");

            Label lblHighlight = new Label(highlight, ContentMode.HTML);
            lblHighlight.setStyleName("highlight");

            cssResult.addComponent(lblfileName);
            cssResult.addComponent(lblHighlight);

            css.addComponent(cssResult);
            css.addComponent(new Label("<br>", ContentMode.HTML));

        } catch (SQLException ex) {
        }

    }

}

From source file:com.hris.connection.ErrorLoggedNotification.java

public static void showErrorLoggedOnWindow(String error, String className) {
    VerticalLayout v = new VerticalLayout();
    v.setSizeFull();
    v.setMargin(true);/*from   ww  w.jav  a2 s .  c  o m*/

    Window sub = new Window("ERROR MESSAGE!", v);
    sub.setWidth("500px");
    if (sub.getParent() == null) {
        UI.getCurrent().addWindow(sub);
    }
    sub.setModal(true);

    Panel panel = new Panel();
    panel.setSizeFull();
    panel.setContent(new Label(error + " on \n" + className, ContentMode.HTML));
    panel.getContent().setHeightUndefined();

    sub.setContent(panel);
    sub.getContent().setHeightUndefined();
}

From source file:com.hris.payroll.PayrollUI.java

private void getPayrollTab() {
    TabSheet tab = new TabSheet();
    tab.setSizeFull();/*  w  w w . jav  a 2s  .  c  o m*/

    VerticalLayout v = new VerticalLayout();
    v.setSizeFull();
    v.addComponent(ledger);
    tab.addTab(v, "Payroll Ledger");

    v = new VerticalLayout();
    v.setSizeFull();
    tab.addTab(v, "Payroll Register");

    v = new VerticalLayout();
    v.setSizeFull();
    v.addComponent(tm);
    tab.addTab(v, "13th Month");

    v = new VerticalLayout();
    v.setSizeFull();
    v.addComponent(al);
    tab.addTab(v, "Alpha List");

    v = new VerticalLayout();
    v.setSizeFull();
    v.addComponent(reportUI);
    tab.addTab(v, "Reports");

    addComponent(tab);
}

From source file:com.hris.payroll.reports.ReportViewer.java

public ReportViewer(String reportType, int branchId, Date payrollDate) {
    this.reportType = reportType;
    this.branchId = branchId;
    this.payrollDate = payrollDate;

    setWidth("900px");
    setHeight("600px");
    center();/*from   ww w  .  j a  v  a2 s  .  c o m*/

    StreamResource resource = null;

    switch (reportType) {
    case "Payslip": {
        String filename = "Payslip-" + new Date().getTime() + ".pdf";
        resource = new StreamResource(new PayslipReportPDF(getBranchId(), getPayrollDate()), filename);
        break;
    }

    case "Advances Summary": {
        String filename = "Advances-" + new Date().getTime() + ".pdf";
        resource = new StreamResource(new AdvancesSummaryReportPdf(getBranchId(), getPayrollDate()), filename);
        break;
    }

    default: {
        String filename = "Advances-" + new Date().getTime() + ".pdf";
        resource = new StreamResource(new AdvancesReportPdf(getBranchId(), getPayrollDate(), reportType),
                filename);
        break;
    }
    }

    resource.setMIMEType("application/pdf");

    VerticalLayout v = new VerticalLayout();
    v.setSizeFull();
    v.setSpacing(true);
    v.setMargin(new MarginInfo(false, false, true, false));

    Embedded em = new Embedded();
    em.setSource(resource);
    em.setSizeFull();
    em.setType(Embedded.TYPE_BROWSER);
    v.addComponent(em);
    v.setExpandRatio(em, 1);

    setContent(v);
}

From source file:com.invient.vaadin.InvientChartsDemoWin.java

License:Apache License

public InvientChartsDemoWin() {
    VerticalLayout mainLayout = new VerticalLayout();
    setContent(mainLayout);/*from www  .  j  a  v  a 2 s. com*/
    setSizeFull();
    mainLayout.setSizeFull();
    setCaption("Invient Charts");

    HorizontalLayout infoBar = new HorizontalLayout();
    mainLayout.addComponent(infoBar);
    infoBar.setHeight("50px");
    infoBar.setWidth("100%");
    Label lblAppTitle = new Label("Demo Gallery for Invient Charts");
    lblAppTitle.setSizeFull();
    lblAppTitle.setStyleName("v-label-app-title");
    infoBar.addComponent(lblAppTitle);

    mainSplit = new HorizontalSplitPanel();
    mainSplit.setSizeFull();
    mainLayout.addComponent(mainSplit);
    mainLayout.setExpandRatio(mainSplit, 1);

    leftLayout = new VerticalLayout();
    leftLayout.setSpacing(true);
    mainSplit.setFirstComponent(leftLayout);

    rightLayout = new VerticalLayout();
    rightLayout.setSpacing(true);
    rightLayout.setMargin(true);
    mainSplit.setSecondComponent(rightLayout);

    mainSplit.setSplitPosition(200, Sizeable.UNITS_PIXELS);

    navTree = createChartsTree();
    leftLayout.addComponent(navTree);

    eventLog.setReadOnly(true);
    eventLog.setStyleName("v-textarea-chart-events-log");
    eventLog.setSizeFull();
    eventLog.setHeight("200px");
    setTheme("chartdemo");

}

From source file:com.jiangyifen.ec2.ui.mgr.system.tabsheet.DynQueueMemberManagement.java

/**
 * ??("?")/*from   w  ww .ja v a 2 s  . c  om*/
 * return 
 */
private VerticalLayout createMiddleComponents() {
    VerticalLayout operatorVLayout = new VerticalLayout();
    operatorVLayout.setSpacing(true);
    operatorVLayout.setSizeFull();

    // ??
    operatorVLayout.addComponent(new Label("&nbsp&nbsp", Label.CONTENT_XHTML));
    operatorVLayout.addComponent(new Label("&nbsp&nbsp", Label.CONTENT_XHTML));
    operatorVLayout.addComponent(new Label("&nbsp&nbsp", Label.CONTENT_XHTML));

    // 
    addAll = new Button(">>>", this);
    operatorVLayout.addComponent(addAll);
    operatorVLayout.setComponentAlignment(addAll, Alignment.MIDDLE_CENTER);

    add = new Button(">>", this);
    operatorVLayout.addComponent(add);
    operatorVLayout.setComponentAlignment(add, Alignment.MIDDLE_CENTER);

    remove = new Button("<<", this);
    operatorVLayout.addComponent(remove);
    operatorVLayout.setComponentAlignment(remove, Alignment.MIDDLE_CENTER);

    removeAll = new Button("<<<", this);
    operatorVLayout.addComponent(removeAll);
    operatorVLayout.setComponentAlignment(removeAll, Alignment.MIDDLE_CENTER);

    // ??
    operatorVLayout.addComponent(new Label("&nbsp&nbsp", Label.CONTENT_XHTML));
    operatorVLayout.addComponent(new Label("&nbsp&nbsp", Label.CONTENT_XHTML));

    return operatorVLayout;
}

From source file:com.jiangyifen.ec2.ui.mgr.system.tabsheet.DynQueueMemberManagement.java

/**
 *  ??/*from ww  w  .j a  v a 2s .c  om*/
 */
private void createPriorityConfirmWindow() {
    globalPriorityConfirmWindow = new Window("?");
    globalPriorityConfirmWindow.center();
    globalPriorityConfirmWindow.setWidth("300px");
    globalPriorityConfirmWindow.setModal(true);
    globalPriorityConfirmWindow.setResizable(false);

    VerticalLayout windowContent = new VerticalLayout();
    windowContent.setSizeFull();
    windowContent.setMargin(true);
    windowContent.setSpacing(true);
    globalPriorityConfirmWindow.setContent(windowContent);

    noticeInPriorityWindow = new Label("", Label.CONTENT_XHTML);
    windowContent.addComponent(noticeInPriorityWindow);

    HorizontalLayout buttonsHLayout = new HorizontalLayout();
    buttonsHLayout.setSpacing(true);
    windowContent.addComponent(buttonsHLayout);

    submit = new Button(" ", this);
    abolish = new Button("? ", this);
    abolish.setStyleName("default");
    buttonsHLayout.addComponent(submit);
    buttonsHLayout.addComponent(abolish);
}

From source file:com.jiangyifen.ec2.ui.mgr.system.tabsheet.MgrPhone2PhoneSettingView.java

/**
 * ??("?")//from  www.  ja v  a 2 s .  c  om
 * return 
 */
private VerticalLayout createMiddleComponents() {
    VerticalLayout operatorVLayout = new VerticalLayout();
    operatorVLayout.setSpacing(true);
    operatorVLayout.setSizeFull();

    // ??
    operatorVLayout.addComponent(new Label("&nbsp&nbsp", Label.CONTENT_XHTML));
    operatorVLayout.addComponent(new Label("&nbsp&nbsp", Label.CONTENT_XHTML));
    operatorVLayout.addComponent(new Label("&nbsp&nbsp", Label.CONTENT_XHTML));

    // 
    addAll = new Button(">>>", this);
    addAll.setEnabled(false);
    operatorVLayout.addComponent(addAll);
    operatorVLayout.setComponentAlignment(addAll, Alignment.MIDDLE_CENTER);

    add = new Button(">>", this);
    add.setEnabled(false);
    operatorVLayout.addComponent(add);
    operatorVLayout.setComponentAlignment(add, Alignment.MIDDLE_CENTER);

    remove = new Button("<<", this);
    remove.setEnabled(false);
    operatorVLayout.addComponent(remove);
    operatorVLayout.setComponentAlignment(remove, Alignment.MIDDLE_CENTER);

    removeAll = new Button("<<<", this);
    removeAll.setEnabled(false);
    operatorVLayout.addComponent(removeAll);
    operatorVLayout.setComponentAlignment(removeAll, Alignment.MIDDLE_CENTER);

    // ??
    operatorVLayout.addComponent(new Label("&nbsp&nbsp", Label.CONTENT_XHTML));
    operatorVLayout.addComponent(new Label("&nbsp&nbsp", Label.CONTENT_XHTML));

    return operatorVLayout;
}

From source file:com.karus.EnglishCheckerUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {

    VaadinServiceSession.getCurrent().setErrorHandler(this);
    setSizeFull();//from   ww  w.j  a  v  a 2s.  c  o  m

    try {
        DiscoveryNavigator navigator = new DiscoveryNavigator(this, getContent());
        navigator.navigateTo(UI.getCurrent().getPage().getFragment());
    }
    /**
     * Exception on page load
     */
    catch (AccessDeniedException e) {
        Label label = new Label(e.getMessage());
        label.setWidth(-1, Unit.PERCENTAGE);

        Link goToMain = new Link("Go to login page", new ExternalResource("/login/"));

        VerticalLayout layout = new VerticalLayout();
        layout.addComponent(label);
        layout.addComponent(goToMain);
        layout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);
        layout.setComponentAlignment(goToMain, Alignment.MIDDLE_CENTER);

        VerticalLayout mainLayout = new VerticalLayout();
        mainLayout.setSizeFull();
        mainLayout.addComponent(layout);
        mainLayout.setComponentAlignment(layout, Alignment.MIDDLE_CENTER);

        setContent(mainLayout);
        Notification.show(e.getMessage(), Notification.Type.ERROR_MESSAGE);
    }
}

From source file:com.klwork.explorer.ui.base.AbstractMainGridPage.java

License:Apache License

protected void addSelectComponent() {
    VerticalLayout vLayout = new VerticalLayout();
    vLayout.addStyleName("sidebar");
    vLayout.addStyleName("menu");
    vLayout.addStyleName("tasks");
    vLayout.setMargin(new MarginInfo(true, false, false, false));
    vLayout.setSizeFull();

    HorizontalLayout tableHeadLayout = createSelectHead();
    vLayout.addComponent(tableHeadLayout);
    vLayout.setComponentAlignment(tableHeadLayout, Alignment.MIDDLE_LEFT);

    AbstractSelect select = createSelectComponent();
    vLayout.addComponent(select);/*from   w  ww. ja va 2s .  c om*/
    vLayout.setExpandRatio(select, 1.0f);
    if (select != null) {
        grid.addComponent(vLayout, 1, 0);
    }
}