Example usage for com.vaadin.ui Alignment TOP_CENTER

List of usage examples for com.vaadin.ui Alignment TOP_CENTER

Introduction

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

Prototype

Alignment TOP_CENTER

To view the source code for com.vaadin.ui Alignment TOP_CENTER.

Click Source Link

Usage

From source file:com.hack23.cia.web.impl.ui.application.views.common.AbstractView.java

License:Apache License

/**
 * Creates the basic layout with panel and footer.
 *
 * @param panelName//from w w  w.  j  a  v a 2 s . c  om
 *            the panel name
 */
protected final void createBasicLayoutWithPanelAndFooter(final String panelName) {
    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setWidth(100, Unit.PERCENTAGE);
    layout.setHeight(100, Unit.PERCENTAGE);

    final VerticalLayout pageModeContent = new VerticalLayout();
    pageModeContent.setMargin(true);
    pageModeContent.setSpacing(true);
    pageModeContent.setWidth(100, Unit.PERCENTAGE);
    pageModeContent.setHeight(100, Unit.PERCENTAGE);

    layout.addComponent(pageModeContent);

    final ThemeResource ciaLogoResource = new ThemeResource("cia-logo.png");

    final Image ciaLogoImage = new Image(null, ciaLogoResource);

    final HorizontalLayout topHeader = new HorizontalLayout();

    topHeader.addComponent(ciaLogoImage);
    ciaLogoImage.setWidth("75px");
    ciaLogoImage.setHeight("75px");
    topHeader.setComponentAlignment(ciaLogoImage, Alignment.MIDDLE_LEFT);
    topHeader.setExpandRatio(ciaLogoImage, ContentRatio.SMALL);

    final HorizontalLayout topTitleHeadertPanel = new HorizontalLayout();

    final Label titleLabel = new Label("Citizen Intelligence Agency");
    titleLabel.setStyleName("Header");
    topTitleHeadertPanel.addComponent(titleLabel);
    topTitleHeadertPanel.setComponentAlignment(titleLabel, Alignment.MIDDLE_LEFT);

    final Label sloganLabel = new Label("// Tracking politicians like bugs!");
    sloganLabel.setStyleName("HeaderSlogan");
    topTitleHeadertPanel.addComponent(sloganLabel);
    topTitleHeadertPanel.setComponentAlignment(sloganLabel, Alignment.MIDDLE_RIGHT);

    topHeader.addComponent(topTitleHeadertPanel);
    topHeader.setComponentAlignment(topTitleHeadertPanel, Alignment.MIDDLE_LEFT);
    topHeader.setExpandRatio(topTitleHeadertPanel, ContentRatio.GRID);

    topHeaderRightPanel.removeAllComponents();
    topHeader.addComponent(topHeaderRightPanel);
    topHeader.setComponentAlignment(topHeaderRightPanel, Alignment.MIDDLE_RIGHT);
    topHeader.setExpandRatio(topHeaderRightPanel, ContentRatio.LARGE);

    if (UserContextUtil.allowRoleInSecurityContext(ROLE_ADMIN)
            || UserContextUtil.allowRoleInSecurityContext(ROLE_USER)) {

        final Link userHomePageLink = pageLinkFactory.createUserHomeViewPageLink();
        topHeaderRightPanel.addComponent(userHomePageLink);
        topHeaderRightPanel.setComponentAlignment(userHomePageLink, Alignment.MIDDLE_RIGHT);

        final Button logoutButton = new Button(LOGOUT, FontAwesome.SIGN_OUT);

        final LogoutRequest logoutRequest = new LogoutRequest();
        logoutRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
        logoutButton.addClickListener(new LogoutClickListener(logoutRequest, applicationManager));

        topHeaderRightPanel.addComponent(logoutButton);
        topHeaderRightPanel.setComponentAlignment(logoutButton, Alignment.MIDDLE_RIGHT);

    } else {
        final Link createRegisterPageLink = pageLinkFactory.createRegisterPageLink();
        topHeaderRightPanel.addComponent(createRegisterPageLink);
        topHeaderRightPanel.setComponentAlignment(createRegisterPageLink, Alignment.MIDDLE_RIGHT);

        final Link createLoginPageLink = pageLinkFactory.createLoginPageLink();
        topHeaderRightPanel.addComponent(createLoginPageLink);
        topHeaderRightPanel.setComponentAlignment(createLoginPageLink, Alignment.MIDDLE_RIGHT);
    }

    topHeaderRightPanel.setWidth("100%");
    topHeaderRightPanel.setHeight("60px");

    topHeader.setWidth("100%");
    topHeader.setHeight("60px");

    pageModeContent.addComponent(topHeader);
    pageModeContent.setComponentAlignment(topHeader, Alignment.TOP_CENTER);

    pageModeContent.addComponent(getBarmenu());
    pageModeContent.setComponentAlignment(getBarmenu(), Alignment.TOP_CENTER);

    panel = new Panel(panelName);

    panel.setSizeFull();
    pageModeContent.addComponent(panel);
    pageModeContent.setExpandRatio(panel, ContentRatio.FULL_SIZE);

    pageModeContent.addComponent(pageLinkFactory.createMainViewPageLink());
    setContent(layout);

    setWidth(100, Unit.PERCENTAGE);
    setHeight(100, Unit.PERCENTAGE);
    setSizeFull();

}

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

