Example usage for com.vaadin.ui AbstractOrderedLayout addLayoutClickListener

List of usage examples for com.vaadin.ui AbstractOrderedLayout addLayoutClickListener

Introduction

In this page you can find the example usage for com.vaadin.ui AbstractOrderedLayout addLayoutClickListener.

Prototype

@Override
    public Registration addLayoutClickListener(LayoutClickListener listener) 

Source Link

Usage

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

/**
 *
 * @param title// www  . ja va 2  s. co 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/*from   w w w  .j a v  a  2s .co  m*/
 * @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);

    }

}