Example usage for com.vaadin.ui Button setSizeUndefined

List of usage examples for com.vaadin.ui Button setSizeUndefined

Introduction

In this page you can find the example usage for com.vaadin.ui Button setSizeUndefined.

Prototype

@Override
    public void setSizeUndefined() 

Source Link

Usage

From source file:annis.gui.CitationWindow.java

License:Apache License

public CitationWindow(String query, Set<String> corpora, int contextLeft, int contextRight) {
    super("Citation");

    VerticalLayout wLayout = new VerticalLayout();
    setContent(wLayout);//from   w  w w.  j a  v a  2s.c  o  m
    wLayout.setSizeFull();

    String url = Helper.generateCitation(query, corpora, contextLeft, contextRight, null, 0, 10);

    TextArea txtCitation = new TextArea();

    txtCitation.setWidth("100%");
    txtCitation.setHeight("100%");
    txtCitation.addStyleName(ChameleonTheme.TEXTFIELD_BIG);
    txtCitation.addStyleName("citation");
    txtCitation.setValue(url);
    txtCitation.setWordwrap(true);
    txtCitation.setReadOnly(true);

    wLayout.addComponent(txtCitation);

    Button btOk = new Button("OK");
    btOk.addListener((Button.ClickListener) this);
    btOk.setSizeUndefined();

    wLayout.addComponent(btOk);

    wLayout.setExpandRatio(txtCitation, 1.0f);
    wLayout.setComponentAlignment(btOk, Alignment.BOTTOM_CENTER);

    setWidth("400px");
    setHeight("200px");

}

From source file:annis.gui.ShareQueryReferenceWindow.java

License:Apache License

public ShareQueryReferenceWindow(DisplayedResultQuery query, boolean shorten) {
    super("Query reference link");

    VerticalLayout wLayout = new VerticalLayout();
    setContent(wLayout);//from  ww w  .  ja v  a 2s. c o  m
    wLayout.setSizeFull();
    wLayout.setMargin(true);

    Label lblInfo = new Label(
            "<p style=\"font-size: 18px\" >" + "<strong>Share your query:</strong>&nbsp;"
                    + "1.&nbsp;Copy the generated link 2.&nbsp;Share this link with your peers. " + "</p>",
            ContentMode.HTML);
    wLayout.addComponent(lblInfo);
    wLayout.setExpandRatio(lblInfo, 0.0f);

    String shortURL = "ERROR";
    if (query != null) {
        URI url = Helper.generateCitation(query.getQuery(), query.getCorpora(), query.getLeftContext(),
                query.getRightContext(), query.getSegmentation(), query.getBaseText(), query.getOffset(),
                query.getLimit(), query.getOrder(), query.getSelectedMatches());

        if (shorten) {
            shortURL = Helper.shortenURL(url);
        } else {
            shortURL = url.toASCIIString();
        }
    }

    TextArea txtCitation = new TextArea();

    txtCitation.setWidth("100%");
    txtCitation.setHeight("100%");
    txtCitation.addStyleName(ValoTheme.TEXTFIELD_LARGE);
    txtCitation.addStyleName("shared-text");
    txtCitation.setValue(shortURL);
    txtCitation.setWordwrap(true);
    txtCitation.setReadOnly(true);

    wLayout.addComponent(txtCitation);

    Button btClose = new Button("Close");
    btClose.addClickListener((Button.ClickListener) this);
    btClose.setSizeUndefined();

    wLayout.addComponent(btClose);

    wLayout.setExpandRatio(txtCitation, 1.0f);
    wLayout.setComponentAlignment(btClose, Alignment.BOTTOM_CENTER);

    setWidth("400px");
    setHeight("300px");

}

From source file:annis.gui.ShareSingleMatchGenerator.java

License:Apache License

