private void addDetail(String text, String label) { if (StringUtils.isEmpty(text)) { return; } Div div = new Div(); pnlDetail.addChild(div); if (label != null) { Label lbl = new Label(label); lbl.addClass("cwf-patientheader-label"); div.addChild(lbl); } div.addChild(new Label(text)); }
/** * Render detail view for the specified patient. * * @param patient Patient whose detail view is to be rendered. */ @Override public BaseUIComponent render(Patient patient) { BaseUIComponent root = new Div(); root.addClass("fujion-layout-vertical text-center"); root.addStyle("align-items", "center"); if (confirmAccess(patient, root)) { renderDemographics(patient, root); } return root; }
/** * Bind a component to this command and action. * * @param component The component to be bound. * @param action The action to be executed when the command is invoked. */ /*package*/void bind(BaseUIComponent component, IAction action) { BaseUIComponent dummy = new Div(); dummy.setAttribute(ATTR_DUMMY, true); dummy.setVisible(false); dummy.setParent(component.getPage()); ActionUtil.addAction(dummy, action, CommandEvent.TYPE); bind(component, dummy); }
/** * 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); }
/** * 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; }