License:Apache License

/**
 * Inits the form./*from  ww w.  j  a va 2s . c  o  m*/
 */
protected void initForm() {
    form = new FormLayout();
    form.setSizeFull();
    addComponent(form);
    setComponentAlignment(form, Alignment.TOP_CENTER);
}

From source file:com.klwork.explorer.ui.form.FormPropertiesComponent.java

License:Apache License

protected void initForm() {
    form = new FormLayout();
    form.setSizeFull();
    addComponent(form);
    setComponentAlignment(form, Alignment.TOP_CENTER);
}

From source file:com.klwork.explorer.ui.mainlayout.MainMenuBar.java

License:Apache License

protected Button addMenuButton(String type, String label, Resource icon, boolean active, float width) {
    Button button = new Button(label);
    button.addStyleName(type);/* w  ww .ja  va 2s.  c  om*/
    button.addStyleName(ExplorerLayout.STYLE_MAIN_MENU_BUTTON);
    button.addStyleName(Reindeer.BUTTON_LINK);
    button.setHeight(54, Unit.PIXELS);
    button.setIcon(icon);
    button.setWidth(width, Unit.PIXELS);

    addComponent(button);
    setComponentAlignment(button, Alignment.TOP_CENTER);

    return button;
}

From source file:com.lizardtech.expresszip.vaadin.SetupMapViewComponent.java

License:Apache License

