Example usage for com.vaadin.ui Panel setContent

List of usage examples for com.vaadin.ui Panel setContent

Introduction

In this page you can find the example usage for com.vaadin.ui Panel setContent.

Prototype

@Override
public void setContent(Component content) 

Source Link

Document

Sets the content of this container.

Usage

From source file:com.etest.view.testbank.CellCaseMainUI.java

Panel getCellCasePanel() {
    Panel panel = new Panel();
    panel.setWidth("100%");

    populateDataTable();/*from w w w . j a  v  a 2  s  .  com*/
    panel.setContent(table);
    return panel;
}

From source file:com.etest.view.testbank.cellitem.CellCaseItemWindow.java

FormLayout buildForms() {
    FormLayout form = new FormLayout();
    form.setWidth("100%");
    form.setMargin(true);/*from www .ja  v  a  2 s  .c o m*/
    form.setSpacing(true);

    CellCase cc = ccs.getCellCaseById(getCellCaseId());
    Panel panel = new Panel();
    panel.setWidth("100%");
    panel.addStyleName(ValoTheme.PANEL_BORDERLESS);

    Label caseLabel = new Label();
    caseLabel.setCaption("CASE: ");
    caseLabel.setStyleName("bold-font-style");
    caseLabel.setWidth("80px");

    Label caseTopic = new Label();
    caseTopic.setValue(caseLabel.getCaption() + cc.getCaseTopic());
    caseTopic.setContentMode(ContentMode.RAW);
    caseTopic.addStyleName("wrapline");

    panel.setContent(caseTopic);
    form.addComponent(panel);

    form.addComponent(table);

    HorizontalLayout v = new HorizontalLayout();
    v.setWidth("100%");

    Button create = new Button("CREATE NEW STEM");
    create.setWidthUndefined();
    create.addStyleName(ValoTheme.BUTTON_LINK);
    create.addStyleName(ValoTheme.BUTTON_TINY);
    create.addStyleName(ValoTheme.BUTTON_QUIET);
    create.addClickListener(modifyBtnClickListener);
    v.addComponent(create);
    v.setComponentAlignment(create, Alignment.MIDDLE_RIGHT);
    form.addComponent(v);

    return form;
}

From source file:com.etest.view.testbank.cellitem.ViewStemWindow.java

Panel getDataTablePanel() {
    Panel panel = new Panel();
    panel.addStyleName(ValoTheme.PANEL_BORDERLESS);

    populateDataTable();//from www .j  ava  2  s  .  com
    panel.setContent(table);

    return panel;
}

From source file:com.etest.view.tq.itemanalysis.FileUploadWindow.java

Panel itemAnalysisGridPanel() {
    grid = new ItemAnalysisDataGridProperties(getTqCoverageId(), getUpperGroupStudentNo(),
            getLowerGroupStudentNo(), tq.getCellItemIdByTQCoverageId(getTqCoverageId()),
            getStudentNoAndAnswer(), getGroupTotalForProportion());

    Panel panel = new Panel("ITEM ANALYSIS");
    panel.setWidth("100%");
    panel.setContent(grid);

    return panel;
}

From source file:com.etest.view.tq.itemanalysis.ProportionDataTable.java

Panel upperGroupStudentPanel() {
    Panel panel = new Panel("UPPER GROUP");
    panel.setWidth("100%");
    panel.setContent(upperGroupTable);

    return panel;
}

From source file:com.etest.view.tq.itemanalysis.ProportionDataTable.java

Panel lowerGroupStudentPanel() {
    Panel panel = new Panel("LOWER GROUP");
    panel.setWidth("100%");
    panel.setContent(lowerGroupTable);

    return panel;
}

From source file:com.example.bbs.vaadin.view.Labels.java

License:Apache License

