public <T> Listitem(String label, T value) { setLabel(label); setValue(value); }
@SuppressWarnings("rawtypes") private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { s.defaultReadObject(); _model = (ListModel) s.readObject(); didDeserialize(_model); _renderer = (ListitemRenderer) s.readObject(); didDeserialize(_renderer); init(); int offset = s.readInt(); afterUnmarshal(offset); int limit = s.readInt(); resetDataLoader(false); // no need to reset, it will reset the old reference. getDataLoader().init(this, offset, limit); if (_model != null) { initDataListener(); getDataLoader().setLoadAll(_renderAll); // Map#Entry cannot be serialized, we have to restore them if (_model instanceof ListModelMap) { for (Listitem item : getItems()) item.setValue(_model.getElementAt(item.getIndex())); } } int size = s.readInt(); if (size > 0) { List groupsInfo = (List) s.readObject(); for (int i = 0; i < size; i++) _groupsInfo.add((int[]) groupsInfo.get(i)); } }
item.setValue(sb.toString());
/** * Adds the service location to the specified listbox. * * @param location Service location to add. * @param lstLocation Listbox to receive the location. * @return The added list item. */ public static Listitem locationAdd(Location location, Listbox lstLocation) { Listitem item = new Listitem(location.getName()); item.setValue(location); //item.setTooltiptext(location.getDescription()); item.addForward(Events.ON_DOUBLE_CLICK, "btnOK", Events.ON_CLICK); lstLocation.appendChild(item); lstLocation.setDisabled(false); return item; }
@Override public void renderItem(Listitem item, Object data) { Practitioner provider = data instanceof Practitioner ? (Practitioner) data : ProviderUtil.fetchProvider(StrUtil .piece((String) data, StrUtil.U)); item.setValue(provider); createCell(item, provider.getName()); Practitioner primaryProvider = encounterProvider.getPrimaryProvider(); item.setSclass(primaryProvider == null || !provider.equals(primaryProvider) ? null : Constants.SCLASS_PRIMARY); item.addForward(Events.ON_DOUBLE_CLICK, item.getListbox(), null); }
/** * Adds the service location to the specified listbox. * * @param location Service location to add. * @param lstLocation Listbox to receive the location. * @return The added list item. */ public static Listitem locationAdd(Location location, Listbox lstLocation) { Listitem item = new Listitem(location.getName().getValue()); item.setValue(location); //item.setTooltiptext(location.getDescription()); item.addForward(Events.ON_DOUBLE_CLICK, "btnOK", Events.ON_CLICK); lstLocation.appendChild(item); lstLocation.setDisabled(false); return item; }
@Override public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); String[] subsets = (String[]) arg.get("subsets"); TermSubset termSubsets = TermUtil.getSubset(null); for (String subset : subsets) { Listitem item = new Listitem(termSubsets.getMemberName(subset)); item.setValue(subset); lbSubset.appendChild(item); } if (subsets.length == 1) { pnlSubset.setVisible(false); lbSubset.setSelectedIndex(0); ((Window) root).getCaption().setLabel(lbSubset.getSelectedItem().getLabel()); } treeSearch.setItemRenderer(termMatchRenderer); }
@Override public void renderItem(Listitem item, Object data) { Participant participant; if (data instanceof Participant) { participant = (Participant) data; } else if (data instanceof IResource) { participant = new Participant(); participant.setIndividual(new ResourceReferenceDt((IResource) data)); } else { return; } item.setValue(participant); createCell(item, FhirUtil.formatName(EncounterUtil.getName(participant))); item.setSclass(isPrimary(participant) ? Constants.SCLASS_PRIMARY : null); item.addForward(Events.ON_DOUBLE_CLICK, item.getListbox(), null); }
@Override public void renderItem(Listitem item, Object data) { Encounter encounter = data instanceof Encounter ? (Encounter) data : parse((String) data); item.setValue(encounter); item.addForward(Events.ON_DOUBLE_CLICK, item.getListbox(), null); item.setImage(EncounterUtil.isLocked(encounter) ? Constants.ICON_LOCKED : null); createCell(item, encounter.getLocation()); createCell(item, encounter.getPeriod()); createCell(item, encounter.getType()); }
li.setValue(securityDomain); lstDomain.appendChild(li); li.appendChild(new Listcell(securityDomain.getName()));
li.setValue(organization); j_domain.appendChild(li); IdentifierDt abbr = FhirUtil.getIdentifier(organization.getIdentifier(), "ABBREVIATION");
/** * 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.setDraggable(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.setValue(dropped); // Associate the drop renderer with the item. DropUtil.setDropRenderer(item, dropRenderer); return item; }
@Override public void renderItem(Listitem item, Object data) { Encounter encounter = data instanceof Encounter ? (Encounter) data : parse((String) data); item.setValue(encounter); item.addForward(Events.ON_DOUBLE_CLICK, item.getListbox(), null); Span span = new Span(); span.setSclass(EncounterUtil.isLocked(encounter) ? Constants.SCLASS_LOCKED : null); createCell(item, span); Location location = ClientUtil.getResource(encounter.getLocationFirstRep().getLocation(), Location.class); createCell(item, location == null ? null : location.getName()); createCell(item, encounter.getPeriod().getStart()); createCell(item, encounter.getTypeFirstRep().getCodingFirstRep().getDisplay()); }
private void renderNote(ProblemNote pn) { Listitem item = new Listitem(); lstNotes.appendChild(item); Listcell cell = addCell(item, ""); cell.setSclass("bgo-problem-icon-cell"); Toolbarbutton btn = new Toolbarbutton("", DELETE_ICON); btn.setTooltiptext("Delete this note."); btn.addForward(Events.ON_CLICK, lstNotes, "onDeleteNote"); cell.appendChild(btn); addCell(item, pn.getNumber()); // Note # addCell(item, pn.getNarrative()).setHflex("1"); // Narrative addCell(item, DateUtil.formatDate(pn.getDateAdded())); // Date added addCell(item, pn.getAuthor()); // Author item.setValue(pn); }