Search in sources :

Example 1 with SharedMacPoolModel

use of org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel in project ovirt-engine by oVirt.

the class ClusterListModel method addMacPool.

private void addMacPool(final ClusterModel clusterModel) {
    SharedMacPoolModel macPoolModel = new NewSharedMacPoolModel.ClosingWithSetConfirmWindow(this) {

        @Override
        protected void onActionSucceeded(Guid macPoolId) {
            MacPool macPool = getEntity();
            macPool.setId(macPoolId);
            Collection<MacPool> macPools = new ArrayList<>(clusterModel.getMacPoolListModel().getItems());
            macPools.add(macPool);
            clusterModel.getMacPoolListModel().setItems(macPools);
            clusterModel.getMacPoolListModel().setSelectedItem(macPool);
            ClusterListModel.this.setConfirmWindow(null);
        }
    };
    macPoolModel.setEntity(new MacPool());
    setConfirmWindow(macPoolModel);
}
Also used : MacPool(org.ovirt.engine.core.common.businessentities.MacPool) ArrayList(java.util.ArrayList) SharedMacPoolModel(org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel) NewSharedMacPoolModel(org.ovirt.engine.ui.uicommonweb.models.macpool.NewSharedMacPoolModel) Guid(org.ovirt.engine.core.compat.Guid)

Aggregations

ArrayList (java.util.ArrayList)1 MacPool (org.ovirt.engine.core.common.businessentities.MacPool)1 Guid (org.ovirt.engine.core.compat.Guid)1 NewSharedMacPoolModel (org.ovirt.engine.ui.uicommonweb.models.macpool.NewSharedMacPoolModel)1 SharedMacPoolModel (org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel)1