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: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 .j a  v  a2s. co 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:at.peppol.webgui.app.MainWindow.java

License:Mozilla Public License

public void showInitialMainContent(UserFolder<?> userFolder) {
    // ------ START: Main Content -------
    final VerticalLayout mainContentLayout = new VerticalLayout();

    mainContentLayout.addStyleName("margin");
    final VerticalLayout topmain = new VerticalLayout();
    topmain.setSpacing(true);//  w w w.  j  av a  2s .c o  m
    topmain.setWidth("100%");
    final Label bigPAWGLabel = new Label("PEPPOL Post Award Web GUI");
    bigPAWGLabel.setStyleName("huge");
    topmain.addComponent(bigPAWGLabel);
    final Label blahContent = new Label(
            "This is a mockup of the GUI that is going" + " to be the PAWG. It is created by the Greek"
                    + " and Austrian teams as a fine replacement " + " of the Demo Client");
    blahContent.setWidth("80%");
    blahContent.addStyleName("big");
    //topmain.addComponent (blahContent);
    //HorizontalLayout itemsPanel = new ShowItemsPanel("Items", um, userFolder);

    final ShowItemsPanel itemsPanel = new ShowItemsPanel("Items", um, userFolder);
    this.itemsPanel = itemsPanel;
    topmain.addComponent(itemsPanel);
    HorizontalLayout buttonsLayout = new HorizontalLayout();
    buttonsLayout.setSpacing(true);
    topmain.addComponent(buttonsLayout);
    Button loadButton = new Button("Load invoice");
    //topmain.addComponent(loadButton);
    buttonsLayout.addComponent(loadButton);
    loadButton.addListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            Table table = itemsPanel.getTable();
            if (table.getValue() != null) {
                //InvoiceType inv = (InvoiceType)table.getItem(table.getValue()).getItemProperty("invoice").getValue();
                //InvoiceBean invBean = (InvoiceBean)table.getItem(table.getValue());
                InvoiceBean invBean = ((InvoiceBeanContainer) table.getContainerDataSource())
                        .getItem(table.getValue()).getBean();
                //System.out.println("Invoice is: "+invBean);
                showInvoiceForm(invBean);
            }
        }
    });

    Button sendButton = new Button("Send invoice");
    buttonsLayout.addComponent(sendButton);
    sendButton.addListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            try {
                Table table = itemsPanel.getTable();
                if (table.getValue() != null) {
                    InvoiceBean invBean = ((InvoiceBeanContainer) table.getContainerDataSource())
                            .getItem(table.getValue()).getBean();
                    String path = invBean.getFolderEntryID();
                    FileSystemResource s = new FileSystemResource(path);
                    SendInvoice.sendDocument(s);

                    //file is sent. move invoice to outbox
                    um.moveInvoice(invBean, um.getDrafts(), um.getOutbox());
                    //itemsPanel.getTable().requestRepaint();
                    itemsPanel.init(um.getDrafts());
                }
            } catch (FileNotFoundException e) {
                getWindow().showNotification("Could not find invoice file", Notification.TYPE_ERROR_MESSAGE);
            } catch (Exception e) {
                getWindow().showNotification("Could not send invoice. AP connection error",
                        Notification.TYPE_ERROR_MESSAGE);
                e.printStackTrace();
            }
        }
    });

    final Button learnMoreBtn = new Button("Learn More >>");
    learnMoreBtn.addStyleName("tall default");
    //topmain.addComponent (learnMoreBtn);

    mainContentLayout.addComponent(topmain);
    // ------ END: Main Content ---------
    mainContentLayout.setHeight("100%");
    mainContentLayout.setSizeFull();

    mainContentLayout.setSpacing(true);
    mainContentLayout.setWidth("100%");
    middleContentLayout.setWidth("100%");
    middleContentLayout.setHeight("100%");
    middleContentLayout.setMargin(true);
    // --------
    addComponent(middleContentLayout);
    addComponent(footerLayout);
    if (mainContentComponent != null) {
        middleContentLayout.replaceComponent(mainContentComponent, mainContentLayout);
    } else {
        middleContentLayout.addComponent(mainContentLayout);
    }
    middleContentLayout.setExpandRatio(mainContentLayout, 1);
    mainContentComponent = mainContentLayout;
}