public ShareSingleMatchGenerator(List<ResolverEntry> visualizers, Match match, PagedResultQuery query,
        String segmentation, PluginSystem ps) {
    this.match = match;
    this.query = query;
    this.segmentation = segmentation;
    this.ps = ps;

    setResizeLazy(true);/*from   www . j av a  2  s .  c  o m*/

    directURL = new ObjectProperty<>("");
    iframeCode = new ObjectProperty<>("");

    visContainer = new BeanItemContainer<>(ResolverEntry.class);
    visContainer.addAll(visualizers);

    txtDirectURL = new TextArea(directURL);
    txtDirectURL.setCaption("Link for publications");
    txtDirectURL.setWidth("100%");
    txtDirectURL.setHeight("-1px");
    txtDirectURL.addStyleName(ValoTheme.TEXTFIELD_LARGE);
    txtDirectURL.addStyleName("shared-text");
    txtDirectURL.setWordwrap(true);
    txtDirectURL.setReadOnly(true);

    txtIFrameCode = new TextArea(iframeCode);
    txtIFrameCode.setCaption("Code for embedding visualization into web page");
    txtIFrameCode.setWidth("100%");
    txtIFrameCode.setHeight("-1px");
    txtIFrameCode.addStyleName(ValoTheme.TEXTFIELD_LARGE);
    txtIFrameCode.addStyleName("shared-text");
    txtIFrameCode.setWordwrap(true);
    txtIFrameCode.setReadOnly(true);

    preview = new BrowserFrame();
    preview.setCaption("Preview");
    preview.addStyleName("shared-text");
    preview.setSizeFull();

    generatedLinks = new VerticalLayout(txtDirectURL, txtIFrameCode, preview);
    generatedLinks.setComponentAlignment(txtDirectURL, Alignment.TOP_LEFT);
    generatedLinks.setComponentAlignment(txtIFrameCode, Alignment.TOP_LEFT);
    generatedLinks.setExpandRatio(preview, 1.0f);

    visSelector = new Grid(visContainer);
    visSelector.setCaption("Select visualization");
    visSelector.setHeight("100%");
    visSelector.setColumns("displayName");
    visSelector.setSelectionMode(Grid.SelectionMode.SINGLE);
    visSelector.addSelectionListener(ShareSingleMatchGenerator.this);
    visSelector.select(visContainer.getIdByIndex(0));
    visSelector.setWidth("300px");
    visSelector.getColumn("displayName").setSortable(false);

    generatedLinks.setSizeFull();

    Label infoText = new Label(
            "<p style=\"font-size: 18px\" >" + "<strong>Share your match:</strong>&nbsp;"
                    + "1.&nbsp;Choose the visualization to share. 2.&nbsp;Copy the generated link or code. "
                    + "3.&nbsp;Share this link with your peers or include the code in your website. " + "</p>",
            ContentMode.HTML);

    HorizontalLayout hLayout = new HorizontalLayout(visSelector, generatedLinks);
    hLayout.setSizeFull();
    hLayout.setSpacing(true);
    hLayout.setExpandRatio(generatedLinks, 1.0f);

    Button btClose = new Button("Close");
    btClose.setSizeUndefined();
    btClose.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            getUI().removeWindow(ShareSingleMatchGenerator.this);
        }
    });

    layout = new VerticalLayout(infoText, hLayout, btClose);
    layout.setSizeFull();
    layout.setExpandRatio(hLayout, 1.0f);
    layout.setComponentAlignment(btClose, Alignment.MIDDLE_CENTER);

    setContent(layout);
}

From source file:com.esofthead.mycollab.module.crm.view.account.AccountCaseListComp.java

License:Open Source License

