Search in sources :

Example 16 with VmPool

use of org.ovirt.engine.core.common.businessentities.VmPool in project ovirt-engine by oVirt.

the class VmPoolDaoTest method testGetFilteredWithPermissions.

@Test
public void testGetFilteredWithPermissions() {
    VmPool result = dao.get(existingVmPool.getVmPoolId(), PRIVILEGED_USER_ID, true);
    assertGetResult(result);
}
Also used : VmPool(org.ovirt.engine.core.common.businessentities.VmPool) Test(org.junit.Test)

Example 17 with VmPool

use of org.ovirt.engine.core.common.businessentities.VmPool in project ovirt-engine by oVirt.

the class PoolGeneralModel method updateProperties.

private void updateProperties() {
    final VmPool pool = getEntity();
    setName(pool.getName());
    setDescription(pool.getVmPoolDescription());
    Frontend.getInstance().runQuery(QueryType.GetVmDataByPoolId, new IdQueryParameters(pool.getVmPoolId()), new AsyncQuery<>(new AsyncCallback<QueryReturnValue>() {

        @Override
        public void onSuccess(QueryReturnValue result) {
            // refactor to "switch ... case...".
            if (result != null) {
                setvm((VM) result.getReturnValue());
            }
            if (getvm() != null) {
                setTemplate(vmTemplateNameRenderer.render(getvm()));
                setCpuInfo(ConstantsManager.getInstance().getMessages().cpuInfoLabel(getvm().getNumOfCpus(), getvm().getNumOfSockets(), getvm().getCpuPerSocket(), getvm().getThreadsPerCpu()));
                setMonitorCount(getvm().getNumOfMonitors());
                setOS(getvm().getVmOsId());
                // $NON-NLS-1$
                setDefinedMemory(getvm().getVmMemSizeMb() + " MB");
                // $NON-NLS-1$
                setMinAllocatedMemory(getvm().getMinAllocatedMem() + " MB");
                Translator translator = EnumTranslator.getInstance();
                setDefaultDisplayType(translator.translate(getvm().getDefaultDisplayType()));
                setOrigin(translator.translate(getvm().getOrigin()));
                setUsbPolicy(translator.translate(getvm().getUsbPolicy()));
                setHasDomain(AsyncDataProvider.getInstance().isWindowsOsType(getvm().getVmOsId()));
                setOptimizedForSystemProfile(translator.translate(getvm().getVmType()));
                setHasTimeZone(AsyncDataProvider.getInstance().isWindowsOsType(getvm().getVmOsId()));
                setTimeZone(getvm().getTimeZone());
                setIsStateless(!pool.isStateful());
                setQuotaName(getvm().getQuotaName());
                setHasDefaultHost(getvm().getDedicatedVmForVdsList().size() > 0);
                if (getHasDefaultHost()) {
                    Frontend.getInstance().runQuery(QueryType.Search, new SearchParameters(// $NON-NLS-1$
                    "Host: cluster = " + getvm().getClusterName() + " sortby name", SearchType.VDS), new AsyncQuery<QueryReturnValue>(returnValue1 -> {
                        // $NON-NLS-1$
                        String defaultHost1 = "";
                        ArrayList<VDS> hosts = returnValue1.getReturnValue();
                        for (VDS host : hosts) {
                            if (getvm().getDedicatedVmForVdsList().contains(host.getId())) {
                                if (defaultHost1.isEmpty()) {
                                    defaultHost1 = host.getName();
                                } else {
                                    // $NON-NLS-1$
                                    defaultHost1 += ", " + host.getName();
                                }
                            }
                        }
                        setDefaultHost(defaultHost1);
                    }));
                } else {
                    setDefaultHost(ConstantsManager.getInstance().getConstants().anyHostInCluster());
                }
                if (getvm() != null) {
                    PoolGeneralModel.super.updateProperties(getvm().getId());
                }
            } else {
                setTemplate(null);
                setCpuCount(0);
                setMonitorCount(0);
                setOS(0);
                setDefinedMemory(null);
                setMinAllocatedMemory(null);
                setDefaultDisplayType(null);
                setHasDomain(false);
                setDomain(null);
                setHasTimeZone(false);
                setTimeZone(null);
                setUsbPolicy(null);
                setDefaultHost(null);
                setIsStateless(!pool.isStateful());
                // $NON-NLS-1$
                setGraphicsType("");
                // $NON-NLS-1$
                setOptimizedForSystemProfile("");
                getUpdateCompleteEvent().raise(this, EventArgs.EMPTY);
            }
        }
    }));
}
Also used : VmPool(org.ovirt.engine.core.common.businessentities.VmPool) SearchType(org.ovirt.engine.core.common.interfaces.SearchType) QueryType(org.ovirt.engine.core.common.queries.QueryType) SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) EnumTranslator(org.ovirt.engine.ui.uicompat.EnumTranslator) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) Event(org.ovirt.engine.ui.uicompat.Event) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) ArrayList(java.util.ArrayList) AsyncCallback(org.ovirt.engine.ui.frontend.AsyncCallback) Objects(java.util.Objects) Frontend(org.ovirt.engine.ui.frontend.Frontend) VM(org.ovirt.engine.core.common.businessentities.VM) Translator(org.ovirt.engine.ui.uicompat.Translator) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) EventDefinition(org.ovirt.engine.ui.uicompat.EventDefinition) AbstractGeneralModel(org.ovirt.engine.ui.uicommonweb.models.vms.AbstractGeneralModel) EventArgs(org.ovirt.engine.ui.uicompat.EventArgs) VDS(org.ovirt.engine.core.common.businessentities.VDS) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs) VmTemplateNameRenderer(org.ovirt.engine.ui.uicommonweb.models.vms.VmTemplateNameRenderer) SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) VDS(org.ovirt.engine.core.common.businessentities.VDS) VmPool(org.ovirt.engine.core.common.businessentities.VmPool) EnumTranslator(org.ovirt.engine.ui.uicompat.EnumTranslator) Translator(org.ovirt.engine.ui.uicompat.Translator) AsyncCallback(org.ovirt.engine.ui.frontend.AsyncCallback) ArrayList(java.util.ArrayList)

