Example usage for com.vaadin.ui VerticalLayout setSizeUndefined

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

Introduction

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

Prototype

@Override
    public void setSizeUndefined() 

Source Link

Usage

From source file:com.expressui.core.view.entityselect.EntitySelect.java

License:Open Source License

/**
 * Opens a popup window with this component.
 *//*from w  w w .j av  a 2  s.c om*/
public void open() {
    popupWindow = new Window(getTypeCaption());
    popupWindow.addStyleName("e-entity-select-window");
    popupWindow.addStyleName("opaque");
    VerticalLayout layout = (VerticalLayout) popupWindow.getContent();
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setSizeUndefined();
    popupWindow.setSizeUndefined();
    popupWindow.setModal(true);
    popupWindow.setClosable(true);

    getResults().getEntityQuery().clear();
    getResults().search();
    configurePopupWindow(popupWindow);
    popupWindow.addComponent(this);

    getMainApplication().getMainWindow().addWindow(popupWindow);

    onDisplay();
}

From source file:com.expressui.core.view.export.ExportForm.java

License:Open Source License

/**
 * Pops up this export form.// ww w . j a va 2  s . co  m
 */
public void open() {
    popupWindow = new Window(getTypeCaption());
    popupWindow.addStyleName("e-export-form-window");
    popupWindow.addStyleName("opaque");
    VerticalLayout layout = (VerticalLayout) popupWindow.getContent();
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setSizeUndefined();
    popupWindow.setSizeUndefined();
    popupWindow.setModal(false);
    popupWindow.setClosable(true);

    popupWindow.addComponent(this);
    getMainApplication().getMainWindow().addWindow(popupWindow);

    onDisplay();
}

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

License:Open Source License