@Override
protected Component generateTopControls() {
    HorizontalLayout controlsBtnWrap = new HorizontalLayout();
    controlsBtnWrap.setWidth("100%");

    HorizontalLayout notesWrap = new HorizontalLayout();
    notesWrap.setWidth("100%");
    notesWrap.setSpacing(true);/* w w w  .  j ava  2  s .  c om*/
    Label noteLbl = new Label("Note: ");
    noteLbl.setSizeUndefined();
    noteLbl.setStyleName("list-note-lbl");
    notesWrap.addComponent(noteLbl);

    CssLayout noteBlock = new CssLayout();
    noteBlock.setWidth("100%");
    noteBlock.setStyleName("list-note-block");
    for (int i = 0; i < CrmDataTypeFactory.getCasesStatusList().length; i++) {
        Label note = new Label(CrmDataTypeFactory.getCasesStatusList()[i]);
        note.setStyleName("note-label");
        note.addStyleName(colorsMap.get(CrmDataTypeFactory.getCasesStatusList()[i]));
        note.setSizeUndefined();

        noteBlock.addComponent(note);
    }
    notesWrap.addComponent(noteBlock);
    notesWrap.setExpandRatio(noteBlock, 1.0f);

    controlsBtnWrap.addComponent(notesWrap);

    controlsBtnWrap.setWidth("100%");
    final Button createBtn = new Button();
    createBtn.setSizeUndefined();
    createBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_CASE));
    createBtn.addStyleName(UIConstants.THEME_GREEN_LINK);
    createBtn.setCaption(AppContext.getMessage(CaseI18nEnum.BUTTON_NEW_CASE));
    createBtn.setIcon(FontAwesome.PLUS);
    createBtn.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = -8725970955325733072L;

        @Override
        public void buttonClick(final Button.ClickEvent event) {
            fireNewRelatedItem("");
        }
    });

    controlsBtnWrap.addComponent(createBtn);
    controlsBtnWrap.setComponentAlignment(createBtn, Alignment.MIDDLE_RIGHT);
    return controlsBtnWrap;
}

From source file:com.esofthead.mycollab.module.crm.view.account.AccountOpportunityListComp.java

License:Open Source License

@Override
protected Component generateTopControls() {
    HorizontalLayout controlsBtnWrap = new HorizontalLayout();
    controlsBtnWrap.setWidth("100%");

    HorizontalLayout notesWrap = new HorizontalLayout();
    notesWrap.setWidth("100%");
    notesWrap.setSpacing(true);/*  w  ww .j a  va  2s.c om*/
    Label noteLbl = new Label("Note: ");
    noteLbl.setSizeUndefined();
    noteLbl.setStyleName("list-note-lbl");
    notesWrap.addComponent(noteLbl);

    CssLayout noteBlock = new CssLayout();
    noteBlock.setWidth("100%");
    noteBlock.setStyleName("list-note-block");
    for (int i = 0; i < CrmDataTypeFactory.getOpportunitySalesStageList().length; i++) {
        Label note = new Label(CrmDataTypeFactory.getOpportunitySalesStageList()[i]);
        note.setStyleName("note-label");
        note.addStyleName(colormap.get(CrmDataTypeFactory.getOpportunitySalesStageList()[i]));
        note.setSizeUndefined();

        noteBlock.addComponent(note);
    }
    notesWrap.addComponent(noteBlock);
    notesWrap.setExpandRatio(noteBlock, 1.0f);

    controlsBtnWrap.addComponent(notesWrap);

    controlsBtnWrap.setWidth("100%");
    final Button createBtn = new Button(AppContext.getMessage(OpportunityI18nEnum.BUTTON_NEW_OPPORTUNITY),
            new Button.ClickListener() {
                private static final long serialVersionUID = -8101659779838108951L;

                @Override
                public void buttonClick(final Button.ClickEvent event) {
                    fireNewRelatedItem("");
                }
            });
    createBtn.setSizeUndefined();
    createBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_OPPORTUNITY));
    createBtn.addStyleName(UIConstants.THEME_GREEN_LINK);
    createBtn.setIcon(FontAwesome.PLUS);

    controlsBtnWrap.addComponent(createBtn);
    controlsBtnWrap.setComponentAlignment(createBtn, Alignment.MIDDLE_RIGHT);
    return controlsBtnWrap;
}

From source file:com.expressui.core.view.form.ResultsConnectedEntityForm.java

License:Open Source License