From source file:au.org.scoutmaster.views.ContactView.java

@Override
protected VerticalLayout buildEditor(final ValidatingFieldGroup<Contact> fieldGroup2) {
    this.tabs.setSizeFull();

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

    // this needs to be updated when the contact changes
    this.changeListener = new ChangeListener();

    overviewTab();/*  w w  w.  j  a va  2 s.c  om*/
    // contactTab();
    relationshipTab();
    youthTab();
    memberTab();
    medicalTab();
    backgroundTab();
    logTab();
    noteTab();
    // googleTab();

    // When a persons birth date changes recalculate their age.
    this.birthDate.addValueChangeListener(this.changeListener);

    layout.addComponent(this.tabs);
    // VerticalLayout c = new VerticalLayout();
    // layout.addComponent(c);
    // layout.setExpandRatio(c, 1);

    return layout;
}

From source file:be.rvponp.build.CommitViewerUI.java

License:Apache License

@Override
protected void init(VaadinRequest vaadinRequest) {
    VerticalLayout layout = new VerticalLayout();

    VerticalLayout infoLayout = new VerticalLayout();
    layout.setSizeFull();
    HorizontalLayout buildDateLayout = createBuildDateLayout();
    infoLayout.addComponent(buildDateLayout);

    table = createCommitsTable();/*w ww .  ja  v  a  2 s . c  om*/
    files = new VerticalLayout();
    Label filesLabel = new Label("Files");
    VerticalLayout filesLayout = new VerticalLayout();

    HorizontalLayout filtersLayout = createFiltersLayout(table, files, filesLayout);

    VerticalLayout tableLayout = new VerticalLayout();
    tableLayout.addComponent(table);
    tableLayout.setSizeFull();

    filesLayout.addComponent(filesLabel);
    filesLayout.addComponent(files);
    filesLayout.setVisible(false);
    filesLayout.setSizeFull();
    infoLayout.addComponent(new Panel(filtersLayout));
    infoLayout.setSizeUndefined();

    layout.addComponent(infoLayout);
    layout.addComponent(tableLayout);
    layout.setExpandRatio(tableLayout, 1);
    layout.addComponent(filesLayout);
    layout.setExpandRatio(filesLayout, 0);

    layout.addComponent(new ExportXLSButton("Export XLS", table, fromVersion, toVersion));
    layout.setMargin(true);
    setContent(layout);

}

From source file:by.bigvova.LoginUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {
    getPage().setTitle("Vaadin Shared Security Demo Login");

    FormLayout loginForm = new FormLayout();
    loginForm.setSizeUndefined();//from w  ww  .ja  va  2  s . co  m

    userName = new TextField("Username");
    passwordField = new PasswordField("Password");
    rememberMe = new CheckBox("Remember me");
    login = new Button("Login");
    Label label = new Label("Name: User / Password: password");
    loginForm.addComponent(userName);
    loginForm.addComponent(passwordField);
    loginForm.addComponent(rememberMe);
    loginForm.addComponent(login);
    login.addStyleName(ValoTheme.BUTTON_PRIMARY);
    login.setDisableOnClick(true);
    login.setClickShortcut(ShortcutAction.KeyCode.ENTER);
    login.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            login();
        }
    });

    VerticalLayout loginLayout = new VerticalLayout();
    loginLayout.setSpacing(true);
    loginLayout.setSizeUndefined();

    if (request.getParameter("logout") != null) {
        loggedOutLabel = new Label("You have been logged out!");
        loggedOutLabel.addStyleName(ValoTheme.LABEL_SUCCESS);
        loggedOutLabel.setSizeUndefined();
        loginLayout.addComponent(loggedOutLabel);
        loginLayout.setComponentAlignment(loggedOutLabel, Alignment.BOTTOM_CENTER);
    }

    loginLayout.addComponent(loginFailedLabel = new Label());
    loginLayout.setComponentAlignment(loginFailedLabel, Alignment.BOTTOM_CENTER);
    loginFailedLabel.setSizeUndefined();
    loginFailedLabel.addStyleName(ValoTheme.LABEL_FAILURE);
    loginFailedLabel.setVisible(false);

    loginLayout.addComponent(label);
    loginLayout.addComponent(loginForm);
    loginLayout.setComponentAlignment(loginForm, Alignment.TOP_CENTER);

    VerticalLayout rootLayout = new VerticalLayout(loginLayout);
    rootLayout.setSizeFull();
    rootLayout.setComponentAlignment(loginLayout, Alignment.MIDDLE_CENTER);
    setContent(rootLayout);
    setSizeFull();
}

