use of org.ovirt.engine.core.common.migration.MigrationPolicy in project ovirt-engine by oVirt.
the class ClusterPopupView method edit.
@Override
public void edit(final ClusterModel object) {
driver.edit(object);
updateMacPool(object.getMacPoolModel());
customPropertiesSheetEditor.edit(object.getCustomPropertySheet());
enableOvirtServiceEditor.setVisible(object.getAllowClusterWithVirtGlusterEnabled());
enableGlusterServiceEditor.setVisible(object.getAllowClusterWithVirtGlusterEnabled());
enableOvirtServiceOptionEditor.setVisible(!object.getAllowClusterWithVirtGlusterEnabled());
enableGlusterServiceOptionEditor.setVisible(!object.getAllowClusterWithVirtGlusterEnabled());
serialNumberPolicyEditor.edit(object.getSerialNumberPolicy());
optimizationForServerFormatter(object);
optimizationForDesktopFormatter(object);
optimizationCustomFormatter(object);
object.getOptimizationForServer().getEntityChangedEvent().addListener((ev, sender, args) -> optimizationForServerFormatter(object));
object.getOptimizationForDesktop().getEntityChangedEvent().addListener((ev, sender, args) -> optimizationForDesktopFormatter(object));
object.getOptimizationCustom_IsSelected().getEntityChangedEvent().addListener((ev, sender, args) -> {
if (object.getOptimizationCustom_IsSelected().getEntity()) {
optimizationCustomFormatter(object);
optimizationCustomEditor.setVisible(true);
}
});
object.getDataCenter().getSelectedItemChangedEvent().addListener((ev, sender, args) -> {
migrationTab.setVisible(object.isMigrationTabAvailable());
applyModeCustomizations();
});
object.getEnableOvirtService().getEntityChangedEvent().addListener((ev, sender, args) -> updateGlusterFencingPolicyVisibility(object));
object.getEnableGlusterService().getEntityChangedEvent().addListener((ev, sender, args) -> {
importGlusterExplanationLabel.setVisible(object.getEnableGlusterService().getEntity() && object.getIsNew());
updateGlusterFencingPolicyVisibility(object);
});
updateGlusterFencingPolicyVisibility(object);
importGlusterExplanationLabel.setVisible(object.getEnableGlusterService().getEntity() && object.getIsNew());
object.getVersionSupportsCpuThreads().getEntityChangedEvent().addListener((ev, sender, args) -> cpuThreadsRow.setVisible(object.getVersionSupportsCpuThreads().getEntity()));
schedulerOptimizationInfoIcon.setText(SafeHtmlUtils.fromTrustedString(templates.italicText(object.getSchedulerOptimizationInfoMessage()).asString().replaceAll("(\r\n|\n)", // $NON-NLS-1$ //$NON-NLS-2$
"<br />")));
allowOverbookingInfoIcon.setText(SafeHtmlUtils.fromTrustedString(templates.italicText(object.getAllowOverbookingInfoMessage()).asString().replaceAll("(\r\n|\n)", // $NON-NLS-1$ //$NON-NLS-2$
"<br />")));
allowOverbookingRow.setVisible(allowOverbookingEditor.isVisible());
object.getVersion().getPropertyChangedEvent().addListener((ev, sender, args) -> {
if (object.getVersion().getSelectedItem() != null) {
Version clusterVersion = object.getVersion().getSelectedItem();
migrationPolicyDetails.setVisible(AsyncDataProvider.getInstance().isMigrationPoliciesSupported(clusterVersion));
}
});
object.getAdditionalClusterFeatures().getItemsChangedEvent().addListener((ev, sender, args) -> {
List<List<AdditionalFeature>> items = (List<List<AdditionalFeature>>) object.getAdditionalClusterFeatures().getItems();
// Hide the fields if there is no feature to show
additionalFeaturesExpander.setVisible(!items.get(0).isEmpty());
additionalFeaturesExpanderContent.setVisible(!items.get(0).isEmpty());
});
object.getMigrationPolicies().getSelectedItemChangedEvent().addListener((ev, sender, args) -> {
MigrationPolicy selectedPolicy = object.getMigrationPolicies().getSelectedItem();
if (selectedPolicy != null) {
migrationPolicyDetails.setHTML(templates.migrationPolicyDetails(selectedPolicy.getName(), selectedPolicy.getDescription()));
} else {
// $NON-NLS-1$
migrationPolicyDetails.setText("");
}
});
}
Aggregations