private HorizontalLayout createNavigationFormLayout() {
    HorizontalLayout navigationFormLayout = new HorizontalLayout();
    String id = StringUtil.generateDebugId("e", this, navigationFormLayout, "navigationFormLayout");
    navigationFormLayout.setDebugId(id);
    navigationFormLayout.setSizeUndefined();

    VerticalLayout previousButtonLayout = new VerticalLayout();
    id = StringUtil.generateDebugId("e", this, previousButtonLayout, "previousButtonLayout");
    previousButtonLayout.setDebugId(id);

    previousButtonLayout.setSizeUndefined();
    previousButtonLayout.setMargin(false);
    previousButtonLayout.setSpacing(false);
    Label spaceLabel = new Label("</br></br></br>", Label.CONTENT_XHTML);
    spaceLabel.setSizeUndefined();/*  w  ww  .j av a 2s  .c o  m*/
    previousButtonLayout.addComponent(spaceLabel);

    Button previousButton = new Button(null, this, "previousItem");
    previousButton.setDescription(entityForm.uiMessageSource.getToolTip("entityForm.previous.toolTip"));
    previousButton.setSizeUndefined();
    previousButton.addStyleName("borderless");
    previousButton.setIcon(new ThemeResource("../expressui/icons/16/previous.png"));

    if (entityForm.getViewableToManyRelationships().size() == 0) {
        HorizontalLayout previousButtonHorizontalLayout = new HorizontalLayout();
        id = StringUtil.generateDebugId("e", this, previousButtonHorizontalLayout,
                "previousButtonHorizontalLayout");
        previousButtonHorizontalLayout.setDebugId(id);
        previousButtonHorizontalLayout.setSizeUndefined();
        Label horizontalSpaceLabel = new Label("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", Label.CONTENT_XHTML);
        horizontalSpaceLabel.setSizeUndefined();
        previousButtonHorizontalLayout.addComponent(previousButton);
        previousButtonHorizontalLayout.addComponent(horizontalSpaceLabel);
        previousButtonLayout.addComponent(previousButtonHorizontalLayout);
    } else {
        previousButtonLayout.addComponent(previousButton);
    }

    navigationFormLayout.addComponent(previousButtonLayout);
    navigationFormLayout.setComponentAlignment(previousButtonLayout, Alignment.TOP_LEFT);

    navigationFormLayout.addComponent(entityForm);

    VerticalLayout nextButtonLayout = new VerticalLayout();
    id = StringUtil.generateDebugId("e", this, nextButtonLayout, "nextButtonLayout");
    nextButtonLayout.setDebugId(id);
    nextButtonLayout.setSizeUndefined();
    nextButtonLayout.setMargin(false);
    nextButtonLayout.setSpacing(false);
    spaceLabel = new Label("</br></br></br>", Label.CONTENT_XHTML);
    spaceLabel.setSizeUndefined();
    previousButtonLayout.addComponent(spaceLabel);
    nextButtonLayout.addComponent(spaceLabel);

    Button nextButton = new Button(null, this, "nextItem");
    nextButton.setDescription(entityForm.uiMessageSource.getToolTip("entityForm.next.toolTip"));
    nextButton.setSizeUndefined();
    nextButton.addStyleName("borderless");
    nextButton.setIcon(new ThemeResource("../expressui/icons/16/next.png"));

    HorizontalLayout nextButtonHorizontalLayout = new HorizontalLayout();
    id = StringUtil.generateDebugId("e", this, nextButtonHorizontalLayout, "nextButtonHorizontalLayout");
    nextButtonHorizontalLayout.setDebugId(id);
    nextButtonHorizontalLayout.setSizeUndefined();
    Label horizontalSpaceLabel = new Label("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", Label.CONTENT_XHTML);
    horizontalSpaceLabel.setSizeUndefined();
    nextButtonHorizontalLayout.addComponent(horizontalSpaceLabel);
    nextButtonHorizontalLayout.addComponent(nextButton);

    nextButtonLayout.addComponent(nextButtonHorizontalLayout);
    navigationFormLayout.addComponent(nextButtonLayout);
    navigationFormLayout.setComponentAlignment(nextButtonLayout, Alignment.TOP_RIGHT);

    navigationFormLayout.setSpacing(false);
    navigationFormLayout.setMargin(false);

    return navigationFormLayout;
}

From source file:com.expressui.core.view.results.Results.java

License:Open Source License