public SetupMapViewComponent() {

    listeners = new ArrayList<SetupMapViewListener>();
    cmbProjection = new ComboBox();
    cmbProjection.setTextInputAllowed(false);
    HorizontalLayout projectionLayout = new HorizontalLayout();
    projectionLayout.addComponent(cmbProjection);
    projectionLayout.setWidth(100f, UNITS_PERCENTAGE);

    setSizeFull();//from  ww w .j  a  v a2s  .  c  o  m

    // main layout
    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSizeFull();

    // instruction banner
    Label step = new Label("Step 2: Select Export Region");
    step.addStyleName("step");
    layout.addComponent(step);

    //
    // setup tree data source
    //
    treeHier = new HierarchicalContainer();
    treeHier.addContainerProperty(ExpressZipTreeTable.LAYER, ExpressZipLayer.class, null);
    treeHier.addContainerProperty(DRAG_PROPERTY, Embedded.class, null);

    // table holding layers
    treeTable = new ExpressZipTreeTable();
    treeTable.setContainerDataSource(treeHier);

    treeTable.setDragMode(TableDragMode.ROW);
    treeTable.setColumnHeaders(new String[] { ExpressZipTreeTable.LAYER, "" });
    treeTable.setColumnExpandRatio(ExpressZipTreeTable.LAYER, 1);
    treeTable.setColumnWidth(DRAG_PROPERTY, 23);

    // upload shape file
    btnUploadShapeFile.setFieldType(FieldType.BYTE_ARRAY);
    btnUploadShapeFile.setButtonCaption("");
    btnUploadShapeFile.setSizeUndefined();
    btnUploadShapeFile.addStyleName("shapefile");

    // remove shape file
    btnRemoveShapeFile.addListener(this);
    btnRemoveShapeFile.setSizeUndefined();
    btnRemoveShapeFile.setVisible(false);
    btnRemoveShapeFile.setIcon(new ThemeResource("img/RemoveShapefileStandard23px.png"));
    btnRemoveShapeFile.setStyleName(BaseTheme.BUTTON_LINK);
    btnRemoveShapeFile.addStyleName("shapefile");
    HorizontalLayout hznUpload = new HorizontalLayout();

    Panel coordPanel = new Panel("Export Extent");

    layout.addComponent(treeTable);
    layout.addComponent(new Panel(PROJECTION, projectionLayout));
    layout.addComponent(new Panel(SHAPEFILE_UPLOAD, hznUpload));
    layout.addComponent(coordPanel);

    layout.setSpacing(true);

    hznUpload.addComponent(btnUploadShapeFile);
    hznUpload.addComponent(btnRemoveShapeFile);
    hznUpload.addComponent(lblCurrentShapeFile);
    hznUpload.setExpandRatio(lblCurrentShapeFile, 1f);
    hznUpload.setComponentAlignment(lblCurrentShapeFile, Alignment.MIDDLE_LEFT);
    hznUpload.setWidth("100%");

    cmbProjection.setWidth("100%");

    topTextField.setWidth(150, UNITS_PIXELS);
    topTextField.setImmediate(true);
    topTextField.setRequired(true);
    topTextField.addListener(topListener);

    leftTextField.setWidth(150, UNITS_PIXELS);
    leftTextField.setImmediate(true);
    leftTextField.setRequired(true);
    leftTextField.addListener(leftListener);

    bottomTextField.setWidth(150, UNITS_PIXELS);
    bottomTextField.setImmediate(true);
    bottomTextField.setRequired(true);
    bottomTextField.addListener(bottomListener);

    rightTextField.setWidth(150, UNITS_PIXELS);
    rightTextField.setImmediate(true);
    rightTextField.setRequired(true);
    rightTextField.addListener(rightListener);

    VerticalLayout coordLayout = new VerticalLayout();
    coordLayout.setSizeFull();
    coordPanel.setContent(coordLayout);
    coordLayout.addComponent(topTextField);

    HorizontalLayout leftRightLayout = new HorizontalLayout();
    leftRightLayout.setWidth("100%");
    leftRightLayout.addComponent(leftTextField);
    leftRightLayout.addComponent(rightTextField);
    leftRightLayout.setComponentAlignment(leftTextField, Alignment.MIDDLE_LEFT);
    leftRightLayout.setComponentAlignment(rightTextField, Alignment.MIDDLE_RIGHT);
    coordLayout.addComponent(leftRightLayout);

    coordLayout.addComponent(bottomTextField);
    coordLayout.setComponentAlignment(topTextField, Alignment.TOP_CENTER);
    coordLayout.setComponentAlignment(bottomTextField, Alignment.BOTTOM_CENTER);

    btnNext = new ExpressZipButton("Next", Style.STEP, this);
    btnBack = new ExpressZipButton("Back", Style.STEP, this);

    HorizontalLayout backNextLayout = new HorizontalLayout();
    backNextLayout.addComponent(btnBack);
    backNextLayout.addComponent(btnNext);
    btnNext.setEnabled(false);

    backNextLayout.setComponentAlignment(btnBack, Alignment.BOTTOM_LEFT);
    backNextLayout.setComponentAlignment(btnNext, Alignment.BOTTOM_RIGHT);
    backNextLayout.setWidth("100%");

    VerticalLayout navLayout = new VerticalLayout();
    navLayout.addComponent(backNextLayout);
    navLayout.setSpacing(true);

    ThemeResource banner = new ThemeResource("img/ProgressBar2.png");
    navLayout.addComponent(new Embedded(null, banner));

    layout.addComponent(navLayout);
    layout.setComponentAlignment(navLayout, Alignment.BOTTOM_CENTER);

    layout.setExpandRatio(treeTable, 1.0f);
    setCompositionRoot(layout);

    // notify when selection changes
    treeTable.addListener(new Property.ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            for (SetupMapViewListener listener : listeners) {
                listener.layersSelectedEvent((Set<ExpressZipLayer>) treeTable.getValue());
            }

        }
    });
    treeTable.addActionHandler(this);
    treeHier.removeAllItems();

    //
    // drag n' drop behavior
    //
    treeTable.setDropHandler(new DropHandler() {
        public AcceptCriterion getAcceptCriterion() {
            return AcceptAll.get();
        }

        // Make sure the drag source is the same tree
        public void drop(DragAndDropEvent event) {
            // Wrapper for the object that is dragged
            Transferable t = event.getTransferable();

            // Make sure the drag source is the same tree
            if (t.getSourceComponent() != treeTable)
                return;

            AbstractSelectTargetDetails target = (AbstractSelectTargetDetails) event.getTargetDetails();

            // Get ids of the dragged item and the target item
            Object sourceItemId = t.getData("itemId");
            Object targetItemId = target.getItemIdOver();

            // if we drop on ourselves, ignore
            if (sourceItemId == targetItemId)
                return;

            // On which side of the target the item was dropped
            VerticalDropLocation location = target.getDropLocation();

            // place source after target
            treeHier.moveAfterSibling(sourceItemId, targetItemId);

            // if top, switch them
            if (location == VerticalDropLocation.TOP) {
                treeHier.moveAfterSibling(targetItemId, sourceItemId);
            }

            Collection<ExpressZipLayer> layers = (Collection<ExpressZipLayer>) treeHier.rootItemIds();
            for (SetupMapViewListener listener : listeners)
                listener.layerMovedEvent(layers);
        }
    });

    cmbProjection.setImmediate(true);
    cmbProjection.setNullSelectionAllowed(false);
    cmbProjection.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = -5188369735622627751L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            if (cmbProjection.getValue() != null) {
                selectedEpsg = (String) cmbProjection.getValue();
                String currentProjection = ((ExpressZipWindow) getApplication().getMainWindow())
                        .getExportProps().getMapProjection();
                if (!selectedEpsg.equals(currentProjection))
                    for (SetupMapViewListener listener : new ArrayList<SetupMapViewListener>(listeners))
                        listener.projectionChangedEvent(selectedEpsg);
            }
        }
    });
}

