Example usage for com.vaadin.ui HorizontalLayout HorizontalLayout

List of usage examples for com.vaadin.ui HorizontalLayout HorizontalLayout

Introduction

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

Prototype

public HorizontalLayout() 

Source Link

Document

Constructs an empty HorizontalLayout.

Usage

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("   ", Label.CONTENT_XHTML);
    spaceLabel.setSizeUndefined();//from w  w w  .j a v  a  2 s  .  com
    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.expressui.core.view.RootComponent.java

License:Open Source License

/**
 * Sets composition root of this component to a HorizontalLayout with margins and spacing.
 *//*from  www . ja  va  2s  . co  m*/
public HorizontalLayout createHorizontalLayout() {
    HorizontalLayout rootLayout = new HorizontalLayout();
    setDebugId(rootLayout, "rootLayout");
    rootLayout.setMargin(true);
    rootLayout.setSpacing(false);

    return rootLayout;
}

From source file:com.expressui.core.view.RootComponent.java

License:Open Source License

/**
 * Adds code popup button next to this component to the right.
 *
 * @param alignment alignment for button
 * @param classes   classes for displaying related source code and Javadoc
 *//*from w ww  .  ja v  a2 s . c om*/
protected void addCodePopupButtonIfEnabled(Alignment alignment, Class... classes) {
    if (isCodePopupEnabled()) {
        Component firstComponent = getCompositionRoot();
        AbstractOrderedLayout codePopupButtonLayout = new HorizontalLayout();
        codePopupButtonLayout.setMargin(false);
        setDebugId(codePopupButtonLayout, "codePopupButtonLayout");
        setCompositionRoot(codePopupButtonLayout);
        codePopupButtonLayout.addComponent(firstComponent);
        Button codePopupButton = codePopup.createPopupCodeButton(autoAddCodeClasses(classes));
        codePopupButtonLayout.addComponent(codePopupButton);
        codePopupButtonLayout.setComponentAlignment(codePopupButton, alignment);
    }
}

From source file:com.expressui.core.view.tomanyrelationship.AggregationRelationship.java

License:Open Source License

@PostConstruct
@Override//from w w  w  .j  ava  2 s  . c o  m
public void postConstruct() {
    super.postConstruct();

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

    addButton = new Button(uiMessageSource.getMessage("aggregationRelationship.add"), this, "add");
    addButton.setDescription(uiMessageSource.getToolTip("aggregationRelationship.add.toolTip"));
    addButton.setIcon(new ThemeResource("../expressui/icons/16/add.png"));
    addButton.addStyleName("small default");
    crudButtons.addComponent(addButton);

    removeButton = new Button(uiMessageSource.getMessage("aggregationRelationship.remove"), this, "remove");
    removeButton.setDescription(uiMessageSource.getToolTip("aggregationRelationship.remove.toolTip"));
    removeButton.setIcon(new ThemeResource("../expressui/icons/16/delete.png"));
    removeButton.addStyleName("small default");
    crudButtons.addComponent(removeButton);

    getCrudButtons().addComponent(crudButtons, 0);
    getCrudButtons().setComponentAlignment(crudButtons, Alignment.MIDDLE_LEFT);

    actionContextMenu.addAction("aggregationRelationship.remove", this, "remove");
}

From source file:com.fatminds.vaadin_cmis_integration.demo.DemoPage.java

License:Apache License

@AutoGenerated
private HorizontalLayout buildHorizontalLayout_3() {
    // common part: create layout
    horizontalLayout_3 = new HorizontalLayout();
    horizontalLayout_3.setImmediate(false);
    horizontalLayout_3.setWidth("100.0%");
    horizontalLayout_3.setHeight("250px");
    horizontalLayout_3.setMargin(false);

    // cmisList_1
    cmisList_1 = new CmisList();
    cmisList_1.setImmediate(false);/*from www  . j a  v a 2 s .co  m*/
    cmisList_1.setWidth("700px");
    cmisList_1.setHeight("250px");
    horizontalLayout_3.addComponent(cmisList_1);

    // btnRefresh
    btnRefresh = new Button();
    btnRefresh.setCaption("Refresh container");
    btnRefresh.setImmediate(true);
    btnRefresh.setWidth("150px");
    btnRefresh.setHeight("-1px");
    horizontalLayout_3.addComponent(btnRefresh);
    horizontalLayout_3.setComponentAlignment(btnRefresh, new Alignment(6));

    return horizontalLayout_3;
}

From source file:com.fnc.view.ui.AlphaListMainUI.java

