Search in sources :

Example 1 with ExistingBlankTemplateModelBehavior

use of org.ovirt.engine.ui.uicommonweb.models.templates.ExistingBlankTemplateModelBehavior in project ovirt-engine by oVirt.

the class BalloonEnabled method balloonEnabled.

public static boolean balloonEnabled(UnitVmModel model) {
    Cluster cluster = model.getSelectedCluster();
    Integer osType = model.getOSType().getSelectedItem();
    Boolean deviceEnabled = Boolean.TRUE.equals(model.getMemoryBalloonDeviceEnabled().getEntity());
    if (cluster == null || osType == null) {
        if (model.getBehavior() instanceof ExistingBlankTemplateModelBehavior || model.getBehavior() instanceof ExistingInstanceTypeModelBehavior || model.getBehavior() instanceof NewInstanceTypeModelBehavior) {
            return deviceEnabled;
        }
        return false;
    }
    return deviceEnabled && AsyncDataProvider.getInstance().isBalloonEnabled(osType, model.getCompatibilityVersion());
}
Also used : ExistingBlankTemplateModelBehavior(org.ovirt.engine.ui.uicommonweb.models.templates.ExistingBlankTemplateModelBehavior) NewInstanceTypeModelBehavior(org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.NewInstanceTypeModelBehavior) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) ExistingInstanceTypeModelBehavior(org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.ExistingInstanceTypeModelBehavior)

Aggregations

Cluster (org.ovirt.engine.core.common.businessentities.Cluster)1 ExistingBlankTemplateModelBehavior (org.ovirt.engine.ui.uicommonweb.models.templates.ExistingBlankTemplateModelBehavior)1 ExistingInstanceTypeModelBehavior (org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.ExistingInstanceTypeModelBehavior)1 NewInstanceTypeModelBehavior (org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.NewInstanceTypeModelBehavior)1