use of org.ovirt.engine.core.common.businessentities.GraphicsType in project ovirt-engine by oVirt.
the class UnitVmModel method initDisplayModels.
public void initDisplayModels(List<Pair<GraphicsType, DisplayType>> graphicsAndDisplays) {
// get supported display types
Set<DisplayType> displayTypes = new LinkedHashSet<>();
for (Pair<GraphicsType, DisplayType> graphicsTypeDisplayTypePair : graphicsAndDisplays) {
if (graphicsTypeDisplayTypePair.getSecond() != DisplayType.none) {
displayTypes.add(graphicsTypeDisplayTypePair.getSecond());
}
}
// set items and set selected one
DisplayType selectedDisplayType = getDisplayType().getSelectedItem();
if (displayTypes.contains(selectedDisplayType)) {
getDisplayType().setItems(displayTypes, selectedDisplayType);
} else if (displayTypes.size() > 0) {
getDisplayType().setItems(displayTypes, displayTypes.iterator().next());
}
}
Aggregations