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.mechanicshop.components.TableLayout.java

private void buildLayout() {
    HorizontalLayout layoutTitle = new HorizontalLayout();
    layoutTitle.setSizeUndefined();//from  w w w .  j av a2  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.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);

}

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

public void createCustomMessage() {
    final TextArea textArea = new TextArea();
    textArea.setImmediate(true);/*from   w w w .ja v  a  2 s. c  om*/
    textArea.setColumns(30);
    textArea.setRows(10);
    textArea.addStyleName(ValoTheme.TEXTAREA_SMALL);
    textArea.setRequired(true);
    final Window subWindow = new Window();
    subWindow.setModal(true);
    subWindow.setHeight("350px");
    subWindow.setWidth("500px");
    subWindow.setCaption("Insert Message");
    subWindow.setStyleName(ValoTheme.WINDOW_TOP_TOOLBAR);
    subWindow.setClosable(false);
    subWindow.setResizable(false);

    HorizontalLayout layoutButtons = new HorizontalLayout();
    layoutButtons.setMargin(false);
    Button sendBtn = new Button("Send");
    sendBtn.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            try {
                textArea.validate();
                String message = textArea.getValue();
                smsSenderService.sendMessageMassive(message);
                subWindow.close();
                Notification.show("Message Sent");
            } catch (Exception e) {

            }
        }
    });
    sendBtn.setImmediate(true);
    sendBtn.setStyleName(ValoTheme.BUTTON_TINY);
    sendBtn.addStyleName(ValoTheme.BUTTON_FRIENDLY);
    Button cancelBtn = new Button("Cancel");
    cancelBtn.setStyleName(ValoTheme.BUTTON_TINY);
    cancelBtn.addStyleName(ValoTheme.BUTTON_DANGER);
    cancelBtn.setImmediate(true);
    cancelBtn.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            subWindow.close();

        }
    });

    layoutButtons.setSizeUndefined();
    layoutButtons.setSpacing(true);
    layoutButtons.addComponents(cancelBtn, sendBtn);

    VerticalLayout layout = new VerticalLayout();
    layout.setSpacing(true);
    layout.setMargin(true);
    layout.addComponent(textArea);
    layout.addComponent(layoutButtons);
    layout.setComponentAlignment(textArea, Alignment.MIDDLE_CENTER);
    layout.setComponentAlignment(layoutButtons, Alignment.MIDDLE_RIGHT);
    layout.setExpandRatio(textArea, 3);

    layout.setSizeFull();

    subWindow.setContent(layout);
    subWindow.center();

    getUI().addWindow(subWindow);
}

From source file:com.mic.springvaadin.ui.AspectJManagedUI.java

License:Apache License

@Override
protected void init(VaadinRequest vaadinRequest) {
    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();
    layout.setSpacing(true);/*w  w  w. jav a 2 s.c om*/
    layout.setMargin(true);

    defaultLabel = new Label("Default View 1");
    defaultLabel.setImmediate(true);
    layout.addComponent(defaultLabel);

    viewContainer = new Panel();
    viewContainer.setSizeFull();
    layout.addComponent(viewContainer);
    layout.setExpandRatio(viewContainer, 1f);

    setContent(layout);

    Navigator navigator = new Navigator(this, viewContainer);
    navigator.addView("default", new DefaultView());
    navigator.addView("default2", new DefaultView2());
    if (navigator.getState().isEmpty()) {
        navigator.navigateTo("default");
    }
}

From source file:com.mymita.vaadlets.VaadletsBuilder.java

License:Apache License

private void create(final com.mymita.vaadlets.core.Component aComponent) {
    component = aComponent;//w  ww.jav a 2s . co  m
    if (!(aComponent instanceof com.mymita.vaadlets.core.ComponentContainer)) {
        // XXX create a dummy component container
        final VerticalLayout dummy = new VerticalLayout();
        dummy.setSizeFull();
        root = new CustomComponent(dummy);
        dummy.addComponent(createVaadinComponent(aComponent));
    } else {
        root = createVaadinComponent(aComponent);
        createChildComponents(root, (com.mymita.vaadlets.core.ComponentContainer) aComponent);
    }
    for (final Entry<String, ClickListener> cl : clickListener.entrySet()) {
        final Component component = getComponent(cl.getKey());
        if (component instanceof Button) {
            ((Button) component).addListener(cl.getValue());
        }
    }
    for (final Entry<String, Listener> cl : componentListener.entrySet()) {
        final Component component = getComponent(cl.getKey());
        if (component != null) {
            component.addListener(cl.getValue());
        }
    }
}

From source file:com.naoset.framework.frontend.component.profile.CustomerPanelView.java

public Component buildCustomerPanel(Customer customer) {

    VerticalLayout content = new VerticalLayout();

    content.addComponent(builtData());//  w  w w .j  a  v a  2 s  . c  o  m
    content.setSizeFull();
    content.setMargin(new MarginInfo(true, false, false, false));

    return content;
}

From source file:com.naoset.framework.frontend.view.window.Window.java