private void initialize() {
    addStyleName("e-entity-form-window");
    addStyleName("opaque");
    VerticalLayout layout = (VerticalLayout) getContent();
    layout.setMargin(true);//from  www . j a  va 2 s .  com
    layout.setSpacing(true);
    layout.setSizeUndefined();
    setSizeUndefined();
    setModal(true);
    setClosable(true);
    setScrollable(true);
    addListener(CloseEvent.class, this, "onClose");

    MainApplication.getInstance().getMainWindow().addWindow(this);
}

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();/*from  w w w .  j a va2  s  .co  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.form.TypedForm.java

License:Open Source License

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

    form = new ConfigurableForm();
    form.setSizeUndefined();

    form.setWriteThrough(true);
    form.setInvalidCommitted(true);
    form.setImmediate(true);
    form.setValidationVisibleOnCommit(true);

    formFieldSet.setForm(this);
    init(formFieldSet);
    formFieldSet.assertValid();
    form.setFormFieldFactory(new TypedFormFieldFactory(getFormFieldSet()));

    final Layout gridLayout = getFormFieldSet().createGridLayout();
    form.setLayout(gridLayout);

    form.getFooter().addStyleName("e-typed-form-footer");
    createFooterButtons((HorizontalLayout) form.getFooter());

    VerticalLayout tabsAndForm = new VerticalLayout();
    setDebugId(tabsAndForm, "tabsAndForm");
    tabsAndForm.setSizeUndefined();
    if (getFormFieldSet().hasTabs()) {
        initializeTabs(tabsAndForm);
        if (getFormFieldSet().hasOptionalTabs()) {
            initializeOptionalTabs(tabsAndForm);
        }
    }
    tabsAndForm.addComponent(form);

    Label spaceLabel = new Label("</br>", Label.CONTENT_XHTML);
    spaceLabel.setSizeUndefined();
    tabsAndForm.addComponent(spaceLabel);

    addComponent(makeCollapsible(getTypeCaption(), tabsAndForm));
    labelRegistry.registerLabels(getFormFieldSet());
}

From source file:com.foc.vaadin.FocWebApplication.java

License:Apache License

protected void init2(VaadinRequest request) {
    // Create the footer Layout with a simple Label
    VerticalLayout footerLayout = new VerticalLayout();
    {//from   ww  w  .j a  v  a  2  s.co  m
        footerLayout.addComponent(new Label("This is the footer always visible"));
        footerLayout.setHeight("-1px");
    }

    // Create the Body Panel that contains a VerticalLayout itself
    Panel panel = new Panel();
    {
        panel.setSizeFull();// Panel size is undefined
        final VerticalLayout panelLayout = new VerticalLayout();
        panelLayout.setSizeUndefined();// Panel Layout size is undefined
        panel.setContent(panelLayout);

        // Fill the panel layout with lots of labels to exceed the window height 
        for (int i = 0; i < 200; i++) {
            panelLayout.addComponent(new Label("Thank you for clicking"));
        }
    }

    // Put all in the the MainVerticalLayout
    final VerticalLayout mainVerticalLayout = new VerticalLayout();
    mainVerticalLayout.setSizeFull();// Main Layout is set to size Full so that it fills all the height
    mainVerticalLayout.addComponent(panel);
    mainVerticalLayout.addComponent(footerLayout);
    mainVerticalLayout.setExpandRatio(panel, 1);
    setContent(mainVerticalLayout);
}

From source file:com.gmail.volodymyrdotsenko.cms.fe.vaadin.LoginUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {
    langRepo.findAll().forEach(e -> {
        langSet.add(e.getCode());//from   w  w  w .j  a  va2 s  .  c o  m
    });

    lang = new ComboBox("Language", langSet);

    getPage().setTitle("CMS");

    FormLayout loginForm = new FormLayout();
    loginForm.setSizeUndefined();

    loginForm.addComponent(userName = new TextField("Username"));
    userName.setRequired(true);
    loginForm.addComponent(passwordField = new PasswordField("Password"));
    passwordField.setRequired(true);
    loginForm.addComponent(rememberMe = new CheckBox("Remember me"));
    loginForm.addComponent(lang);
    lang.setRequired(true);
    lang.setNullSelectionAllowed(false);
    loginForm.addComponent(login = new Button("Login"));
    login.addStyleName(ValoTheme.BUTTON_PRIMARY);
    login.setDisableOnClick(true);
    login.setClickShortcut(ShortcutAction.KeyCode.ENTER);
    login.addClickListener(e -> {
        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(loginForm);
    loginLayout.setComponentAlignment(loginForm, Alignment.TOP_CENTER);

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

    String currentLang = getLocale().getLanguage();
    if (langSet.contains(currentLang))
        lang.select(currentLang);
    else
        lang.select("en");
}

From source file:com.haulmont.cuba.web.log.LogWindow.java

License:Apache License

private void initUI() {
    ClientConfig clientConfig = AppBeans.<Configuration>get(Configuration.NAME).getConfig(ClientConfig.class);

    String closeShortcut = clientConfig.getCloseShortcut();
    KeyCombination closeCombination = KeyCombination.create(closeShortcut);

    com.vaadin.event.ShortcutAction closeShortcutAction = new com.vaadin.event.ShortcutAction(
            "closeShortcutAction", closeCombination.getKey().getCode(),
            KeyCombination.Modifier.codes(closeCombination.getModifiers()));

    addActionHandler(new com.vaadin.event.Action.Handler() {
        @Override/*from  w w  w  . j a  va 2  s. com*/
        public com.vaadin.event.Action[] getActions(Object target, Object sender) {
            return new com.vaadin.event.Action[] { closeShortcutAction };
        }

        @Override
        public void handleAction(com.vaadin.event.Action action, Object sender, Object target) {
            if (Objects.equals(action, closeShortcutAction)) {
                close();
            }
        }
    });

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

    Panel scrollablePanel = new Panel();
    scrollablePanel.setSizeFull();
    VerticalLayout scrollContent = new VerticalLayout();
    scrollContent.setSizeUndefined();
    scrollablePanel.setContent(scrollContent);

    final Label label = new Label();
    label.setContentMode(ContentMode.HTML);
    label.setValue(writeLog());
    label.setSizeUndefined();
    label.setStyleName("c-log-content");

    ((Layout) scrollablePanel.getContent()).addComponent(label);

    HorizontalLayout topLayout = new HorizontalLayout();
    topLayout.setWidth("100%");
    topLayout.setHeightUndefined();

    Messages messages = AppBeans.get(Messages.NAME);
    Button refreshBtn = new CubaButton(messages.getMessage(getClass(), "logWindow.refreshBtn"),
            (Button.ClickListener) event -> label.setValue(writeLog()));

    topLayout.addComponent(refreshBtn);

    layout.addComponent(topLayout);
    layout.addComponent(scrollablePanel);

    layout.setExpandRatio(scrollablePanel, 1.0f);
}

From source file:com.hivesys.dashboard.view.repository.DragAndDropBox.java

private void showComponent(final Component c, final String name) {
    final VerticalLayout layout = new VerticalLayout();
    layout.setSizeUndefined();
    layout.setMargin(true);/*from   ww w. j  a  v a 2  s  .  co  m*/
    final Window w = new Window(name, layout);
    w.addStyleName("dropdisplaywindow");
    w.setSizeUndefined();
    w.setResizable(false);
    c.setSizeUndefined();
    layout.addComponent(c);
    UI.getCurrent().addWindow(w);

}

From source file:com.jain.addon.component.crud.JCrudWindow.java

License:Apache License

private void createActions(VerticalLayout layout) {
    if (!isViewOnly()) {
        ActionBar<JCrudWindow<T>> hLayout = new ActionBar<JCrudWindow<T>>(null, this);

        VerticalLayout vLayout = new VerticalLayout();
        vLayout.setSizeUndefined();
        vLayout.setStyleName(JNStyleConstants.J_VIEW);
        vLayout.addComponent(hLayout);/*from   w  w  w . ja v  a 2 s.com*/

        layout.addComponent(vLayout);
        layout.setComponentAlignment(vLayout, Alignment.MIDDLE_CENTER);
        layout.setExpandRatio(vLayout, 1);
    }
}