public Listitem(String label, String value, Object data) { super(label); setValue(value); setData(data); }
@Override public Listitem render(HelpTopic topic) { Listitem item = new Listitem(topic.getLabel()); item.setData(topic); return item; } }
/** * Render a list item. * * @param filter The associated patient list filter. * @return The rendered list item. */ @Override public Listitem render(AbstractPatientListFilter filter) { Listitem item = new Listitem(filter.getName()); item.setData(filter); return item; }
@Override public Listitem render(IPublisherInfo participant) { Listitem item = new Listitem(participant.getUserName()); item.setData(participant); if (exclusions != null && exclusions.contains(participant)) { item.setDisabled(true); item.addClass("chat-participant-active"); item.setVisible(!hideExclusions); } if (participant.equals(self)) { item.addClass("chat-participant-self"); } return item; }
/** * Render a list item. * * @param filter The associated PatientListFilter object. */ @Override public Listitem render(AbstractPatientListFilter filter) { Listitem item = new Listitem(filter.getName()); item.setHint(filter.getName()); item.setData(filter); return item; }
@Override public Listitem render(String data) { Listitem item = new Listitem(data); item.setData(new LayoutIdentifier(data, shared)); if (pnlSelect.isVisible()) { item.addEventForward(DblclickEvent.TYPE, btnOK, ClickEvent.TYPE); } return item; }
item.setData(range); addChild(item, isCustom ? null : customItem);
/** * Creates and returns a draggable list item. * * @param associateEvents If true, associate events with this item. * @return New list item. */ private Listitem newListitem(boolean associateEvents) { Listitem item = new Listitem(); if (associateEvents) { associateEvents(item); } String label = "Drop item #" + ++itemCount + (associateEvents ? " *" : ""); item.setLabel(label); // Set to info panel drop id. item.setDragid(IInfoPanel.DROP_ID); // Create and attach the object to be rendered. DroppedItem dropped = new DroppedItem(label, "This is the detail for drop item #" + itemCount); item.setData(dropped); // Associate the drop renderer with the item. DropUtil.setDropRenderer(item, dropRenderer); return item; }
private void processListResponses() { List<?> responses = control.getResponses(); listbox.setVisible(true); for (Object rsp : responses) { DialogResponse<?> response = (DialogResponse<?>) rsp; Listitem item = new Listitem(StrUtil.formatMessage(response.getLabel())); item.addEventListener(DblclickEvent.TYPE, clickListener); item.setData(response); listbox.addChild(item); if (response.isDefault()) { item.setSelected(true); } } if (listbox.getSelectedCount() == 0) { listbox.setSelectedItem(listbox.getChild(Listitem.class)); } addButton(LABEL_ID_CANCEL, "danger", (event) -> { close(null); }); addButton(LABEL_ID_OK, "success", (event) -> { close(listbox.getSelectedItem()); }); }
/** * Renders the list box contents. * * @param qr The search hit to render. */ @Override public Listitem render(HelpSearchHit qr) { Listitem item = new Listitem(); double score = qr.getConfidence(); item.setData(qr.getTopic()); Cell lc = new Cell(); lc.addChild(toImage(score)); String tt = StrUtil.formatMessage("@cwf.help.tab.search.score", score); lc.setHint(tt); item.addChild(lc); lc = new Cell(qr.getTopic().getLabel()); item.addChild(lc); lc = new Cell(qr.getTopic().getSource()); item.addChild(lc); return item; }