public Labels() {
    setMargin(true);/* ww w  . j  a  va2 s  .  com*/
    addStyleName("content-labels");

    Label h1 = new Label("Labels");
    h1.addStyleName(ValoTheme.LABEL_H1);
    addComponent(h1);

    HorizontalLayout split = new HorizontalLayout();
    split.setWidth("100%");
    addComponent(split);

    VerticalLayout left = new VerticalLayout();
    left.setMargin(new MarginInfo(false, true, false, false));
    split.addComponent(left);

    Label huge = new Label("Huge type for display text.");
    huge.addStyleName(ValoTheme.LABEL_HUGE);
    left.addComponent(huge);

    Label large = new Label(
            "Large type for introductory text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    large.addStyleName(ValoTheme.LABEL_LARGE);
    left.addComponent(large);

    Label h2 = new Label("Subtitle");
    h2.addStyleName(ValoTheme.LABEL_H2);
    left.addComponent(h2);

    Label normal = new Label(
            "Normal type for plain text, with a <a href=\"https://vaadin.com\">regular link</a>. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.",
            ContentMode.HTML);
    left.addComponent(normal);

    Label h3 = new Label("Small Title");
    h3.addStyleName(ValoTheme.LABEL_H3);
    left.addComponent(h3);

    Label small = new Label(
            "Small type for additional text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    small.addStyleName(ValoTheme.LABEL_SMALL);
    left.addComponent(small);

    Label tiny = new Label("Tiny type for minor text.");
    tiny.addStyleName(ValoTheme.LABEL_TINY);
    left.addComponent(tiny);

    Label h4 = new Label("Section Title");
    h4.addStyleName(ValoTheme.LABEL_H4);
    left.addComponent(h4);

    normal = new Label(
            "Normal type for plain text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    left.addComponent(normal);

    Panel p = new Panel("Additional Label Styles");
    split.addComponent(p);

    VerticalLayout right = new VerticalLayout();
    right.setSpacing(true);
    right.setMargin(true);
    p.setContent(right);

    Label label = new Label(
            "Bold type for prominent text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    label.addStyleName(ValoTheme.LABEL_BOLD);
    right.addComponent(label);

    label = new Label(
            "Light type for subtle text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    label.addStyleName(ValoTheme.LABEL_LIGHT);
    right.addComponent(label);

    label = new Label(
            "Colored type for highlighted text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    label.addStyleName(ValoTheme.LABEL_COLORED);
    right.addComponent(label);

    label = new Label("A label for success");
    label.addStyleName(ValoTheme.LABEL_SUCCESS);
    right.addComponent(label);

    label = new Label("A label for failure");
    label.addStyleName(ValoTheme.LABEL_FAILURE);
    right.addComponent(label);

}

From source file:com.expressui.core.view.page.DashboardPage.java

License:Open Source License

/**
 * Adds a component to the dashboard.//from   www .java  2 s .com
 *
 * @param component   component to add
 * @param caption     caption to display above component
 * @param startRow    start row coordinate in Dashboard grid
 * @param startColumn start column coordinate in Dashboard grid
 * @param endRow      end row coordinate in Dashboard grid
 * @param endColumn   end column coordinate in Dashboard grid
 */
public void addComponent(Component component, String caption, int startRow, int startColumn, int endRow,
        int endColumn) {
    if (component instanceof TypedComponent && !((TypedComponent) component).isViewAllowed())
        return;

    Panel panel = new Panel(caption);
    panel.addStyleName(ChameleonTheme.PANEL_BUBBLE);
    HorizontalLayout panelLayout = new HorizontalLayout();
    panelLayout.setSizeUndefined();
    panel.setSizeUndefined();

    setWidthAndHeightIfNotNull(component);

    panel.setContent(panelLayout);
    panelLayout.setMargin(true);
    panelLayout.setSpacing(true);
    panelLayout.addComponent(component);
    int rows = Math.max(rootLayout.getRows() - 1, endRow);
    int columns = Math.max(rootLayout.getColumns() - 1, endColumn);

    if (rootLayout.getRows() < rows) {
        rootLayout.setRows(rows);
    }
    if (rootLayout.getColumns() < columns) {
        rootLayout.setColumns(columns);
    }

    removeComponent(startRow, startColumn);
    rootLayout.addComponent(panel, startColumn - 1, startRow - 1, endColumn - 1, endRow - 1);
}

From source file:com.foc.vaadin.FocWebApplication.java

License:Apache License

protected void init2(VaadinRequest request) {
    // Create the footer Layout with a simple Label
    VerticalLayout footerLayout = new VerticalLayout();
    {//w  ww.jav  a  2  s  .c  o  m
        footerLayout.addComponent(new Label("This is the footer always visible"));
        footerLayout.setHeight("-1px");
    }

    // Create the Body Panel that contains a VerticalLayout itself
    Panel panel = new Panel();
    {
        panel.setSizeFull();// Panel size is undefined
        final VerticalLayout panelLayout = new VerticalLayout();
        panelLayout.setSizeUndefined();// Panel Layout size is undefined
        panel.setContent(panelLayout);

        // Fill the panel layout with lots of labels to exceed the window height 
        for (int i = 0; i < 200; i++) {
            panelLayout.addComponent(new Label("Thank you for clicking"));
        }
    }

    // Put all in the the MainVerticalLayout
    final VerticalLayout mainVerticalLayout = new VerticalLayout();
    mainVerticalLayout.setSizeFull();// Main Layout is set to size Full so that it fills all the height
    mainVerticalLayout.addComponent(panel);
    mainVerticalLayout.addComponent(footerLayout);
    mainVerticalLayout.setExpandRatio(panel, 1);
    setContent(mainVerticalLayout);
}

From source file:com.github.mjvesa.herd.HerdIDE.java

License:Apache License

private Panel createMainPanel() {
    Panel p = new Panel();
    VerticalLayout vl = new VerticalLayout();
    vl.setSpacing(true);/*from w  w w  .j  av a  2  s .c  o  m*/
    p.setContent(vl);
    p.setSizeFull();
    return p;
}