private void addHeader(String text) { Label header = new Label(text); header.addClass("cwf-patientheader-header"); pnlDetail.addChild(header); }
/** * 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); }
/** * 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(); }
addRow("-------DEBUG--------", clazz.getName()); row = getLastRow(); row.addChild(new Label()); row.addClass(Constants.SCLASS_DRILLDOWN_GRID);
/** * 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); } } }
/** * 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()); }
/** * Creates and returns a test alert item. * * @param associateEvents If true, associate events with this item. * @return Test alert item. */ private BaseComponent newAlertitem(boolean associateEvents) { Div root = new Div(); // was vbox if (associateEvents) { associateEvents(root); } root.addChild(new Label("This is test alert #" + ++alertCount + (associateEvents ? " *" : "") + ".")); for (int i = 0; i < 10; i++) { root.addChild(new Label("This is line #" + i)); } return root; }
/** * Aborts any shutdown in progress. * * @param message Optional message to send to user. */ public void abortShutdown(String message) { if (shutdown) { updateShutdown(0); message = StringUtils.isEmpty(message) ? StrUtil.getLabel("cwf.sessionmonitor.shutdown.abort.message") : message; MessageWindow mw = page.getChild(MessageWindow.class); if (mw != null) { MessagePane mp = new MessagePane(); mp.setTitle(StrUtil.getLabel("cwf.sessionmonitor.shutdown.abort.title")); mp.addClass("flavor:alert-success"); mp.addChild(new Label(message)); mw.addChild(mp); } else { DialogUtil.showInfo(message); } } }
/** * 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); }