From source file:com.logicbomb.newschool.pages.masterpages.PrimaryMasterPage.java

public PrimaryMasterPage() {

    //ContextWidget c= new ContextWidget();

    HorizontalLayout iHorizontalLayout = new HorizontalLayout();
    //addComponent(iHorizontalLayout,"top:0px;left:0px");
    iHorizontalLayout.setWidth(String.valueOf(Page.getCurrent().getBrowserWindowWidth()));
    iHorizontalLayout.setHeight(String.valueOf(Page.getCurrent().getBrowserWindowHeight()));
    iHorizontalLayout.setStyleName("backColorBlack");

    //String[] captions1 = {"Logo Here", "My Cool School", "Third"};

    //Layout A and its sub components
    Panel AP = new Panel();
    iHorizontalLayout.addComponent(AP);//from   w ww. jav a 2  s  .  c  om
    AP.setSizeFull();
    AP.setStyleName("backColorBlack");
    VerticalLayout A1 = new VerticalLayout();
    AP.setContent(A1);
    //A.setSizeFull();
    A1.setSpacing(true);
    iHorizontalLayout.setExpandRatio(AP, 1);

    A1.setStyleName("backColorBlack");
    A1.setMargin(new MarginInfo(true, true, true, true));

    Button logoImage = new Button();
    logoImage.setIcon(FontAwesome.PICTURE_O);
    logoImage.setWidth("80px");
    logoImage.setHeight(logoImage.getWidth(), Unit.PIXELS);
    //logoImage.setWidth("100px");
    A1.addComponent(logoImage);
    A1.setComponentAlignment(logoImage, Alignment.TOP_CENTER);

    Label schoolName = new Label("The School Of Future");
    schoolName.setStyleName("v-label-big");
    A1.addComponent(schoolName);
    //A.setComponentAlignment(schoolName,Alignment.TOP_CENTER);

    Label schoolMinorName = new Label("Random Branch");
    schoolMinorName.setStyleName("v-label-small");
    A1.addComponent(schoolMinorName);

    VerticalLayout A2 = new VerticalLayout();
    A1.addComponent(A2);
    MainMenuWidget iMainMenuWidget = new MainMenuWidget();
    A2.addComponent(iMainMenuWidget);

    //A.setComponentAlignment(schoolName,Alignment.TOP_CENTER);

    //Layout B
    ContextWidgetTop c = new ContextWidgetTop();
    c = ContextWidgetTop.ContextWidgetTransformer(c, new UserDetailsWidget(), SliderMode.TOP,
            SliderPanelStyles.COLOR_RED);
    VerticalLayout B = new VerticalLayout();
    B.setSizeFull();
    //B.setSpacing(true);
    iHorizontalLayout.addComponent(c);
    c.addComponent(B);
    iHorizontalLayout.setExpandRatio(c, 7);

    //Layout B1 and its sub Components
    HorizontalLayout B1 = new HorizontalLayout();
    B.addComponent(B1);
    //B.setExpandRatio(B1, 1);
    //B1.setHeight("70px");
    B1.setSizeFull();
    //B1=ContextWidget.ContextWidgetTransformer(B1, new SliderMasterPage(),SliderMode.RIGHT,SliderPanelStyles.COLOR_RED);

    HorizontalLayout B11 = new HorizontalLayout();
    B1.addComponent(B11);
    B1.setStyleName("backColorBlack");
    B11.setSizeFull();
    B1.setHeight("45px");
    //B1.setStyleName("backColorWhite");
    //B1.setMargin(new MarginInfo(false, true, false, true));

    TextField iTextField = new TextField();
    iTextField.setWidth("200px");
    iTextField.setInputPrompt("Search!");
    iTextField.setStyleName("v-text-type-search");
    iTextField.focus();
    B11.addComponent(iTextField);
    B11.setComponentAlignment(iTextField, Alignment.MIDDLE_LEFT);

    //Layout B2 and its Sub Components
    ContextWidget B2 = new ContextWidget();
    B2.setSizeFull();
    B.addComponent(B2);
    B.setExpandRatio(B2, 10);
    B2 = ContextWidget.ContextWidgetTransformer(B2, new SliderMasterPage(), SliderMode.RIGHT,
            SliderPanelStyles.COLOR_BLUE);
    //B2=ContextWidget.ContextWidgetTransformer(B2, new SliderMasterPage(),SliderMode.TOP,SliderPanelStyles.COLOR_RED);
    VerticalLayout v = new VerticalLayout();
    B2.addComponent(v);

    Button b1111 = new Button(
            "Put all the inner components like this Put all the inner components like this Put all the inner components like this Put all the inner components like this");
    v.addComponent(b1111);
    Button b1112 = new Button("Put all the inner components like this");
    v.addComponent(b1112);

    /*
    Panel p = new Panel();
    VerticalLayout v= new VerticalLayout();
    v.addComponent(new TextField("Name"));
    v.addComponent(new TextField("Street address"));
    v.addComponent(new TextField("Postal code"));
    p.setContent(v);
    B2.addComponent(p);
    v.setWidth(String.valueOf(B2.getWidth()*10)+"px");
    //v.setSizeFull();// <- This will cause issues. Don't do this
    p.setSizeFull();
    */

    //ContextWidget iContextPanel= new ContextWidget(p);
    //B2.addComponent(iContextPanel);
    //setPosition(p, iComponentPositionPanel);

    addComponent(iHorizontalLayout);
}

