/** * Display the error message. * * @param message The error message. */ private void setError(String message) { lblError.setValue(message == null ? " " : message); }
/** * Add a row containing the specified header (left column) and value (right column). If * log.isDebugEnabled() is false then don't add row for empty or null values * * @param header Text for header column * @param value Text for value column */ protected void addRow(String header, String value) { if ((value == null || value.length() == 0) && !debug) { return; } Label lbl = new Label(); lbl.setValue(value); lbl.setTooltiptext(value); addRow(header, lbl); }
public String getValue(Component cmp) { return ((Label) cmp).getValue(); } });
/** Returns the label for the cell generated by the default renderer. */ private static Label newRenderLabel(String value) { final Label label = new Label(value != null && value.length() > 0 ? value : " "); label.setPre(true); //to make sure is generated, and then occupies some space return label; }
/** * Displays the specified message text on the form. * * @param text Message text to display. */ private void showMessage(final String text) { lblMessage.setValue(text); lblMessage.setVisible(!StringUtils.isEmpty(text)); }
private void setLabel(Label label, String value, Component associatedComponent) { label.setValue(value); label.setVisible(value != null && !value.isEmpty()); if (associatedComponent != null) { associatedComponent.setVisible(label.isVisible()); } }
addRow("-------DEBUG--------", clazz.getName()); row = getLastRow(); row.appendChild(new Label()); row.setSclass(Constants.SCLASS_DRILLDOWN_GRID);
/** * Handler for the STATUS event. The second level of the event name identifies the pane where * the status information (the event data) is to be displayed. For example, the event * STATUS.TIMING would display the status information in the pane whose associated label has an * id of "TIMING", creating one dynamically if necessary. If there is no second level event * name, the default pane is used. */ @Override public void eventCallback(String eventName, Object eventData) { String pane = StrUtil.piece(eventName, ".", 2); Label lbl = getLabel(pane.isEmpty() ? "default" : pane); lbl.setValue(eventData.toString()); lbl.setTooltiptext(eventData.toString()); }
private void setPatient(Patient patient) { this.patient = patient; hideLabels(); needsDetail = true; ZKUtil.detachChildren(pnlDetail); if (log.isDebugEnabled()) { log.debug("patient: " + patient); } if (patient == null) { lblName.setValue(noSelection); lblName.setSclass("z-bandbox-disabled"); btnDetail.setDisabled(true); return; } btnDetail.setDisabled(false); patientName = FhirUtil.formatName(patient.getName()); String mrn = FhirUtil.getMRNString(patient); lblName.setValue(patientName + (mrn.isEmpty() ? "" : " (" + mrn + ")")); lblName.setSclass(null); setLabel(lblDOB, formatDateAndAge(patient.getBirthDate()), lblDOBLabel); setLabel(lblDOD, formatDOD(patient.getDeceased()), lblDODLabel); setLabel(lblGender, patient.hasGender() ? patient.getGender().getDisplay() : null, null); Clients.resize(root); }
/** * 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); }
/** * 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); }
Label label = new Label(item.getText()); label.setPre(true); row.appendChild(label); row.setValue(item); Hbox hbox = new Hbox(); vbox.appendChild(hbox); label = new Label(issue.getSeverity().name() + ": "); label.setSclass("esig-severity-" + issue.getSeverity().name().toLowerCase()); hbox.appendChild(label); label = new Label(issue.getDescription()); label.setPre(true); hbox.appendChild(label); ESigItemIssueSeverity severity = issue.getSeverity();
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws IOException { super.renderProperties(renderer); int v = getMaxlength(); if (v > 0) renderer.render("maxlength", v); render(renderer, "multiline", isMultiline()); render(renderer, "pre", isPre()); final String val = getValue(); //allow deriving to override getValue() render(renderer, "value", val); org.zkoss.zul.impl.Utils.renderCrawlableText(val); }
@Override public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); noSelection = lblName.getValue(); IUser user = SecurityUtil.getAuthenticatedUser(); setLabel(lblUser, user.getFullName() + " @ " + user.getSecurityDomain().getName(), null); lblUser.setVisible(showUser); this.getEventManager().subscribe(PATIENT_CHANGE_EVENT, patientChangeListener); setPatient(PatientContext.getActivePatient()); }
/** Sets the value. */ public void setValue(String value) { if (value == null) value = ""; if (!Objects.equals(_value, value)) { _value = value; smartUpdate("value", getValue()); //allow deriving to override getValue() } }
/** * Create a new status pane and associated label. * * @param pane Name of pane (becomes the id of the label). * @return The newly created label. */ private Label createLabel(String pane) { boolean first = root.getFirstChild() == null; if (!first) { root.appendChild(new Splitter()); } Cell cell = new Cell(); if (first) { cell.setHflex("1"); } else { cell.setAlign("center"); } cell.setVflex("1"); cell.setSclass("cwf-header-cell"); root.appendChild(cell); Label lbl = new Label(); lbl.setId(pane); cell.appendChild(lbl); return lbl; } }
throw new UiException("The model template can only support Label component, not " + items[0]); final Label lbl = ((Label) items[0]); lbl.setAttribute(BinderImpl.VAR, varnm); lbl.setAttribute(itervarnm, iterStatus); lbl.detach(); return lbl.getValue();