Search in sources :

Example 1 with NewHostNetworkQosModel

use of org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.NewHostNetworkQosModel in project ovirt-engine by oVirt.

the class NetworkModel method addQos.

private void addQos() {
    NewHostNetworkQosModel qosModel = new NewHostNetworkQosModel(this, getSelectedDc()) {

        @Override
        protected void postSaveAction(boolean succeeded) {
            if (succeeded) {
                List<HostNetworkQos> qosItems = new ArrayList<>(NetworkModel.this.getQos().getItems());
                qosItems.add(1, getQos());
                NetworkModel.this.getQos().setItems(qosItems);
                NetworkModel.this.getQos().setSelectedItem(getQos());
            }
            super.postSaveAction(succeeded);
        }

        @Override
        protected void cancel() {
            sourceListModel.setConfirmWindow(null);
        }
    };
    qosModel.getDataCenters().setIsChangeable(false);
    sourceListModel.setConfirmWindow(qosModel);
}
Also used : HostNetworkQos(org.ovirt.engine.core.common.businessentities.network.HostNetworkQos) NewHostNetworkQosModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.NewHostNetworkQosModel) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 HostNetworkQos (org.ovirt.engine.core.common.businessentities.network.HostNetworkQos)1 NewHostNetworkQosModel (org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.NewHostNetworkQosModel)1