Example 18 with VmPool

use of org.ovirt.engine.core.common.businessentities.VmPool in project ovirt-engine by oVirt.

the class PoolListModel method onSave.

public void onSave() {
    final PoolModel model = (PoolModel) getWindow();
    if (model.getProgress() != null) {
        return;
    }
    if (!model.getIsNew() && getSelectedItem() == null) {
        cancel();
        return;
    }
    if (!model.validate()) {
        return;
    }
    setCurrentPool(model.getIsNew() ? new VmPool() : (VmPool) Cloner.clone(getSelectedItem()));
    final String name = model.getName().getEntity();
    // Check name unicitate.
    AsyncDataProvider.getInstance().isPoolNameUnique(new AsyncQuery<>(isUnique -> {
        if ((model.getIsNew() && !isUnique) || (!model.getIsNew() && !isUnique && name.compareToIgnoreCase(getCurrentPool().getName()) != 0)) {
            model.getName().getInvalidityReasons().add(ConstantsManager.getInstance().getConstants().nameMustBeUniqueInvalidReason());
            model.getName().setIsValid(false);
            model.setValidTab(TabName.GENERAL_TAB, false);
            model.fireValidationCompleteEvent();
            return;
        }
        String selectedCpu = model.getCustomCpu().getSelectedItem();
        if (selectedCpu != null && !selectedCpu.isEmpty() && !model.getCustomCpu().getItems().contains(selectedCpu)) {
            ConfirmationModel confirmModel = new ConfirmationModel();
            confirmModel.setTitle(ConstantsManager.getInstance().getConstants().vmUnsupportedCpuTitle());
            confirmModel.setMessage(ConstantsManager.getInstance().getConstants().vmUnsupportedCpuMessage());
            confirmModel.setHelpTag(HelpTag.edit_unsupported_cpu);
            // $NON-NLS-1$
            confirmModel.setHashName("edit_unsupported_cpu");
            confirmModel.getCommands().add(// $NON-NLS-1$
            new UICommand("OnSave_Phase2", PoolListModel.this).setTitle(ConstantsManager.getInstance().getConstants().ok()).setIsDefault(true));
            confirmModel.getCommands().add(// $NON-NLS-1$
            UICommand.createCancelUiCommand(// $NON-NLS-1$
            "CancelConfirmation", PoolListModel.this));
            setConfirmWindow(confirmModel);
        } else {
            if (model.getVmType().getSelectedItem() == VmType.HighPerformance) {
                displayHighPerformanceConfirmationPopup();
            } else {
                savePoolPostValidation();
            }
        }
    }), name);
}
Also used : SearchType(org.ovirt.engine.core.common.interfaces.SearchType) VmType(org.ovirt.engine.core.common.businessentities.VmType) SearchObjects(org.ovirt.engine.core.searchbackend.SearchObjects) CoreUnitToVmBaseBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.CoreUnitToVmBaseBuilder) Inject(com.google.inject.Inject) ApplicationMode(org.ovirt.engine.core.common.mode.ApplicationMode) KernelParamsUnitToVmBaseBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsUnitToVmBaseBuilder) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ActionType(org.ovirt.engine.core.common.action.ActionType) CpuProfileUnitToVmBaseBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.CpuProfileUnitToVmBaseBuilder) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) HasEntity(org.ovirt.engine.ui.uicommonweb.models.HasEntity) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) AddVmPoolParameters(org.ovirt.engine.core.common.action.AddVmPoolParameters) DisplayType(org.ovirt.engine.core.common.businessentities.DisplayType) SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) DedicatedVmForVdsUnitToVmBaseBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.DedicatedVmForVdsUnitToVmBaseBuilder) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) UsbPolicyUnitToVmBaseBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.UsbPolicyUnitToVmBaseBuilder) StringHelper(org.ovirt.engine.core.compat.StringHelper) VmHighPerformanceConfigurationModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmHighPerformanceConfigurationModel) List(java.util.List) KeyValueModel(org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueModel) Cloner(org.ovirt.engine.ui.uicommonweb.Cloner) NewPoolModelBehavior(org.ovirt.engine.ui.uicommonweb.models.vms.NewPoolModelBehavior) UnitToGraphicsDeviceParamsBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.UnitToGraphicsDeviceParamsBuilder) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) QueryType(org.ovirt.engine.core.common.queries.QueryType) PermissionListModel(org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel) Guid(org.ovirt.engine.core.compat.Guid) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ArrayList(java.util.ArrayList) Frontend(org.ovirt.engine.ui.frontend.Frontend) VmPoolType(org.ovirt.engine.core.common.businessentities.VmPoolType) NameUnitToVmBaseBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.NameUnitToVmBaseBuilder) VmPool(org.ovirt.engine.core.common.businessentities.VmPool) Linq(org.ovirt.engine.ui.uicommonweb.Linq) BuilderExecutor(org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor) VmPoolParametersBase(org.ovirt.engine.core.common.action.VmPoolParametersBase) SearchStringMapping(org.ovirt.engine.ui.uicommonweb.models.SearchStringMapping) VmBasedWidgetSwitchModeCommand(org.ovirt.engine.ui.uicommonweb.models.vms.VmBasedWidgetSwitchModeCommand) MigrationOptionsUnitToVmBaseBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.MigrationOptionsUnitToVmBaseBuilder) ExistingPoolModelBehavior(org.ovirt.engine.ui.uicommonweb.models.vms.ExistingPoolModelBehavior) VM(org.ovirt.engine.core.common.businessentities.VM) TabName(org.ovirt.engine.ui.uicommonweb.models.TabName) ListWithSimpleDetailsModel(org.ovirt.engine.ui.uicommonweb.models.ListWithSimpleDetailsModel) WebAdminApplicationPlaces(org.ovirt.engine.ui.uicommonweb.place.WebAdminApplicationPlaces) PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs) VmSpecificUnitToVmBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.VmSpecificUnitToVmBuilder) VmPool(org.ovirt.engine.core.common.businessentities.VmPool) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 19 with VmPool

