List of usage examples for com.vaadin.ui Layout setCaption
public void setCaption(String caption);
From source file:com.mcparland.john.ComponentCollection.java
License:Apache License
/** * Create some tabs for each size/*from www. j a va2 s . co m*/ * * @param sizes * the sizes */ private void createTabs() { for (String size : sizes) { final Layout layout = createLayout(); layout.setCaption("Icons size " + size + " x " + size); addComponent(layout); for (String icon : icons) { final Image image = createImage(size, icon); DragAndDropWrapper imageWrap = new DragAndDropWrapper(image); imageWrap.setDragStartMode(DragStartMode.COMPONENT); imageWrap.setSizeUndefined(); layout.addComponent(imageWrap); } } }
From source file:de.unioninvestment.eai.portal.portlet.crud.mvp.views.DefaultFormView.java
License:Apache License
private Field<Boolean> createCheckBox(FormField field, int columns) { CheckBoxFormField checkBoxFormField = (CheckBoxFormField) field; Layout checkboxLayout = null; if (columns == 1) { checkboxLayout = new HorizontalLayout(); checkboxLayout.setCaption(field.getTitle()); } else {/*from w ww . ja va 2s .com*/ checkboxLayout = new VerticalLayout(); Label checkBoxLabel = new Label(field.getTitle()); checkboxLayout.addComponent(checkBoxLabel); } CheckBox checkBoxField = new CheckBox(); checkboxLayout.addComponent(checkBoxField); checkBoxField.setConverter(checkBoxFormField.getConverter()); checkBoxField.setPropertyDataSource(checkBoxFormField.getProperty()); checkBoxField.setImmediate(true); checkBoxField.addStyleName(field.getName()); // addField(field.getName(), checkBoxField); fieldLayout.addComponent(checkboxLayout); return checkBoxField; }