use of cz.metacentrum.perun.webgui.model.Destination in project perun by CESNET.
the class GetAllRichDestinations method filterTable.
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();
}
use of cz.metacentrum.perun.webgui.model.Destination in project perun by CESNET.
the class GetAllRichDestinations method setList.
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();
}
use of cz.metacentrum.perun.webgui.model.Destination in project perun by CESNET.
the class GetDestinations method onFinished.
/**
* Called, when operation finishes successfully.
*/
public void onFinished(JavaScriptObject jso) {
ArrayList<Destination> dest = JsonUtils.jsoAsList(jso);
for (Destination d : dest) {
d.setFacility(facility);
d.setService(service);
addToTable(d);
}
sortTable();
loaderImage.loadingFinished();
session.getUiElements().setLogText("Destinations loaded: " + list.size());
events.onFinished(jso);
}
use of cz.metacentrum.perun.webgui.model.Destination in project perun by CESNET.
the class GetDestinations method filterTable.
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 (dst.getService() != 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())) {
list.add(dst);
}
}
}
}
dataProvider.flush();
dataProvider.refresh();
loaderImage.loadingFinished();
}
use of cz.metacentrum.perun.webgui.model.Destination in project perun by CESNET.
the class GetDestinations method setList.
public void setList(ArrayList<Destination> list) {
clearTable();
this.list.addAll(list);
for (Destination object : list) {
if (object.getService() != null) {
oracle.add(object.getService().getName());
}
oracle.add(object.getDestination());
}
dataProvider.flush();
dataProvider.refresh();
}
Aggregations