use of org.ovirt.engine.core.common.businessentities.VmPool in project ovirt-engine by oVirt.

the class PoolListModel method edit.

public void edit() {
    final VmPool pool = getSelectedItem();
    if (getWindow() != null) {
        return;
    }
    final PoolListModel poolListModel = this;
    Frontend.getInstance().runQuery(QueryType.GetVmDataByPoolId, new IdQueryParameters(pool.getVmPoolId()), new AsyncQuery<QueryReturnValue>(result -> {
        final VM vm = result.getReturnValue();
        final ExistingPoolModelBehavior behavior = new ExistingPoolModelBehavior(vm, pool);
        behavior.getPoolModelBehaviorInitializedEvent().addListener((ev, sender, args) -> {
            final PoolModel model = behavior.getModel();
            for (EntityModel<VmPoolType> item : model.getPoolType().getItems()) {
                if (item.getEntity() == pool.getVmPoolType()) {
                    model.getPoolType().setSelectedItem(item);
                    break;
                }
            }
            String cdImage = null;
            if (vm != null) {
                model.getDataCenterWithClustersList().setSelectedItem(null);
                model.getDataCenterWithClustersList().setSelectedItem(Linq.firstOrNull(model.getDataCenterWithClustersList().getItems(), new Linq.DataCenterWithClusterPredicate(vm.getStoragePoolId(), vm.getClusterId())));
                model.getTemplateWithVersion().setIsChangeable(false);
                cdImage = vm.getIsoPath();
                model.getVmType().setSelectedItem(vm.getVmType());
            } else {
                model.getDataCenterWithClustersList().setSelectedItem(Linq.firstOrNull(model.getDataCenterWithClustersList().getItems()));
            }
            model.getDataCenterWithClustersList().setIsChangeable(vm == null);
            boolean hasCd = !StringHelper.isNullOrEmpty(cdImage);
            model.getCdImage().setIsChangeable(hasCd);
            model.getCdAttached().setEntity(hasCd);
            model.getProvisioning().setIsChangeable(false);
            model.getStorageDomain().setIsChangeable(false);
        });
        PoolModel model = new PoolModel(behavior);
        model.setCustomPropertiesKeysList(AsyncDataProvider.getInstance().getCustomPropertiesList());
        // $NON-NLS-1$
        model.setIsAdvancedModeLocalStorageKey("wa_pool_dialog");
        setWindow(model);
        VmBasedWidgetSwitchModeCommand switchModeCommand = new VmBasedWidgetSwitchModeCommand();
        switchModeCommand.init(model);
        model.getCommands().add(switchModeCommand);
        // $NON-NLS-1$
        UICommand command = UICommand.createDefaultOkUiCommand("OnSave", poolListModel);
        model.getCommands().add(command);
        // $NON-NLS-1$
        model.getCommands().add(UICommand.createCancelUiCommand("Cancel", poolListModel));
        model.setTitle(ConstantsManager.getInstance().getConstants().editPoolTitle());
        model.setHelpTag(HelpTag.edit_pool);
        // $NON-NLS-1$
        model.setHashName("edit_pool");
        model.initialize();
        model.getName().setEntity(pool.getName());
        model.getDescription().setEntity(pool.getVmPoolDescription());
        model.getComment().setEntity(pool.getComment());
        model.getPoolStateful().setEntity(pool.isStateful());
        model.getAssignedVms().setEntity(pool.getAssignedVmsCount());
        model.getPrestartedVms().setEntity(pool.getPrestartedVms());
        // $NON-NLS-1$
        model.setPrestartedVmsHint("0-" + pool.getAssignedVmsCount());
        model.getMaxAssignedVmsPerUser().setEntity(pool.getMaxAssignedVmsPerUser());
    }));
}
Also used : SearchType(org.ovirt.engine.core.common.interfaces.SearchType) VmType(org.ovirt.engine.core.common.businessentities.VmType) SearchObjects(org.ovirt.engine.core.searchbackend.SearchObjects) CoreUnitToVmBaseBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.CoreUnitToVmBaseBuilder) Inject(com.google.inject.Inject) ApplicationMode(org.ovirt.engine.core.common.mode.ApplicationMode) KernelParamsUnitToVmBaseBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsUnitToVmBaseBuilder) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ActionType(org.ovirt.engine.core.common.action.ActionType) CpuProfileUnitToVmBaseBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.CpuProfileUnitToVmBaseBuilder) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) HasEntity(org.ovirt.engine.ui.uicommonweb.models.HasEntity) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) AddVmPoolParameters(org.ovirt.engine.core.common.action.AddVmPoolParameters) DisplayType(org.ovirt.engine.core.common.businessentities.DisplayType) SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) DedicatedVmForVdsUnitToVmBaseBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.DedicatedVmForVdsUnitToVmBaseBuilder) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) UsbPolicyUnitToVmBaseBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.UsbPolicyUnitToVmBaseBuilder) StringHelper(org.ovirt.engine.core.compat.StringHelper) VmHighPerformanceConfigurationModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmHighPerformanceConfigurationModel) List(java.util.List) KeyValueModel(org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueModel) Cloner(org.ovirt.engine.ui.uicommonweb.Cloner) NewPoolModelBehavior(org.ovirt.engine.ui.uicommonweb.models.vms.NewPoolModelBehavior) UnitToGraphicsDeviceParamsBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.UnitToGraphicsDeviceParamsBuilder) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) QueryType(org.ovirt.engine.core.common.queries.QueryType) PermissionListModel(org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel) Guid(org.ovirt.engine.core.compat.Guid) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ArrayList(java.util.ArrayList) Frontend(org.ovirt.engine.ui.frontend.Frontend) VmPoolType(org.ovirt.engine.core.common.businessentities.VmPoolType) NameUnitToVmBaseBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.NameUnitToVmBaseBuilder) VmPool(org.ovirt.engine.core.common.businessentities.VmPool) Linq(org.ovirt.engine.ui.uicommonweb.Linq) BuilderExecutor(org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor) VmPoolParametersBase(org.ovirt.engine.core.common.action.VmPoolParametersBase) SearchStringMapping(org.ovirt.engine.ui.uicommonweb.models.SearchStringMapping) VmBasedWidgetSwitchModeCommand(org.ovirt.engine.ui.uicommonweb.models.vms.VmBasedWidgetSwitchModeCommand) MigrationOptionsUnitToVmBaseBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.MigrationOptionsUnitToVmBaseBuilder) ExistingPoolModelBehavior(org.ovirt.engine.ui.uicommonweb.models.vms.ExistingPoolModelBehavior) VM(org.ovirt.engine.core.common.businessentities.VM) TabName(org.ovirt.engine.ui.uicommonweb.models.TabName) ListWithSimpleDetailsModel(org.ovirt.engine.ui.uicommonweb.models.ListWithSimpleDetailsModel) WebAdminApplicationPlaces(org.ovirt.engine.ui.uicommonweb.place.WebAdminApplicationPlaces) PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs) VmSpecificUnitToVmBuilder(org.ovirt.engine.ui.uicommonweb.builders.vm.VmSpecificUnitToVmBuilder) Linq(org.ovirt.engine.ui.uicommonweb.Linq) ExistingPoolModelBehavior(org.ovirt.engine.ui.uicommonweb.models.vms.ExistingPoolModelBehavior) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) VmBasedWidgetSwitchModeCommand(org.ovirt.engine.ui.uicommonweb.models.vms.VmBasedWidgetSwitchModeCommand) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) VmPool(org.ovirt.engine.core.common.businessentities.VmPool) VM(org.ovirt.engine.core.common.businessentities.VM) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand)

