public List<E> subList(int fromIndex, int toIndex) { List<E> list = _list.subList(fromIndex, toIndex); //bug 2448987: sublist must be live return new ListModelList<E>(list, true); }
@Override protected void initModel(List<FamilyMemberHistory> entries) { model.addAll(entries); }
public boolean removeAll(Collection<?> c) { if (_list == c || this == c) { // special case clearSelection(); clear(); return true; } return removePartial(c, true); }
private void refreshPatientList() { timer.stop(); if (activeList != null) { Collection<PatientListItem> items; if (activeList.isPending()) { items = pendingListItem; timer.start(); } else { items = activeList.getListItems(); } ListModelList<PatientListItem> model = items == null ? new ListModelList<PatientListItem>() : new ListModelList<PatientListItem>(items); if (model.isEmpty()) { model.add(new PatientListItem(null, txtNoPatients)); } lstPatientList.setModel(model); lblPatientList.setValue(activeList.getDisplayName()); } else { lstPatientList.setModel((ListModel<?>) null); lblPatientList.setValue(txtNoList); } setActivePatient((Patient) null); }
private void refreshList() { ProblemFilter filter = getFilter(); boolean bHasPriority = false; lbProblems.setModel((ListModelList<?>) null); ListModelList<Problem> model = new ListModelList<Problem>(); for (Problem problem : problemList) { if (filter.include(problem)) { model.add(problem); bHasPriority |= problem.getPriority().length() > 0; } } if (colSort == null) { colSort = (Listheader) lbProblems.getListhead().getChildren().get(bHasPriority ? 4 : 0); } lbProblems.setModel(model); sortProblems(); updateControls(); Events.echoEvent("onResize", lbProblems, null); }
public void onAsyncRPCComplete(AsyncRPCCompleteEvent event) { List<String> results = toList(event.getData(), null, "\r"); String error = getError(results); if (error != null) { status(error); model.clear(); } else { for (String result : results) { T value = parseData(result); if (value != null) { model.add(value); } } renderData(); } }
@Override protected void initModel(List<AllergyIntolerance> entries) { for (AllergyIntolerance adr : entries) { if (!exclusions.contains(adr.getStatusElement())) { for (Event event : adr.getEvent()) { model.add(event); } } } }
@Override public void eventCallback(String eventName, String eventData) { String[] pcs = eventData.split("\\^"); AntiCoagRecord record = findRecord(pcs[0]); switch (Integer.parseInt(pcs[2])) { case 0: // add if (record == null) { refresh(); } break; case 1: // edit refresh(); break; case 2: // delete if (record != null) { model.remove(record); } break; } }
public void setValue(BindELContext ctx, Object value) { ListModel model = getModel(); if (model instanceof ListModelArray) { ((ListModelArray<Object>) model).set(((ListModelArray<Object>) model).indexOf(getData()), value); _data = value; // update it } else if (model instanceof ListModelList<?>) { ((ListModelList<Object>) model).set(((ListModelList<Object>) model).indexOf(getData()), value); _data = value; // update it } }
@Override protected void threadFinished(ZKThread thread) { try { thread.rethrow(); } catch (Throwable e) { status("An unexpected error was encountered: " + ZKUtil.formatExceptionForDisplay(e)); return; } model.clear(); initModel(FhirUtil.getEntries((Bundle) thread.getAttribute("bundle"), resourceClass)); renderData(); }
/** * Places the highlight indicator next to the specified notification. If the notification is not * found or is null, the indicator is hidden. * * @param notification Notification to highlight. */ protected void highlightNotification(Notification notification) { int i = notification == null ? -1 : model.indexOf(notification); if (i >= 0) { Listitem item = lstNotification.getItemAtIndex(i); imgIndicator.setParent(item.getFirstChild()); imgIndicator.setVisible(true); Clients.scrollIntoView(item); } else { imgIndicator.setVisible(false); } }
/** * Creates a notification from raw data. Will be added to the model unless filtered. Will * generate a slide-down message alert if its priority exceeds the set threshold. * * @param data Raw notification data. */ private void addNotification(String data) { Notification notification = new Notification(data); service.getNotificationMessage(notification); if (radAll.isChecked() || (notification.hasPatient() && patient != null && notification.getDfn() .equals(patient.getId().getIdPart()))) { model.add(notification); } if (alertThreshold != null && notification.getPriority().ordinal() <= alertThreshold.ordinal()) { MessageInfo mi = new MessageInfo(notification.getDisplayText(), "New Notification", PriorityRenderer.getColor(notification.getPriority()), alertDuration * 1000, null, "cwf.fireLocalEvent('ALERT.INFO', '" + notification.getAlertId() + "');"); getEventManager().fireLocalEvent(MessageWindow.EVENT_SHOW, mi); } }
model.remove(notification);
protected boolean populateListbox(Listbox lb, List<?> data) { lb.setModel((ListModel<?>) null); lb.setModel(new ListModelList<Object>(data)); return data.size() > 0; }
@Override protected void initModel(List<FamilyMemberHistory> entries) { model.addAll(entries); }
public void listboxTest(){ ListModelList model = new ListModelList(); Listbox lbOne = new Listbox(); lbOne.setModel(model); lbOne.setMultiple(true); System.out.println(lbOne); System.out.println(model); }