public Window(Component component) {
    mySelf = this;
    this.body = component;

    //addStyleName("moviedetailswindow");
    Responsive.makeResponsive(this);

    setCaption(body.getCaption());//from w ww  .ja va2  s.com
    center();
    setCloseShortcut(ShortcutAction.KeyCode.ESCAPE, null);
    setResizable(false);
    setClosable(false);
    setHeight(90.0f, Unit.PERCENTAGE);

    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();
    setContent(layout);

    Panel bodyWrapper = new Panel(body);
    bodyWrapper.setSizeFull();
    bodyWrapper.addStyleName(ValoTheme.PANEL_BORDERLESS);
    bodyWrapper.addStyleName("scroll-divider");
    layout.addComponent(bodyWrapper);
    layout.setExpandRatio(bodyWrapper, 1f);

    footer = buildFooter();
    layout.addComponent(footer);
}

From source file:com.oodrive.nuage.webui.component.DeviceItemComponent.java

License:Apache License

/**
 * Create delete tab in the accordion./*from  w ww . ja  v  a  2s .c  o  m*/
 * 
 * @return the component.
 */
@SuppressWarnings("serial")
private final AbstractComponent createDelete() {

    /* root layout */
    final VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();
    layout.setMargin(true);
    layout.setSpacing(true);

    final Label label = new Label("Deleting a device can be done, only if it is de-activated.");
    layout.addComponent(label);
    label.setWidth(null);
    layout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);

    final Button deleteButton = new Button("Delete");

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

    deleteButton.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            try {
                final DeviceDeleteWindow deleteWindow = new DeviceDeleteWindow(model.getItemUuid());
                deleteWindow.add(model);
            } catch (final Exception e) {
                LOGGER.error("Can not delete device: ", e);
            }
        }
    });
    return layout;
}

From source file:com.oodrive.nuage.webui.component.SnapshotItemComponent.java

License:Apache License

/**
 * Create delete tab in the accordion.//from www  .  j a  v  a 2s. c o m
 * 
 * @return the component.
 */
@SuppressWarnings("serial")
private final AbstractComponent createDelete() {

    final VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();
    layout.setMargin(true);
    layout.setSpacing(true);

    final Label label = new Label("Deleting a snapshot can be done, only if it is not the root snapshot.");
    label.setWidth(null);
    layout.addComponent(label);
    layout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);

    final Button deleteButton = new Button("Delete");

    if (model.getItemUuid().equals(model.getSnapshotParent())) {
        // Root snapshot can not be deleted
        deleteButton.setEnabled(false);
    }
    layout.addComponent(deleteButton);
    layout.setComponentAlignment(deleteButton, Alignment.BOTTOM_CENTER);

    deleteButton.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            try {
                final SnapshotDeleteWindow deleteWindow = new SnapshotDeleteWindow(model.getItemUuid());
                deleteWindow.add(model);
            } catch (final Exception e) {
                LOGGER.error("Can not delete snapshot:", e);
                final ErrorWindow err = new ErrorWindow("Snapshot not deleted: " + e.getMessage());
                err.add(model);
            }
        }
    });
    return layout;
}

From source file:com.oodrive.nuage.webui.VvrManagerUi.java

License:Apache License

/**
 * Add a progress bar for long task.//from  w w  w  . java  2  s  . c  o m
 * 
 * @return the layout
 */
public VerticalLayout addProgressBar() {
    final VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();

    final ProgressBar bar = new ProgressBar();
    layout.addComponent(new Label("This operation can take some time. Please wait..."));
    bar.setIndeterminate(true);
    bar.setImmediate(true);

    layout.addComponent(bar);
    layout.setComponentAlignment(bar, Alignment.MIDDLE_CENTER);

    rootLayout.addComponent(layout, "top: 50%; left: 39%");
    vvrManagerLayout.setEnabled(false);
    return layout;
}

From source file:com.openhris.administrator.ChangePassword.java

public ComponentContainer layout() {
    VerticalLayout vlayout = new VerticalLayout();
    vlayout.setSpacing(true);/*from  w  ww  .ja  v  a2 s.  c  om*/
    vlayout.setMargin(true);
    vlayout.setSizeFull();
    vlayout.setImmediate(true);

    final PasswordField currentPassword = createPasswordField("Current Password: ");
    vlayout.addComponent(currentPassword);

    final PasswordField newPassword = createPasswordField("New Password: ");
    vlayout.addComponent(newPassword);

    final PasswordField rePassword = createPasswordField("Re-enter Password: ");
    vlayout.addComponent(rePassword);

    Button changeBtn = new Button("UPDATE PASSWORD");
    changeBtn.setWidth("100%");
    changeBtn.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            if (!adminService.checkEnteredPasswordIfCorrect(getUserId(),
                    currentPassword.getValue().toString().toLowerCase().trim())) {
                getWindow().showNotification("Incorrect Password, contact your Administrator!",
                        Window.Notification.TYPE_WARNING_MESSAGE);
                return;
            }

            if (!newPassword.getValue().toString().toLowerCase().trim()
                    .equals(rePassword.getValue().toString().toLowerCase().trim())) {
                getWindow().showNotification("Entered Password do not Match!",
                        Window.Notification.TYPE_WARNING_MESSAGE);
                return;
            }

            boolean result = adminService.updateUserPassword(getUserId(),
                    rePassword.getValue().toString().toLowerCase().trim());
            if (result) {
                GlobalVariables.setLogoutAfterPasswordChange(true);
                close();
            } else {
                GlobalVariables.setLogoutAfterPasswordChange(false);
                getWindow().showNotification("Change Password SQL Error!, Contact your DBA",
                        Window.Notification.TYPE_ERROR_MESSAGE);
                return;
            }

        }
    });
    vlayout.addComponent(changeBtn);

    return vlayout;
}