Example usage for com.vaadin.ui VerticalLayout setWidthUndefined

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

Introduction

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

Prototype

@Override
    public void setWidthUndefined() 

Source Link

Usage

From source file:fr.amapj.view.engine.popup.corepopup.CorePopup.java

License:Open Source License

public void createPopup() {
    // Creation du contenu
    VerticalLayout contentLayout = new VerticalLayout();

    createContent(contentLayout);/*from   www .j av  a2 s  . c  om*/

    // Construction de la barre de boutons
    popupButtonBarLayout = new HorizontalLayout();
    popupButtonBarLayout.setMargin(false);
    popupButtonBarLayout.addStyleName("buttonbar");
    createButtonBar();
    popupButtonBarLayout.setSpacing(true);

    // Creation de la fenetre
    window.setClosable(true);
    window.setResizable(true);
    window.setModal(true);

    // Agencement suivant le type
    if (popupType == PopupType.CENTERFIT) {
        //
        contentLayout.setWidthUndefined();

        // 
        VerticalLayout mainLayout = new VerticalLayout();
        mainLayout.addStyleName("corepopup");
        mainLayout.setResponsive(true);
        mainLayout.addStyleName("centerfit-corepopup");
        mainLayout.addStyleName("centerfit-corepopup-" + getWidthRange());
        mainLayout.setWidth(null);

        //
        mainLayout.addComponent(contentLayout);

        //
        popupButtonBarLayout.setWidth(null);
        mainLayout.addComponent(popupButtonBarLayout);
        mainLayout.setComponentAlignment(popupButtonBarLayout, Alignment.MIDDLE_RIGHT);

        //
        window.setContent(mainLayout);
        window.setSizeUndefined();
    } else {
        //
        contentLayout.setWidth("100%");

        // 
        VerticalLayout mainLayout = new VerticalLayout();
        mainLayout.addStyleName("corepopup");
        mainLayout.setResponsive(true);
        mainLayout.addStyleName("fill-corepopup");
        mainLayout.addStyleName("fill-corepopup-" + getWidthRange());
        mainLayout.setWidth("100%");

        //
        mainLayout.addComponent(contentLayout);

        //
        popupButtonBarLayout.setWidth(null);
        mainLayout.addComponent(popupButtonBarLayout);
        mainLayout.setComponentAlignment(popupButtonBarLayout, Alignment.MIDDLE_RIGHT);

        //
        window.setContent(mainLayout);
        computeWindowSize();

        //
        window.setHeight(popupHeight);

    }

    // Partie commune dans tous les cas
    window.center();
    window.setCaption(popupTitle);
    window.setStyleName("opaque");

    if (colorStyle == ColorStyle.RED) {
        window.setStyleName("corepopup-red");
    }

}

From source file:org.hip.vif.web.util.RatingsTable.java

License:Open Source License

/** Constructor
 *
 * @param inRatings {@link RatingsHelper} the helper object to access the calculated values */
public RatingsTable(final RatingsHelper inRatings) {
    super();//from  ww  w  . j  a  v  a2s  .com
    setWidthUndefined();
    final VerticalLayout lLayout = new VerticalLayout();
    setCompositionRoot(lLayout);
    lLayout.setWidthUndefined();

    lLayout.addComponent(new Label(String.format(VIFViewHelper.TMPL_TITLE, "vif-caption", //$NON-NLS-1$
            Activator.getMessages().getMessage("ratings.table.title")), ContentMode.HTML)); //$NON-NLS-1$
    lLayout.addComponent(createRatingsTable(inRatings));
}

From source file:probe.com.view.core.HideOnClickLayout.java

/**
 *
 * @param title/*from   w w  w . j  av a 2s  . c  o m*/
 * @param fullBodyLayout
 * @param miniBodyLayout
 * @param infoText
 */