public AlphaListMainUI() {
    setSizeFull();//from ww w. j  a va 2s  .  com
    setMargin(true);

    addComponent(buildForms());

    HorizontalLayout h = new HorizontalLayout();
    h.setWidthUndefined();
    h.setSpacing(true);

    progress.setWidth("150px");
    h.addComponent(progress);
    h.setComponentAlignment(progress, Alignment.MIDDLE_LEFT);

    status.setValue("0%");
    h.addComponent(status);

    addComponent(h);
    addComponent(grid);
}

From source file:com.fnc.view.ui.AlphaListMainUI.java

FormLayout buildForms() {
    FormLayout form = new FormLayout();
    form.setWidth("50%");

    corporation.setCaption("Corporation: ");
    corporation.addStyleName(ValoTheme.COMBOBOX_SMALL);
    trade.setCaption("Trade: ");
    trade.addStyleName(ValoTheme.COMBOBOX_SMALL);
    branch.setCaption("Branch: ");
    branch.addStyleName(ValoTheme.COMBOBOX_SMALL);

    corporation.addValueChangeListener(new CorporateComboBoxPropertyListener(trade, trade.getCaption()));
    form.addComponent(corporation);//  www  . jav a 2 s.c o m

    trade.addValueChangeListener(new CorporateComboBoxPropertyListener(branch, branch.getCaption()));
    form.addComponent(trade);

    branch.addValueChangeListener(branchPropertyChangeListener);
    form.addComponent(branch);

    HorizontalLayout h = new HorizontalLayout();
    h.setCaption("Year: ");
    h.setWidth("100%");
    h.setSpacing(true);

    h.addComponent(selectYear());
    h.addComponent(alphaListButton());

    form.addComponent(h);

    return form;
}

From source file:com.fnc.view.ui.thirteenth.ThirteenthMonthUI.java

public ThirteenthMonthUI() {
    setSizeFull();//w w w.ja  v  a  2 s  . c o  m
    setMargin(true);

    addComponent(buildForms());

    HorizontalLayout h = new HorizontalLayout();
    h.setWidthUndefined();
    h.setSpacing(true);

    progress.setWidth("150px");
    h.addComponent(progress);
    h.setComponentAlignment(progress, Alignment.MIDDLE_LEFT);

    status.setValue("0%");
    h.addComponent(status);

    addComponent(h);
}

From source file:com.fnc.view.ui.thirteenth.ThirteenthMonthUI.java

FormLayout buildForms() {
    FormLayout form = new FormLayout();
    form.setWidth("50%");

    corporation.setCaption("Corporation: ");
    corporation.addStyleName(ValoTheme.COMBOBOX_SMALL);
    trade.setCaption("Trade: ");
    trade.addStyleName(ValoTheme.COMBOBOX_SMALL);
    branch.setCaption("Branch: ");
    branch.addStyleName(ValoTheme.COMBOBOX_SMALL);

    corporation.addValueChangeListener(new CorporateComboBoxPropertyListener(trade, trade.getCaption()));
    form.addComponent(corporation);/*from w  w  w  .j a  va  2s.co  m*/

    trade.addValueChangeListener(new CorporateComboBoxPropertyListener(branch, branch.getCaption()));
    form.addComponent(trade);

    branch.addValueChangeListener(branchPropertyChangeListener);
    form.addComponent(branch);

    HorizontalLayout h = new HorizontalLayout();
    h.setCaption("Year: ");
    h.setWidth("100%");
    h.setSpacing(true);

    h.addComponent(selectYear());
    h.addComponent(button());

    form.addComponent(h);

    return form;
}

From source file:com.foc.helpBook.HelpUI.java

License:Apache License

@Override
public FocCentralPanel newWindow() {
    FocCentralPanel focCentralPanel = new FocCentralPanel();
    focCentralPanel.fill();//from w  ww. j a  v  a 2 s  .c o m

    Label labelHelpContent = new Label();
    labelHelpContent.setContentMode(ContentMode.HTML);

    String htmlContent = (String) FocWebApplication.getFocWebSession_Static().getParameter("HELP_CONTENT");
    labelHelpContent.setValue(htmlContent);
    VerticalLayout mainLayout = new VerticalLayout();

    mainLayout.setSizeFull();

    HorizontalLayout navigationLayout = new HorizontalLayout();
    navigationLayout.setWidth("95%");

    navigationLayout.addComponent(getPreviousPageButton());
    navigationLayout.setComponentAlignment(getPreviousPageButton(), Alignment.BOTTOM_LEFT);

    navigationLayout.addComponent(getNextPageButton());
    navigationLayout.setComponentAlignment(getNextPageButton(), Alignment.BOTTOM_RIGHT);

    mainLayout.addComponent(labelHelpContent);

    mainLayout.addComponent(navigationLayout);
    mainLayout.setComponentAlignment(navigationLayout, Alignment.BOTTOM_CENTER);

    focCentralPanel.addComponent(mainLayout);
    return focCentralPanel;
}