private HorizontalLayout createNavigationLine() {

    HorizontalLayout resultCountDisplay = new HorizontalLayout();
    setDebugId(resultCountDisplay, "resultCountDisplay");
    firstResultTextField = createFirstResultTextField();
    firstResultTextField.addStyleName("small");
    firstResultTextField.setSizeUndefined();
    resultCountDisplay.addComponent(firstResultTextField);
    resultCountLabel = new Label("", Label.CONTENT_XHTML);
    resultCountLabel.setSizeUndefined();
    resultCountLabel.addStyleName("small");
    resultCountDisplay.addComponent(resultCountLabel);

    Label spaceLabel = new Label(" &nbsp; ", Label.CONTENT_XHTML);
    spaceLabel.setSizeUndefined();/*from   ww  w.j  a va  2 s.c  o m*/
    resultCountDisplay.addComponent(spaceLabel);

    Button refreshButton = new Button(null, getResultsTable(), "refresh");
    refreshButton.setDescription(uiMessageSource.getToolTip("results.refresh.toolTip"));
    refreshButton.setSizeUndefined();
    refreshButton.addStyleName("borderless");
    refreshButton.setIcon(new ThemeResource("../expressui/icons/16/refresh-blue.png"));
    resultCountDisplay.addComponent(refreshButton);

    HorizontalLayout navigationButtons = new HorizontalLayout();
    setDebugId(navigationButtons, "navigationButtons");
    navigationButtons.setMargin(false, true, false, false);
    navigationButtons.setSpacing(true);

    String perPageText = uiMessageSource.getMessage("results.pageSize");
    pageSizeMenu = new Select();
    pageSizeMenu.addStyleName("small");
    List<Integer> pageSizeOptions = applicationProperties.getPageSizeOptions();
    for (Integer pageSizeOption : pageSizeOptions) {
        pageSizeMenu.addItem(pageSizeOption);
        pageSizeMenu.setItemCaption(pageSizeOption, pageSizeOption + " " + perPageText);
    }
    pageSizeMenu.setFilteringMode(Select.FILTERINGMODE_OFF);
    pageSizeMenu.setNewItemsAllowed(false);
    pageSizeMenu.setNullSelectionAllowed(false);
    pageSizeMenu.setImmediate(true);
    pageSizeMenu.setWidth(8, UNITS_EM);
    navigationButtons.addComponent(pageSizeMenu);

    firstButton = new Button(null, getResultsTable(), "firstPage");
    firstButton.setDescription(uiMessageSource.getToolTip("results.first.toolTip"));
    firstButton.setSizeUndefined();
    firstButton.addStyleName("borderless");
    firstButton.setIcon(new ThemeResource("../expressui/icons/16/first.png"));
    navigationButtons.addComponent(firstButton);

    previousButton = new Button(null, getResultsTable(), "previousPage");
    previousButton.setDescription(uiMessageSource.getToolTip("results.previous.toolTip"));
    previousButton.setSizeUndefined();
    previousButton.addStyleName("borderless");
    previousButton.setIcon(new ThemeResource("../expressui/icons/16/previous.png"));
    navigationButtons.addComponent(previousButton);

    nextButton = new Button(null, getResultsTable(), "nextPage");
    nextButton.setDescription(uiMessageSource.getToolTip("results.next.toolTip"));
    nextButton.setSizeUndefined();
    nextButton.addStyleName("borderless");
    nextButton.setIcon(new ThemeResource("../expressui/icons/16/next.png"));
    navigationButtons.addComponent(nextButton);

    lastButton = new Button(null, getResultsTable(), "lastPage");
    lastButton.setDescription(uiMessageSource.getToolTip("results.last.toolTip"));
    lastButton.setSizeUndefined();
    lastButton.addStyleName("borderless");
    lastButton.setIcon(new ThemeResource("../expressui/icons/16/last.png"));
    navigationButtons.addComponent(lastButton);

    excelButton = new Button(null, this, "openExportForm");
    excelButton.setDescription(uiMessageSource.getToolTip("results.excel.toolTip"));
    excelButton.setSizeUndefined();
    excelButton.addStyleName("borderless");
    excelButton.setIcon(new ThemeResource("../expressui/icons/16/excel.bmp"));
    navigationButtons.addComponent(excelButton);
    exportForm.setExportButtonListener(this, "exportToExcel");

    HorizontalLayout navigationLine = new HorizontalLayout();
    setDebugId(navigationLine, "navigationLine");
    navigationLine.setSizeUndefined();
    navigationLine.setMargin(true, false, true, false);

    navigationLine.addComponent(resultCountDisplay);
    navigationLine.setComponentAlignment(resultCountDisplay, Alignment.BOTTOM_LEFT);

    spaceLabel = new Label("", Label.CONTENT_XHTML);
    spaceLabel.setWidth(2, Sizeable.UNITS_EM);
    navigationLine.addComponent(spaceLabel);

    navigationLine.addComponent(navigationButtons);
    navigationLine.setComponentAlignment(navigationButtons, Alignment.BOTTOM_RIGHT);

    return navigationLine;
}