From source file:by.bigvova.ui.LoginUI.java

License:Apache License

private VerticalLayout root() {
    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();

    Component loginForm = buildLoginForm();
    layout.addComponent(loginForm);/*ww  w.j a v  a 2  s . co m*/
    layout.setComponentAlignment(loginForm, Alignment.MIDDLE_CENTER);
    return layout;
}

From source file:by.bigvova.views.UserView.UserView.java

License:Apache License

@Override
public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {
    setSizeFull();// ww w  . ja  v  a2s. c om
    footerButtons.setSpacing(true);
    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setSizeFull();

    Label header = new Label("Meal table");
    header.addStyleName(ValoTheme.LABEL_H1);
    layout.addComponent(header);

    layout.addComponent(mainGrid);
    layout.addComponent(footerButtons);
    layout.setExpandRatio(mainGrid, 1);

    setCompositionRoot(layout);
}

From source file:com.arcusys.liferay.vaadinplugin.ui.AdditionalDependenciesWindow.java

License:Apache License

public AdditionalDependenciesWindow(List<File> files, List<File> includedDependencies) {
    setCaption("Additional dependencies (WEB-INF/lib)");
    setWidth("350px");
    setHeight("350px");

    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();
    layout.setMargin(true);/*from ww  w .  jav  a  2  s.  c  o m*/
    layout.setSpacing(true);
    setContent(layout);

    dependencyContainer.addContainerProperty("caption", String.class, null);

    filterTextField = createFilterTextField();
    layout.addComponent(filterTextField);

    dependenciesSelector = createDependenciesSelector();
    populateSelector(files, includedDependencies);
    layout.addComponent(dependenciesSelector);
    layout.setExpandRatio(dependenciesSelector, 1);

    layout.addComponent(createCloseButton());
}

From source file:com.bsb.common.vaadin.embed.component.ComponentWrapper.java

License:Apache License

/**
 * Wraps the specified {@link Component} into a Vaadin application.
 *
 * @param component the component to wrap
 * @return an application displaying that component
 * @see #wrapLayout(com.vaadin.ui.Layout)
 * @see #wrapWindow(com.vaadin.ui.Window)
 *//* w  ww . j a  va2 s  .  co  m*/
public Application wrap(Component component) {
    if (component instanceof Window) {
        return wrapWindow((Window) component);
    }
    if (component instanceof Layout) {
        return wrapLayout((Layout) component);
    }

    // Ok it's a component we cannot handle directly
    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSizeFull();
    layout.addComponent(component);
    layout.setExpandRatio(component, 1);
    return wrapLayout(layout);
}

From source file:com.bsb.samples.vaadin.wizard.core.WizardSampleApplication.java

License:Apache License

@Override
public void init() {
    final VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setSizeFull();
    mainLayout.setMargin(true);//from ww  w.jav  a2  s . co  m

    final Wizard wizard = new Wizard();
    wizard.addStep(new FirstStep(), "First");
    wizard.addStep(new FinalStep(), "Final");
    wizard.setWidth(800, Sizeable.UNITS_PIXELS);
    wizard.setHeight(600, Sizeable.UNITS_PIXELS);

    mainLayout.addComponent(wizard);
    mainLayout.setComponentAlignment(wizard, Alignment.MIDDLE_CENTER);

    final Window mainWindow = new Window("Wizard Sample");
    mainWindow.setContent(mainLayout);
    setMainWindow(mainWindow);

}