/** * Sets the button's label text. * * @param value The label text. */ public void setLabel(String value) { label.setLabel(value); }
/** * 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); }
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()); } }
/** * Adds a text entry to the dialog panel. * * @param text Text to add. * @param sclass SClass of the added text. */ private void newLabel(String text, String sclass) { Label lbl = new Label(text); lbl.addClass(sclass); //lbl.setMultiline(true); //lbl.setPre(true); pnlDialog.addChild(lbl); lbl.scrollIntoView(); }
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); } }
public void setShowUser(boolean showUser) { this.showUser = showUser; if (lblUser != null) { lblUser.setVisible(showUser); } }
addRow("-------DEBUG--------", clazz.getName()); row = getLastRow(); row.addChild(new Label()); row.addClass(Constants.SCLASS_DRILLDOWN_GRID);
/** * 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, BaseComponent container) { Row row = new Row(); grid.getRows().addChild(row); Div div = new Div(); Label label = new Label(header + ":"); label.addStyle("font-weight", "bold"); label.addStyle("word-wrap", "word-break"); row.addChild(div); row.addChild(label); row.addChild(container); }
@Override public void afterInitialized(BaseComponent comp) { super.afterInitialized(comp); noSelection = lblName.getLabel(); IUser user = SecurityUtil.getAuthenticatedUser(); lblUser.setVisible(showUser); if (user == null) { setLabel(lblUser, "Unknown User", null); } else { setLabel(lblUser, user.getFullName() + " @ " + user.getSecurityDomain().getName(), null); } setPatient(PatientContext.getActivePatient()); PatientContext.getPatientContext().addListener(patientChangeListener); }
/** * Creates a label for a string value. * * @param parent BaseComponent that will be the parent of the label. * @param value Value to be used as label text. * @param prefix Value to be used as a prefix for the label text. * @param style Style to be applied to the label. * @param asFirst If true, the label is prepended to the parent. If false, it is appended. * @return The newly created label. */ public Label createLabel(BaseComponent parent, Object value, String prefix, String style, boolean asFirst) { Label label = new Label(createLabelText(value, prefix)); label.setStyles(style); parent.addChild(label, asFirst ? 0 : -1); return label; }
/** * Adds a demographic element to the demographic panel. * * @param root Root component. * @param labelId The id of the label to use. * @param object The element to be added. * @param style CSS styling to apply to element (may be null). */ protected void addDemographic(BaseUIComponent root, String labelId, Object object, String style) { object = object instanceof PrimitiveType ? ((PrimitiveType<?>) object).getValue() : object; String value = object == null ? null : object instanceof Date ? DateUtil.formatDate((Date) object) : object.toString().trim(); if (!StringUtils.isEmpty(value)) { Label lbl = new Label((labelId == null ? "" : getDemographicLabel(labelId) + ": ") + value); root.addChild(lbl); if (style != null) { lbl.addStyles(style); } } }
/** * Returns the button's label text. * * @return The label text. */ public String getLabel() { return label.getLabel(); }
public void setColor(String color) { this.color = color; lblCurrentTime.addStyle("color", color); }
public Label(String label) { super(label); addClass("flavor:label-default"); }
private void hideLabels() { for (Label child : tbPatient.getChildren(Label.class)) { if (child != lblName) { child.setVisible(false); } } }
/** * Called by the info panel to rendered the dropped UI component. * * @param droppedItem The dropped UI component (a list item in this case). * @return The top level component of the rendering. */ @Override public BaseComponent renderDroppedItem(BaseComponent droppedItem) { DroppedItem item = getDroppedItem(droppedItem); return new Label(item.getItemDetail()); }
/** * Returns the caption of the panel. * * @return The panel caption. */ public String getCaption() { return lblTitle.getLabel(); }