List of usage examples for com.vaadin.ui PopupView setHeight
@Override public void setHeight(float height, Unit unit)
From source file:org.vaadin.tori.component.DebugControlPanel.java
License:Apache License
private Component createPostControl(final Method setter, final List<Post> posts) throws Exception { if (posts == null || posts.isEmpty()) { final Label label = new Label(getNameForCheckBox(setter)); label.setEnabled(false);/*from ww w. j av a2s . c o m*/ return label; } Component content = new CustomComponent() { { final CssLayout root = new CssLayout(); root.addStyleName("postselect-content"); root.addStyleName(setter.getName()); setCompositionRoot(root); root.setWidth("100%"); setWidth("400px"); root.addComponent(new Label(setter.getName())); for (final Post post : posts) { final Method getter = getGetterFrom(setter); final boolean getterValue = (Boolean) getter.invoke(authorizationService, post.getId()); final String authorName = post.getAuthor().getDisplayedName(); String postBody = post.getBodyRaw(); if (postBody.length() > 20) { postBody = postBody.substring(0, 20); } final CheckBox checkbox = new CheckBox(authorName + " :: " + postBody); checkbox.setValue(getterValue); checkbox.addValueChangeListener(new PostCheckboxListener(post, setter)); checkbox.setImmediate(true); checkbox.setWidth("100%"); root.addComponent(checkbox); } } }; final PopupView popup = new PopupView(getNameForCheckBox(setter), content); popup.setHideOnMouseOut(false); popup.setHeight(30.0f, Unit.PIXELS); return popup; }