use of org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel in project ovirt-engine by oVirt.
the class NetworkClusterListModel method createManageList.
private ClusterNetworkManageModel createManageList() {
List<ClusterNetworkModel> networkManageModelList = new ArrayList<>();
Iterable<PairQueryable<Cluster, NetworkCluster>> items = getItems();
for (PairQueryable<Cluster, NetworkCluster> item : items) {
Network network = (Network) Cloner.clone(getEntity());
if (item.getSecond() != null) {
network.setCluster((NetworkCluster) Cloner.clone(item.getSecond()));
}
ClusterNetworkModel networkManageModel = new ClusterNetworkModel(network) {
@Override
public String getDisplayedName() {
return getCluster().getName();
}
};
networkManageModel.setCluster((Cluster) Cloner.clone(item.getFirst()));
networkManageModelList.add(networkManageModel);
}
Collections.sort(networkManageModelList, manageModelComparator);
ClusterNetworkManageModel listModel = new ClusterNetworkManageModel(this) {
@Override
public boolean isMultiCluster() {
return true;
}
};
listModel.setItems(networkManageModelList);
return listModel;
}
Aggregations