public void insertToTable(int index, Destination object) { list.add(index, object); oracle.add(object.getDestination()); if (service == null) { oracle.add(object.getService().getName()); } else { oracle.add(object.getFacility().getName()); } dataProvider.flush(); dataProvider.refresh(); }
public void setList(ArrayList<Destination> list) { clearTable(); this.list.addAll(list); for (Destination d : list) { oracle.add(d.getDestination()); if (service == null) { oracle.add(d.getService().getName()); } else { oracle.add(d.getFacility().getName()); } } dataProvider.flush(); dataProvider.refresh(); }
public void filterTable(String text) { // store list only for first time if (fullBackup.isEmpty() || fullBackup == null) { fullBackup.addAll(list); } // always clear selected items selectionModel.clear(); list.clear(); if (text.equalsIgnoreCase("")) { list.addAll(fullBackup); } else { for (Destination dst : fullBackup) { // store facility by filter if (service == null) { if (dst.getDestination().toLowerCase().contains(text.toLowerCase()) || dst.getService().getName().toLowerCase().contains(text.toLowerCase())) { list.add(dst); } } else { if (dst.getDestination().toLowerCase().contains(text.toLowerCase()) || dst.getFacility().getName().toLowerCase().contains(text.toLowerCase())) { list.add(dst); } } } } if (list.isEmpty() && !text.isEmpty()) { loaderImage.setEmptyResultMessage("No destination matching '" + text + "' found."); } else { if (showFac) { loaderImage.setEmptyResultMessage("Service has no destination."); } else { loaderImage.setEmptyResultMessage( "Facility has no services destinations. Service configuration can't be propagated."); } } dataProvider.flush(); dataProvider.refresh(); loaderImage.loadingFinished(); }