From source file:com.m4gik.views.MainView.java

/**
 * @param root/*w ww .j av  a  2s . co m*/
 */
private void addSlogan(VerticalLayout root) {
    Label slogan = new Label("All music now without limits");
    slogan.addStyleName(Runo.LABEL_SMALL);
    slogan.setSizeUndefined();
    root.addComponent(slogan);
    root.setComponentAlignment(slogan, Alignment.TOP_CENTER);
}

From source file:com.m4gik.views.MainView.java

/**
 * @param root/*  w w  w.j a v  a 2 s  .c  o m*/
 */
private void addTitle(VerticalLayout root) {
    Label title = new Label("Music Player");
    title.addStyleName(Runo.LABEL_H1);
    title.setSizeUndefined();
    root.addComponent(title);
    root.setComponentAlignment(title, Alignment.TOP_CENTER);

    addSlogan(root);
}

From source file:com.mechanicshop.components.MaintenanceLayout.java

private void buildLayout() {
    HorizontalLayout layoutTitle = new HorizontalLayout();
    layoutTitle.setSizeUndefined();/*from   w ww  . j  a va  2 s  .  c  o  m*/
    layoutTitle.setWidth("100%");
    layoutTitle.setSpacing(false);
    layoutTitle.setMargin(false);
    titleLabel.addStyleName(ValoTheme.LABEL_H2);
    titleLabel.addStyleName(ValoTheme.LABEL_COLORED);
    titleLabel.addStyleName(ValoTheme.LABEL_NO_MARGIN);
    titleLabel.addStyleName(ValoTheme.LABEL_BOLD);
    titleLabel.setSizeUndefined();

    layoutTitle.addComponent(titleLabel);
    layoutTitle.setComponentAlignment(titleLabel, Alignment.MIDDLE_CENTER);

    VerticalLayout layoutTable = new VerticalLayout();

    layoutTable.setSizeFull();

    layoutTable.setSpacing(true);
    HorizontalLayout layoutButtons = new HorizontalLayout();
    layoutButtons.setMargin(false);
    layoutButtons.setSpacing(true);
    layoutButtons.setSizeUndefined();
    Button passwordBtn = new Button("Edit Password");
    passwordBtn.addClickListener(passwordListener);
    passwordBtn.setImmediate(true);
    passwordBtn.setIcon(FontAwesome.EDIT);
    passwordBtn.setStyleName(ValoTheme.BUTTON_TINY);
    Button media1Btn = new Button("Media 1 Default Text");
    media1Btn.setStyleName(ValoTheme.BUTTON_TINY);
    media1Btn.setImmediate(true);
    media1Btn.setIcon(FontAwesome.EDIT);
    media1Btn.addClickListener(media1Listener);
    Button media2Btn = new Button("Media 2 Default Text");
    media2Btn.setStyleName(ValoTheme.BUTTON_TINY);
    media2Btn.setImmediate(true);
    media2Btn.setIcon(FontAwesome.EDIT);
    media2Btn.addClickListener(media2Listener);
    layoutButtons.addComponents(passwordBtn, media1Btn, media2Btn);

    layoutButtons.setComponentAlignment(passwordBtn, Alignment.MIDDLE_LEFT);
    layoutButtons.setComponentAlignment(media1Btn, Alignment.MIDDLE_LEFT);
    layoutButtons.setComponentAlignment(media2Btn, Alignment.MIDDLE_LEFT);

    addComponent(layoutTitle);
    addComponent(layoutTable);
    layoutTable.addComponent(layoutButtons);
    layoutTable.addComponent(table);
    layoutTable.setComponentAlignment(table, Alignment.TOP_CENTER);
    layoutTable.setExpandRatio(table, 3);
    setComponentAlignment(layoutTitle, Alignment.TOP_CENTER);
    setComponentAlignment(layoutTable, Alignment.TOP_CENTER);
    setExpandRatio(layoutTable, 3);
    setSpacing(true);
    setMargin(true);

}