public HideOnClickLayout(String title, Layout fullBodyLayout, AbstractOrderedLayout miniBodyLayout,
        String infoText, VerticalLayout tipsIcon) {
    this.setMargin(new MarginInfo(false, false, false, false));
    this.setWidth("100%");
    this.fullBodyLayout = fullBodyLayout;
    this.fullBodyLayout.setVisible(false);
    this.miniBodyLayout = miniBodyLayout;

    titleLayout = new HorizontalLayout();
    titleLayout.setHeight("30px");
    titleLayout.setWidth("100%");
    titleLayout.setSpacing(true);
    HorizontalLayout titleHeaderLayout = new HorizontalLayout();
    titleHeaderLayout.setWidthUndefined();
    titleHeaderLayout.setSpacing(true);

    show = new ShowLabel();
    show.setHeight("20px");
    titleHeaderLayout.addComponent(show);
    titleHeaderLayout.setComponentAlignment(show, Alignment.BOTTOM_LEFT);

    titleLabel = new Label(title);
    titleLabel.setContentMode(ContentMode.HTML);

    titleLabel.setHeight("20px");

    titleHeaderLayout.addComponent(titleLabel);
    titleHeaderLayout.setComponentAlignment(titleLabel, Alignment.TOP_LEFT);
    titleHeaderLayout.addLayoutClickListener(HideOnClickLayout.this);

    VerticalLayout titleHeaderContainer = new VerticalLayout(titleHeaderLayout);
    titleHeaderContainer.setWidthUndefined();

    titleLayout.addComponent(titleHeaderContainer);

    info = new InfoPopupBtn(infoText);
    if (infoText != null && !infoText.trim().equalsIgnoreCase("")) {
        titleHeaderLayout.addComponent(info);
        titleLabel.setStyleName("filterShowLabel");
    } else {
        titleLabel.setStyleName("normalheader");
    }
    this.addComponent(titleLayout);
    this.addComponent(this.fullBodyLayout);
    this.setComponentAlignment(this.fullBodyLayout, Alignment.MIDDLE_CENTER);
    if (miniBodyLayout != null) {
        titleLayout.addComponent(this.miniBodyLayout);
        titleLayout.setComponentAlignment(this.miniBodyLayout, Alignment.BOTTOM_LEFT);
        titleLayout.setExpandRatio(this.miniBodyLayout, 5);
        titleLayout.setExpandRatio(titleHeaderContainer, 1);
        miniBodyLayout.addLayoutClickListener(HideOnClickLayout.this);
    }
    if (tipsIcon != null) {
        titleHeaderLayout.addComponent(tipsIcon);

    }
}

From source file:probe.com.view.core.HideOnClickLayout.java

/**
 *
 * @param title/*w  w  w.j  av a  2s.  c  om*/
 * @param fullBodyLayout
 * @param miniBodyLayout
 * @param align
 * @param infoText
 */
public HideOnClickLayout(String title, Component fullBodyLayout, AbstractOrderedLayout miniBodyLayout,
        Alignment align, String infoText, VerticalLayout tipsIcon) {
    this.setMargin(new MarginInfo(false, false, false, false));
    this.setWidth("100%");
    this.fullBodyLayout = fullBodyLayout;
    this.fullBodyLayout.setVisible(false);
    this.miniBodyLayout = miniBodyLayout;

    titleLayout = new HorizontalLayout();
    titleLayout.setHeight("30px");
    titleLayout.setSpacing(true);

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

    show = new ShowLabel();
    show.setHeight("20px");
    titleHeaderLayout.addComponent(show);
    titleHeaderLayout.setComponentAlignment(show, Alignment.BOTTOM_LEFT);

    titleLabel = new Label(title);
    titleLabel.setContentMode(ContentMode.HTML);

    titleLabel.setHeight("20px");

    titleHeaderLayout.addComponent(titleLabel);
    titleHeaderLayout.setComponentAlignment(titleLabel, Alignment.TOP_LEFT);
    titleHeaderLayout.addLayoutClickListener(HideOnClickLayout.this);

    VerticalLayout titleHeaderContainer = new VerticalLayout(titleHeaderLayout);
    titleHeaderContainer.setWidthUndefined();

    titleLayout.addComponent(titleHeaderContainer);

    info = new InfoPopupBtn(infoText);
    if (infoText != null && !infoText.trim().equalsIgnoreCase("")) {
        titleLayout.addComponent(info);
        titleLabel.setStyleName("filterShowLabel");
    } else {
        titleLabel.setStyleName("normalheader");
    }
    this.addComponent(titleLayout);
    this.addComponent(this.fullBodyLayout);
    this.setComponentAlignment(this.fullBodyLayout, align);
    if (miniBodyLayout != null) {
        titleLayout.addComponent(this.miniBodyLayout);
        titleLayout.setComponentAlignment(this.miniBodyLayout, Alignment.TOP_LEFT);
        titleLayout.setExpandRatio(this.miniBodyLayout, 5);
        titleLayout.setExpandRatio(titleHeaderContainer, 1);
        miniBodyLayout.addLayoutClickListener(HideOnClickLayout.this);
    }
    if (tipsIcon != null) {
        titleHeaderLayout.addComponent(tipsIcon);

    }

}