From source file:com.github.peholmst.mvp4vaadin.navigation.ui.NavigationBar.java

License:Apache License

/**
 * Creates and adds a new button to the navigation bar. Listeners etc. will
 * be added by the {@link #addBreadcrumbForView(ControllableView)} method.
 * //from w  w  w  .  j  a va2 s . c o m
 * @param viewName
 *            the name of the view to show on the button.
 * @return the added button.
 */
protected Button addViewButton(String viewName) {
    final Button btn = new Button(viewName);
    btn.setStyleName(BaseTheme.BUTTON_LINK);
    btn.setSizeUndefined();
    btn.addStyleName(BREADCRUMB_ELEMENT);
    addComponent(btn);
    // setComponentAlignment(btn, Alignment.MIDDLE_LEFT);
    return btn;
}

From source file:com.haulmont.cuba.web.sys.WindowBreadCrumbs.java

License:Apache License

public void update() {
    AppUI ui = AppUI.getCurrent();/* w w  w.  j  av a  2  s .co m*/
    boolean isTestMode = ui.isTestMode();

    linksLayout.removeAllComponents();
    btn2win.clear();
    for (Iterator<Window> it = windows.iterator(); it.hasNext();) {
        Window window = it.next();
        Button button = new CubaButton(StringUtils.trimToEmpty(window.getCaption()), new BtnClickListener());
        button.setSizeUndefined();
        button.setStyleName(BaseTheme.BUTTON_LINK);
        button.setTabIndex(-1);

        if (isTestMode) {
            button.setCubaId("breadCrubms_Button_" + window.getId());
            button.setId(ui.getTestIdManager().getTestId("breadCrubms_Button_" + window.getId()));
        }

        btn2win.put(button, window);

        if (it.hasNext()) {
            linksLayout.addComponent(button);

            Label separatorLab = new Label("&nbsp;&gt;&nbsp;");
            separatorLab.setStyleName("c-breadcrumbs-separator");
            separatorLab.setSizeUndefined();
            separatorLab.setContentMode(ContentMode.HTML);
            linksLayout.addComponent(separatorLab);
        } else {
            Label captionLabel = new Label(window.getCaption());
            captionLabel.setStyleName("c-breadcrumbs-win-caption");
            captionLabel.setSizeUndefined();
            linksLayout.addComponent(captionLabel);

            this.label = captionLabel;
        }
    }
}

From source file:com.purebred.core.view.Results.java

License:Open Source License

