Search in sources :

Example 1 with ClusterNetworkManageModel

use of org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkManageModel in project ovirt-engine by oVirt.

the class NetworkClusterListModel method manage.

public void manage() {
    if (getWindow() != null) {
        return;
    }
    ClusterNetworkManageModel manageModel = createManageList();
    setWindow(manageModel);
    manageModel.setTitle(ConstantsManager.getInstance().getConstants().assignDetachNetworkTitle());
    manageModel.setHelpTag(HelpTag.assign_network);
    // $NON-NLS-1$
    manageModel.setHashName("assign_network");
}
Also used : ClusterNetworkManageModel(org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkManageModel)

Example 2 with ClusterNetworkManageModel

use of org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkManageModel 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;
}
Also used : PairQueryable(org.ovirt.engine.core.common.utils.PairQueryable) ClusterNetworkModel(org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel) Network(org.ovirt.engine.core.common.businessentities.network.Network) ArrayList(java.util.ArrayList) ClusterNetworkManageModel(org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkManageModel) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) NetworkCluster(org.ovirt.engine.core.common.businessentities.network.NetworkCluster) NetworkCluster(org.ovirt.engine.core.common.businessentities.network.NetworkCluster)

Aggregations

ClusterNetworkManageModel (org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkManageModel)2 ArrayList (java.util.ArrayList)1 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)1 Network (org.ovirt.engine.core.common.businessentities.network.Network)1 NetworkCluster (org.ovirt.engine.core.common.businessentities.network.NetworkCluster)1 PairQueryable (org.ovirt.engine.core.common.utils.PairQueryable)1 ClusterNetworkModel (org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel)1