use of cz.metacentrum.perun.webgui.model.ResourceTag in project perun by CESNET.
the class GetRichResources method setList.
public void setList(ArrayList<RichResource> list) {
clearTable();
this.list.addAll(list);
for (RichResource r : list) {
oracle.add(r.getName());
for (ResourceTag rt : r.getResourceTags()) {
oracle.add(rt.getName() + " (tag)");
}
}
dataProvider.flush();
dataProvider.refresh();
}
use of cz.metacentrum.perun.webgui.model.ResourceTag in project perun by CESNET.
the class GetRichResources method insertToTable.
public void insertToTable(int index, RichResource object) {
list.add(index, object);
oracle.add(object.getName());
for (ResourceTag rt : object.getResourceTags()) {
oracle.add(rt.getName() + " (tag)");
}
dataProvider.flush();
dataProvider.refresh();
}
use of cz.metacentrum.perun.webgui.model.ResourceTag in project perun by CESNET.
the class GetRichResources method filterTable.
public void filterTable(String filter) {
// store list only for first time
if (fullBackup.isEmpty() || fullBackup == null) {
fullBackup.addAll(list);
}
// always clear selected items
selectionModel.clear();
list.clear();
if (filter.equalsIgnoreCase("")) {
list.addAll(fullBackup);
} else {
for (RichResource res : fullBackup) {
// store facility by filter
if (res.getName().toLowerCase().contains(filter.toLowerCase())) {
list.add(res);
}
for (ResourceTag r : res.getResourceTags()) {
// remove " (tag)" from tag name
if (r.getName().contains(filter.substring(0, (filter.length() > 6) ? filter.length() - 6 : filter.length()).trim())) {
list.add(res);
break;
}
}
}
}
if (list.isEmpty() && !filter.isEmpty()) {
loaderImage.setEmptyResultMessage("No resource matching '" + filter + "' found.");
} else {
loaderImage.setEmptyResultMessage("VO has no resources.");
}
dataProvider.flush();
dataProvider.refresh();
loaderImage.loadingFinished();
}
Aggregations