From source file:com.mechanicshop.components.TableLayout.java

private void buildLayout() {
    HorizontalLayout layoutTitle = new HorizontalLayout();
    layoutTitle.setSizeUndefined();/* ww  w . j a v a 2  s.co  m*/
    layoutTitle.setWidth("100%");
    layoutTitle.setSpacing(false);
    layoutTitle.setMargin(false);
    titleLabel.addStyleName(ValoTheme.LABEL_H2);
    titleLabel.addStyleName(ValoTheme.LABEL_COLORED);
    titleLabel.addStyleName(ValoTheme.LABEL_NO_MARGIN);
    titleLabel.addStyleName(ValoTheme.LABEL_BOLD);
    titleLabel.setSizeUndefined();

    layoutTitle.addComponent(titleLabel);
    layoutTitle.setComponentAlignment(titleLabel, Alignment.MIDDLE_CENTER);

    VerticalLayout layoutTable = new VerticalLayout();

    layoutTable.addComponent(table);
    layoutTable.setComponentAlignment(table, Alignment.TOP_CENTER);
    layoutTable.setSizeFull();

    layoutTable.setSpacing(true);
    HorizontalLayout layoutButtons = new HorizontalLayout();
    layoutButtons.setMargin(false);
    layoutButtons.setSpacing(true);
    layoutButtons.setSizeUndefined();
    layoutButtons.setWidth("100%");
    Button addBtn = new Button("Add new Car");
    addBtn.addClickListener(addBtnListener);
    addBtn.setImmediate(true);
    addBtn.setStyleName(ValoTheme.BUTTON_TINY);
    addBtn.addStyleName(ValoTheme.BUTTON_FRIENDLY);
    Button deleteBtn = new Button("Delete Selected");
    deleteBtn.setStyleName(ValoTheme.BUTTON_TINY);
    deleteBtn.addStyleName(ValoTheme.BUTTON_DANGER);
    deleteBtn.setImmediate(true);
    deleteBtn.addClickListener(removeListener);

    btnSendSMS.setStyleName(ValoTheme.BUTTON_TINY);
    btnSendSMS.addStyleName(ValoTheme.BUTTON_FRIENDLY);
    btnSendSMS.setImmediate(true);
    btnSendSMS.addClickListener(sendSMSBtnListener);

    searchTextField.setImmediate(true);
    searchTextField.addStyleName(ValoTheme.TEXTFIELD_TINY);
    searchTextField.addTextChangeListener(filterChangeListener);
    Label lbSearch = new Label("Search");
    lbSearch.addStyleName(ValoTheme.LABEL_TINY);
    lbSearch.setSizeUndefined();
    layoutButtons.addComponents(lbSearch, searchTextField, addBtn, deleteBtn, btnSendSMS);

    layoutButtons.setComponentAlignment(lbSearch, Alignment.MIDDLE_LEFT);
    layoutButtons.setComponentAlignment(searchTextField, Alignment.BOTTOM_LEFT);
    layoutButtons.setComponentAlignment(addBtn, Alignment.BOTTOM_RIGHT);
    layoutButtons.setComponentAlignment(deleteBtn, Alignment.BOTTOM_RIGHT);
    layoutButtons.setComponentAlignment(btnSendSMS, Alignment.BOTTOM_RIGHT);
    layoutButtons.setExpandRatio(addBtn, 3);
    addComponent(layoutTitle);
    addComponent(layoutTable);
    layoutTable.addComponent(layoutButtons);
    layoutTable.setExpandRatio(table, 3);
    setComponentAlignment(layoutTitle, Alignment.TOP_CENTER);
    setComponentAlignment(layoutTable, Alignment.TOP_CENTER);
    setExpandRatio(layoutTable, 3);
    setSpacing(true);
    setMargin(true);

}