Search in sources :

Example 1 with VdsSpmStatus

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

the class ManualFenceConfirmationPopupView method edit.

@Override
public void edit(final ConfirmationModel object) {
    driver.edit(object);
    // Bind "Latch.IsAvailable"
    object.getLatch().getPropertyChangedEvent().addListener((ev, sender, args) -> {
        if ("IsAvailable".equals(args.propertyName)) {
            // $NON-NLS-1$
            EntityModel entity = (EntityModel) sender;
            if (entity.getIsAvailable()) {
                latch.setVisible(true);
            }
        }
    });
    object.getItemsChangedEvent().addListener((ev, sender, args) -> {
        VDS vds = (VDS) object.getItems().iterator().next();
        // Message
        messageLabel.setText(messages.manaulFencePopupMessageLabel(vds.getName()));
        // Spm warning
        VdsSpmStatus spmStatus = vds.getSpmStatus();
        if (spmStatus == VdsSpmStatus.None) {
            spmWarningLabel.setText(constants.manaulFencePopupNoneSpmWarningLabel());
        } else if (spmStatus == VdsSpmStatus.SPM) {
            spmWarningLabel.setText(constants.manaulFencePopupSpmWarningLabel());
        } else if (spmStatus == VdsSpmStatus.Contending) {
            spmWarningLabel.setText(constants.manaulFencePopupContendingSpmWarningLabel());
        }
        // Warning
        warningLabel.setText(constants.manaulFencePopupWarningLabel());
    });
}
Also used : VdsSpmStatus(org.ovirt.engine.core.common.businessentities.VdsSpmStatus) VDS(org.ovirt.engine.core.common.businessentities.VDS) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel)

Aggregations

VDS (org.ovirt.engine.core.common.businessentities.VDS)1 VdsSpmStatus (org.ovirt.engine.core.common.businessentities.VdsSpmStatus)1 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)1