List of usage examples for com.vaadin.ui HorizontalLayout setWidthUndefined
@Override public void setWidthUndefined()
From source file:probe.com.view.core.HideOnClickLayout.java
/** * * @param title//from w w w. j ava 2 s . com * @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); } }
From source file:probe.com.view.core.PopupInfoBtn.java
private VerticalLayout initPopupLayout(VerticalLayout popupLayout, String header) { VerticalLayout popupBodyWrapper = new VerticalLayout(); popupBodyWrapper.setWidth("100%"); popupBodyWrapper.setHeight("100%"); VerticalLayout popupBodyLayout = new VerticalLayout(); popupBodyLayout.setWidth((popupLayout.getWidth() + 2) + "px"); popupBodyLayout.setHeightUndefined(); popupBodyLayout.setStyleName("pupupbody"); popupBodyLayout.setSpacing(true);//from ww w. jav a2s .c o m HorizontalLayout titleLayout = new HorizontalLayout(); titleLayout.setWidthUndefined(); titleLayout.setHeight("40px"); popupBodyLayout.addComponent(titleLayout); popupBodyLayout.addLayoutClickListener(this); Label label = new Label("<b>" + header + "</b>"); label.setStyleName("comparisonHeaders"); label.setContentMode(ContentMode.HTML); label.setWidth((popupLayout.getWidth() - 17) + "px"); titleLayout.addComponent(label); VerticalLayout closeBtn = new VerticalLayout(); closeBtn.setWidth("16px"); closeBtn.setHeight("16px"); closeBtn.setStyleName("closepanelbtn"); closeBtn.addLayoutClickListener(this); titleLayout.addComponent(closeBtn); titleLayout.setComponentAlignment(closeBtn, Alignment.TOP_RIGHT); popupLayout.setMargin(true); popupLayout.setSpacing(true); popupBodyLayout.addComponent(popupLayout); popupBodyWrapper.addComponent(popupBodyLayout); popupBodyWrapper.setComponentAlignment(popupBodyLayout, Alignment.MIDDLE_CENTER); return popupBodyWrapper; }