List of usage examples for com.vaadin.ui Label setWidth
@Override public void setWidth(String width)
From source file:com.esofthead.mycollab.vaadin.ui.form.field.DateTimeViewField.java
License:Open Source License
@Override protected Component initContent() { final Label l = new Label(); l.setWidth("100%"); if (date == null) { l.setValue(" "); l.setContentMode(ContentMode.HTML); } else {//from w ww . j ava 2 s. com l.setValue(AppContext.formatDateTime(date)); } return l; }
From source file:com.esofthead.mycollab.vaadin.ui.form.field.DateViewField.java
License:Open Source License
@Override protected Component initContent() { final Label l = new Label(); l.setWidth("100%"); if (date == null) { l.setValue(" "); l.setContentMode(ContentMode.HTML); } else {//ww w. ja va 2s .c o m l.setValue(AppContext.formatDate(date)); } return l; }
From source file:com.esofthead.mycollab.vaadin.ui.form.field.DefaultViewField.java
License:Open Source License
@Override protected Component initContent() { final Label label = new Label(); label.setWidth("100%"); label.setContentMode(contentMode);// w w w . j a v a 2 s.c o m if (StringUtils.isNotBlank(value)) { label.setValue(value); } else { label.setValue(""); } return label; }
From source file:com.esofthead.mycollab.vaadin.ui.form.field.I18nFormViewField.java
License:Open Source License
@Override protected Component initContent() { final Label label = new Label(); label.setWidth("100%"); label.setContentMode(ContentMode.TEXT); if (org.apache.commons.lang3.StringUtils.isNotBlank(key)) { try {//from ww w .j av a 2s . c om String value = AppContext.getMessage(enumClass, key); label.setValue(value); } catch (Exception e) { label.setValue(""); } } else { label.setValue(""); } return label; }
From source file:com.esofthead.mycollab.vaadin.ui.form.field.PrettyDateTimeViewField.java
License:Open Source License
@Override protected Component initContent() { final Label l = new Label(); l.setWidth("100%"); if (date == null) { l.setValue(" "); l.setContentMode(ContentMode.HTML); } else {/* www . j a v a2 s . c om*/ l.setValue(AppContext.formatPrettyTime(date)); l.setDescription(AppContext.formatDateTime(date)); } return l; }
From source file:com.esofthead.mycollab.vaadin.ui.form.field.PrettyDateViewField.java
License:Open Source License
@Override protected Component initContent() { final Label l = new Label(); l.setWidth("100%"); if (date == null) { l.setValue(" "); l.setContentMode(ContentMode.HTML); } else {/*from ww w. j a v a2 s .c o m*/ l.setValue(AppContext.formatPrettyTime(date)); l.setDescription(AppContext.formatDate(date)); } return l; }
From source file:com.esofthead.mycollab.vaadin.ui.form.field.RichTextViewField.java
License:Open Source License
@Override protected Component initContent() { if (org.apache.commons.lang3.StringUtils.isBlank(value)) { Label lbl = new Label(" "); lbl.setContentMode(ContentMode.HTML); lbl.setWidth("100%"); return lbl; } else {/*from w w w . j a va2 s . c om*/ final Label link = new Label(StringUtils.formatRichText(value), ContentMode.HTML); link.setWidth("100%"); return link; } }
From source file:com.esofthead.mycollab.vaadin.ui.form.field.RoundNumerField.java
License:Open Source License
@Override protected Component initContent() { final Label label = new Label(); label.setWidth("100%"); if (value != null) { double d = value.doubleValue(); d = Math.round(d * 100);/*from w w w .j a va 2s . co m*/ d = d / 100; label.setValue(d + ""); } else { label.setValue(""); } return label; }
From source file:com.esofthead.mycollab.vaadin.ui.form.field.UrlLinkViewField.java
License:Open Source License
@Override protected Component initContent() { if (StringUtils.isBlank(url)) { Label lbl = new Label(" "); lbl.setContentMode(ContentMode.HTML); lbl.setWidth("100%"); return lbl; } else {// w w w . j a va 2 s . c o m final Link link = new UrlLink(url); link.setWidth(UIConstants.DEFAULT_CONTROL_WIDTH); return link; } }
From source file:com.esofthead.mycollab.vaadin.ui.form.field.UrlSocialNetworkLinkViewField.java
License:Open Source License
@Override protected Component initContent() { if (StringUtils.isBlank(caption)) { Label lbl = new Label(" "); lbl.setContentMode(ContentMode.HTML); lbl.setWidth("100%"); return lbl; } else {/*from www.ja va2 s. co m*/ linkAccount = (linkAccount == null) ? "" : linkAccount; final Link link = new SocialNetworkLink(caption, linkAccount); link.setWidth(UIConstants.DEFAULT_CONTROL_WIDTH); return link; } }