use of org.ovirt.engine.core.common.businessentities.VmWatchdogType in project ovirt-engine by oVirt.
the class UnitVmModel method updateWatchdogItems.
public void updateWatchdogItems(Set<VmWatchdogType> vmWatchdogTypes) {
List<VmWatchdogType> watchDogModels = new ArrayList<>();
for (VmWatchdogType vmWatchdogType : vmWatchdogTypes) {
watchDogModels.add(vmWatchdogType);
}
watchDogModels.add(0, null);
VmWatchdogType oldWatchdogSelected = getWatchdogModel().getSelectedItem();
if (watchDogModels.contains(getWatchdogModel().getSelectedItem())) {
getWatchdogModel().setItems(watchDogModels, getWatchdogModel().getSelectedItem());
} else {
getWatchdogModel().setItems(watchDogModels);
}
if (watchDogModels.contains(oldWatchdogSelected)) {
getWatchdogModel().setSelectedItem(oldWatchdogSelected);
}
}
Aggregations