public void setShowUser(boolean showUser) { this.showUser = showUser; if (lblUser != null) { lblUser.setVisible(showUser); } } }
/** * 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)); }
/** * Disable all user input elements. * * @param text Status text to display. */ private void showStatus(String text) { lblStatus.setValue(text); loginPrompts.setVisible(false); lblStatus.setVisible(true); }
/** * Disable all user input elements. * * @param text State text to display. */ private void showState(final String text) { lblState.setValue(text); loginPrompts.setVisible(false); lblState.setVisible(true); }
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()); } }
/** * Sets the fixed filter. * * @param name The fixed filter. */ public void setFixedFilter(String name) { fixedFilter = findCategory(name); cboFilter.setVisible(fixedFilter == null); lblFilter.setVisible(fixedFilter != null); lblFilter.setValue(fixedFilter == null ? null : fixedFilter.getName()); refresh(); }
/** * Sets the message text to the specified value. If the text starts with an html tag, it will be * rendered as such. * * @param value The message text. * @param plainText Component to display plain text. * @param htmlText Component to display html. */ private void setMessageText(String value, Label plainText, Html htmlText) { value = StringUtils.trimToEmpty(value); final boolean isHtml = StringUtils.startsWithIgnoreCase(value, "<html>"); final boolean notEmpty = !value.isEmpty(); plainText.setVisible(notEmpty && !isHtml); htmlText.setVisible(notEmpty && isHtml); if (isHtml) { htmlText.setContent(value); } else { plainText.setValue(value); } }
/** * Sets the message text to the specified value. If the text starts with an html tag, it will be * rendered as such. * * @param value The message text. * @param plainText Component to display plain text. * @param htmlText Component to display html. * @param parent If not null, parent will be hidden if text is empty. */ private void setMessageText(String value, Label plainText, Html htmlText, Component parent) { value = StringUtils.trimToEmpty(value); boolean isHtml = StringUtils.startsWithIgnoreCase(value, "<html>"); boolean notEmpty = !value.isEmpty(); plainText.setVisible(notEmpty && !isHtml); htmlText.setVisible(notEmpty && isHtml); if (parent != null) { parent.setVisible(notEmpty); } if (isHtml) { htmlText.setContent(value); } else { plainText.setValue(value); } }
/** * 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.setValue(show ? message : ""); ZKUtil.toggleSclass(lblMessage, "alert-danger", "alert-warning", isError); } if (hideOnShowMessage != null) { hideOnShowMessage.setVisible(!show); } }
@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()); }
btnFavorite.setDisabled(list == this.favorites); boolean hasDateRange = (list != null && list.isDateRangeRequired()); lblDateRange.setVisible(hasDateRange); drpDateRange.setVisible(hasDateRange);
lblManagedList.setVisible(itemManager != null); lstManagedList.setModel((ListModelList<?>) null);