@Override public void filterTable(String filter) { // store list only for first time if (fullBackup.isEmpty() || fullBackup == null) { fullBackup.addAll(getList()); } // always clear selected items selectionModel.clear(); list.clear(); if (filter.equalsIgnoreCase("")) { list.addAll(fullBackup); } else { for (ExtSource src : fullBackup) { // store ext source if name or type matches if ((src.getName().toLowerCase().startsWith(filter.toLowerCase())) || renameContent(src.getType()).toLowerCase().startsWith(filter.toLowerCase())) { list.add(src); } } } if (list.isEmpty() && !filter.isEmpty()) { loaderImage.setEmptyResultMessage("No external source matching '" + filter + "' found."); } else { loaderImage.setEmptyResultMessage("No external sources found in Perun."); } dataProvider.flush(); dataProvider.refresh(); loaderImage.loadingFinished(); }
public void insertToTable(int index, ExtSource object) { list.add(index, object); oracle.add(object.getName()); oracle.add(renameContent(object.getType())); dataProvider.flush(); dataProvider.refresh(); }
/** * Add object as new row to table * * @param object ExtSource to be added as new row */ public void addToTable(ExtSource object) { list.add(object); oracle.add(object.getName()); oracle.add(renameContent(object.getType())); dataProvider.flush(); dataProvider.refresh(); }
public void setList(ArrayList<ExtSource> list) { clearTable(); this.list.addAll(list); for (ExtSource object : list) { oracle.add(object.getName()); oracle.add(renameContent(object.getType())); } dataProvider.flush(); dataProvider.refresh(); }