Example 20 with VmPool

use of org.ovirt.engine.core.common.businessentities.VmPool in project ovirt-engine by oVirt.

the class PoolListModel method remove.

public void remove() {
    if (getWindow() != null) {
        return;
    }
    ConfirmationModel model = new ConfirmationModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().removePoolsTitle());
    model.setHelpTag(HelpTag.remove_pool);
    // $NON-NLS-1$
    model.setHashName("remove_pool");
    ArrayList<String> list = new ArrayList<>();
    for (VmPool item : getSelectedItems()) {
        list.add(item.getName());
    }
    model.setItems(list);
    // $NON-NLS-1$
    UICommand tempVar = UICommand.createDefaultOkUiCommand("OnRemove", this);
    model.getCommands().add(tempVar);
    // $NON-NLS-1$
    UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this);
    model.getCommands().add(tempVar2);
}
Also used : VmPool(org.ovirt.engine.core.common.businessentities.VmPool) ArrayList(java.util.ArrayList) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Aggregations

VmPool (org.ovirt.engine.core.common.businessentities.VmPool)32 Test (org.junit.Test)12 VM (org.ovirt.engine.core.common.businessentities.VM)9 ArrayList (java.util.ArrayList)8 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)8 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)7 Guid (org.ovirt.engine.core.compat.Guid)7 QueryType (org.ovirt.engine.core.common.queries.QueryType)6 List (java.util.List)5 Frontend (org.ovirt.engine.ui.frontend.Frontend)5 HelpTag (org.ovirt.engine.ui.uicommonweb.help.HelpTag)5 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)5 ActionType (org.ovirt.engine.core.common.action.ActionType)4 VmPoolParametersBase (org.ovirt.engine.core.common.action.VmPoolParametersBase)4 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)3 AddVmPoolParameters (org.ovirt.engine.core.common.action.AddVmPoolParameters)3 VmPoolType (org.ovirt.engine.core.common.businessentities.VmPoolType)3 SearchType (org.ovirt.engine.core.common.interfaces.SearchType)3 SearchParameters (org.ovirt.engine.core.common.queries.SearchParameters)3 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)3