public void setValue(Component cmp, Boolean multiline) { ((Label) cmp).setMultiline(multiline); }
/** * Add a row containing the specified header (left column) and value container (right column). * * @param header Text for header column * @param container Object containing text value(s) */ protected void addRow(String header, Component container) { Row row = new Row(); grid.getRows().appendChild(row); Div div = new Div(); Label label = new Label(header + ":"); label.setMultiline(true); label.setMaxlength(40); label.setStyle("font-weight:bold;word-wrap:word-break"); row.appendChild(div); row.appendChild(label); row.appendChild(container); }
/** * Render the list item for the specified document. * * @param item List item to render. * @param doc The document associated with the list item. */ @Override public void renderItem(final Listitem item, final Document doc) { final Listcell cell = new Listcell(); item.appendChild(cell); final Div sep = new Div(); sep.setSclass("vista-documents-sep"); cell.appendChild(sep); final Div div = new Div(); div.setSclass(Constants.SCLASS_TEXT_REPORT_TITLE); cell.appendChild(div); final Hbox boxHeader = new Hbox(); final Label header = new Label(doc.getTitle()); header.setZclass(Constants.SCLASS_TEXT_REPORT_TITLE); boxHeader.appendChild(header); div.appendChild(boxHeader); Label body = new Label(doc.getBody()); body.setMultiline(true); body.setPre(true); cell.appendChild(body); }