Search in sources :

Example 1 with NetworkPanel

use of org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkPanel in project ovirt-engine by oVirt.

the class HostSetupNetworksPopupView method updateNetworks.

private void updateNetworks(List<LogicalNetworkModel> allNetworks) {
    internalNetworkList.clear();
    externalNetworkList.clear();
    Collections.sort(allNetworks);
    List<NetworkPanel> staticNetworkPanels = new ArrayList<>();
    List<NetworkPanel> dynamicNetworkPanels = new ArrayList<>();
    for (LogicalNetworkModel network : allNetworks) {
        if (network.getNetwork().isExternal()) {
            dynamicNetworkPanels.add(new ExternalNetworkPanel(network, style));
        } else if (!network.isAttached()) {
            staticNetworkPanels.add(new InternalNetworkPanel(network, style));
        }
    }
    internalNetworkList.addAll(staticNetworkPanels, !rendered);
    externalNetworkList.addAll(dynamicNetworkPanels, !rendered);
}
Also used : ExternalNetworkPanel(org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ExternalNetworkPanel) NetworkPanel(org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkPanel) InternalNetworkPanel(org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.InternalNetworkPanel) ArrayList(java.util.ArrayList) LogicalNetworkModel(org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel) InternalNetworkPanel(org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.InternalNetworkPanel) ExternalNetworkPanel(org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ExternalNetworkPanel)

Aggregations

ArrayList (java.util.ArrayList)1 LogicalNetworkModel (org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel)1 ExternalNetworkPanel (org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ExternalNetworkPanel)1 InternalNetworkPanel (org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.InternalNetworkPanel)1 NetworkPanel (org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkPanel)1