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());
});
}
Aggregations