@Override protected void initModel(List<AllergyIntolerance> entries) { for (AllergyIntolerance adr : entries) { if (!exclusions.contains(adr.getStatusElement())) { for (Event event : adr.getEvent()) { model.add(event); } } } }
if (listData.get(0) != null) { System.out.println("added null"); listData.add(0, null);
public void onClick$btnEdit() { if (!btnEdit.isDisabled()) { AntiCoagRecord oldRecord = getSelectedValue(); AntiCoagRecord newRecord = AddEditController.show(oldRecord); if (newRecord != null) { model.remove(oldRecord); model.add(newRecord); } } }
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(); } }
/** * 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); } }
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); }