private HorizontalLayout createNavigationLine() {

    HorizontalLayout resultCountDisplay = new HorizontalLayout();
    Label showingLabel = new Label(uiMessageSource.getMessage("entityResults.showing") + " &nbsp ",
            Label.CONTENT_XHTML);
    showingLabel.setSizeUndefined();/*ww w.  j av a 2 s . c  om*/
    showingLabel.addStyleName("small");
    resultCountDisplay.addComponent(showingLabel);
    firstResultTextField = createFirstResultTextField();
    firstResultTextField.addStyleName("small");
    firstResultTextField.setSizeUndefined();
    resultCountDisplay.addComponent(firstResultTextField);
    resultCountLabel = new Label("", Label.CONTENT_XHTML);
    resultCountLabel.setSizeUndefined();
    resultCountLabel.addStyleName("small");
    resultCountDisplay.addComponent(resultCountLabel);

    Label spaceLabel = new Label(" &nbsp; ", Label.CONTENT_XHTML);
    spaceLabel.setSizeUndefined();
    resultCountDisplay.addComponent(spaceLabel);

    Button refreshButton = new Button(null, getResultsTable(), "refresh");
    refreshButton.setDescription(uiMessageSource.getMessage("entityResults.refresh.description"));
    refreshButton.setSizeUndefined();
    refreshButton.addStyleName("borderless");
    refreshButton.setIcon(new ThemeResource("icons/16/refresh-blue.png"));
    resultCountDisplay.addComponent(refreshButton);

    HorizontalLayout navigationButtons = new HorizontalLayout();
    navigationButtons.setMargin(false, true, false, false);
    navigationButtons.setSpacing(true);

    String perPageText = uiMessageSource.getMessage("entityResults.pageSize");
    pageSizeMenu = new Select();
    pageSizeMenu.addStyleName("small");
    pageSizeMenu.addItem(5);
    pageSizeMenu.setItemCaption(5, "5 " + perPageText);
    pageSizeMenu.addItem(10);
    pageSizeMenu.setItemCaption(10, "10 " + perPageText);
    pageSizeMenu.addItem(25);
    pageSizeMenu.setItemCaption(25, "25 " + perPageText);
    pageSizeMenu.addItem(50);
    pageSizeMenu.setItemCaption(50, "50 " + perPageText);
    pageSizeMenu.addItem(100);
    pageSizeMenu.setItemCaption(100, "100 " + perPageText);
    pageSizeMenu.setFilteringMode(Select.FILTERINGMODE_OFF);
    pageSizeMenu.setNewItemsAllowed(false);
    pageSizeMenu.setNullSelectionAllowed(false);
    pageSizeMenu.setImmediate(true);
    pageSizeMenu.setWidth(8, UNITS_EM);
    navigationButtons.addComponent(pageSizeMenu);

    firstButton = new Button(null, getResultsTable(), "firstPage");
    firstButton.setDescription(uiMessageSource.getMessage("entityResults.first.description"));
    firstButton.setSizeUndefined();
    firstButton.addStyleName("borderless");
    firstButton.setIcon(new ThemeResource("icons/16/first.png"));
    navigationButtons.addComponent(firstButton);

    previousButton = new Button(null, getResultsTable(), "previousPage");
    previousButton.setDescription(uiMessageSource.getMessage("entityResults.previous.description"));
    previousButton.setSizeUndefined();
    previousButton.addStyleName("borderless");
    previousButton.setIcon(new ThemeResource("icons/16/previous.png"));
    navigationButtons.addComponent(previousButton);

    nextButton = new Button(null, getResultsTable(), "nextPage");
    nextButton.setDescription(uiMessageSource.getMessage("entityResults.next.description"));
    nextButton.setSizeUndefined();
    nextButton.addStyleName("borderless");
    nextButton.setIcon(new ThemeResource("icons/16/next.png"));
    navigationButtons.addComponent(nextButton);

    lastButton = new Button(null, getResultsTable(), "lastPage");
    lastButton.setDescription(uiMessageSource.getMessage("entityResults.last.description"));
    lastButton.setSizeUndefined();
    lastButton.addStyleName("borderless");
    lastButton.setIcon(new ThemeResource("icons/16/last.png"));
    navigationButtons.addComponent(lastButton);

    HorizontalLayout navigationLine = new HorizontalLayout();
    navigationLine.setWidth("100%");
    navigationLine.setMargin(true, true, true, false);

    navigationLine.addComponent(resultCountDisplay);
    navigationLine.setComponentAlignment(resultCountDisplay, Alignment.BOTTOM_LEFT);

    navigationLine.addComponent(navigationButtons);
    navigationLine.setComponentAlignment(navigationButtons, Alignment.BOTTOM_RIGHT);

    return navigationLine;
}