/** * Sets the caption. * * @param caption The caption. */ public void setCaption(String caption) { lblTitle.setLabel(caption); }
/** * Sets the button's label text. * * @param value The label text. */ public void setLabel(String value) { label.setLabel(value); }
private void updateLabel(Label label, String value) { if (label != null) { label.setLabel(value); } }
/** * Displays the specified message; * * @param msg Message to display. */ private void setMessage(String msg) { lblMessage.setLabel(msg); }
private void info(String action, String eventName) { lblInfo.setLabel(action + " '" + eventName + " ' event."); }
private void updateTime() { Calendar cal = Calendar.getInstance(DateUtil.getLocalTimeZone()); lblCurrentTime.setLabel(formatter == null ? "" : formatter.format(cal)); }
private void setLabel(Label label, String value, BaseUIComponent associatedComponent) { label.setLabel(value); label.setVisible(value != null && !value.isEmpty()); if (associatedComponent != null) { associatedComponent.setVisible(label.isVisible()); } }
/** * 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.setLabel(value); lbl.setHint(value); addRow(header, lbl); }
/** * Displays the description information for a property. * * @param propertyName Property name. * @param propertyDescription Property description. */ private void setPropertyDescription(String propertyName, String propertyDescription) { propInfo.setTitle(StrUtil.formatMessage(propertyName)); lblPropertyInfo.setLabel(StrUtil.formatMessage(propertyDescription)); }
/** * Displays the specified message. The list box is hidden if the message is not empty. * * @param message Message to display. */ private void showMessage(String message) { message = message == null ? null : StrUtil.getLabel(message); lblNoResultsFound.setLabel(message); lblNoResultsFound.setVisible(!StringUtils.isEmpty(message)); tblSrchResults.setVisible(!lblNoResultsFound.isVisible()); }
@EventHandler(value = "click", target = "btnUnlock") private void onClick$btnUnlock() { String s = txtPassword.getValue(); txtPassword.setValue(null); lblInfo.setLabel(null); txtPassword.focus(); if (!StringUtils.isEmpty(s)) { if (securityService.validatePassword(s)) { setMode(Mode.BASELINE); } else { lblInfo.setLabel(StrUtil.getLabel("cwf.sessionmonitor.lock.badpassword.message")); } } }
private void setUser(IUser user) { if (log.isDebugEnabled()) { log.debug("user: " + user); } if (currentUser != null && currentUser.equals(user)) { return; } currentUser = user; String text = user == null ? "" : user.getFullName(); if (user != null && user.getSecurityDomain() != null) { text += "@" + user.getSecurityDomain().getName(); } userHeader.setLabel(text); password.setVisible(SecurityUtil.getSecurityService().canChangePassword()); }
private void updateCountdown() { if (state == State.COUNTDOWN) { String s = nextMode().getLabel(TIMEOUT_WARNING, DateUtil.formatDuration(countdown, TimeUnit.SECONDS)); lblDuration.setLabel(s); timeoutPanel.addClass("alert:" + (countdown <= 10000 ? "alert-danger" : "alert-warning")); } }
protected void status(String message) { if (message != null) { grid.setVisible(false); status.setLabel(StrUtil.piece(message, "^")); status.setHint(StrUtil.piece(message, "^", 2, 999)); status.setVisible(true); } else { status.setVisible(false); status.setLabel(null); status.setHint(null); grid.setVisible(true); } }
/** * Displays a message to client. * * @param message Message to display to client. If null, message label is hidden. * @param isError If true, highlight the message to indicate an error. */ public void showMessage(String message, boolean isError) { showBusy(null); message = StrUtil.formatMessage(message); boolean show = message != null; if (lblMessage != null) { lblMessage.setVisible(show); lblMessage.setLabel(show ? message : ""); lblMessage.toggleClass("alert-danger", "alert-warning", isError); } if (hideOnShowMessage != null) { hideOnShowMessage.setVisible(!show); } }
private void setPatient(Patient patient) { this.patient = patient; hideLabels(); needsDetail = true; pnlDetail.destroyChildren(); if (log.isDebugEnabled()) { log.debug("patient: " + patient); } if (patient == null) { lblName.setLabel(noSelection); btnDetail.setDisabled(true); return; } btnDetail.setDisabled(false); patientName = FhirUtil.formatName(patient.getName()); String mrn = FhirUtil.getMRNString(patient); lblName.setLabel(patientName + (mrn.isEmpty() ? "" : " (" + mrn + ")")); setLabel(lblDOB, formatDateAndAge(patient.getBirthDate()), lblDOBLabel); setLabel(lblDOD, formatDOD(patient.getDeceased()), lblDODLabel); setLabel(lblGender, patient.hasGender() ? patient.getGender().getDisplay() : null, null); }
aboutParams = comp.getAttribute("params", AboutParams.class); imgIcon.setSrc(aboutParams.icon == null ? defaultIcon : aboutParams.icon); lblSource.setLabel(aboutParams.source == null ? defaultSource : aboutParams.source); btnCustom.setLabel(aboutParams.custom); btnCustom.setVisible(btnCustom.getLabel() != null);
@Override public void afterInitialized(BaseComponent root) { window = (Window) root; window.setTitle(StrUtil.formatMessage(root.getAttribute("title", ""))); lblPrompt.setLabel(StrUtil.formatMessage(root.getAttribute("prompt", ""))); LayoutIdentifier dfltLayout = root.getAttribute("dfltLayout", LayoutIdentifier.class); txtLayout.setValue(dfltLayout == null ? null : dfltLayout.name); boolean shared = dfltLayout == null ? LayoutManager.defaultIsShared() : dfltLayout.shared; (shared ? rbShared : rbPrivate).setChecked(true); radioGroup.setVisible(!root.getAttribute("hideScope", false)); allowDups = root.getAttribute("allowDups", true); }
@Override public void afterInitialized(BaseComponent root) { super.afterInitialized(root); page = root.getPage(); session = page.getSession(); noAutoLock = page.getAttribute(ATTR_NO_AUTO_LOCK, false); timeoutWindow = (BaseUIComponent) root; getEventManager().subscribe(SessionControl.EVENT_ROOT, applicationControlListener); IUser user = securityService.getAuthenticatedUser(); lblLocked.setLabel(user == null ? null : Mode.BASELINE.getLabel(TIMEOUT_EXPIRATION, user.getFullName() + "@" + user.getSecurityDomain().getName())); setMode(Mode.BASELINE); session.addSessionListener(sessionListener); }
@Override public void afterInitialized(BaseComponent root) { window = (Window) root; shared = defaultIsShared(); boolean manage = root.getAttribute("manage", false); window.setTitle(StrUtil.formatMessage(manage ? CAP_LAYOUT_MANAGE : CAP_LAYOUT_LOAD)); lblPrompt.setLabel(StrUtil.formatMessage(manage ? MSG_LAYOUT_MANAGE : MSG_LAYOUT_LOAD)); modelAndView = lstLayouts.getModelAndView(String.class); modelAndView.setRenderer(renderer); pnlSelect.setVisible(!manage); tbManage.setVisible(manage); ((Radiobutton) radioGroup.getChildAt(shared ? 0 : 1)).setChecked(true); pnlScope.addClass(manage ? "pull-right" : "pull-left"); upload.bind(btnImport); refresh(root.getAttribute("dflt", "")); }