use of org.ovirt.engine.core.common.businessentities.AdditionalFeature 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("");
}
});
}
use of org.ovirt.engine.core.common.businessentities.AdditionalFeature in project ovirt-engine by oVirt.
the class ClusterPopupView method initCheckBoxEditors.
private void initCheckBoxEditors() {
enableOvirtServiceEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
enableGlusterServiceEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
importGlusterConfigurationEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
countThreadsAsCoresEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
enableTrustedServiceEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
enableHaReservationEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
enableOptionalReasonEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
enableHostMaintenanceReasonEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
enableKsm = new EntityModelCheckBoxEditor(Align.RIGHT);
// $NON-NLS-1$
enableKsm.getContentWidgetContainer().setWidth("350px");
enableBallooning = new EntityModelCheckBoxEditor(Align.RIGHT);
// $NON-NLS-1$
enableBallooning.getContentWidgetContainer().setWidth("350px");
rngHwrngSourceRequired = new EntityModelCheckBoxEditor(Align.RIGHT);
fencingEnabledCheckBox = new EntityModelCheckBoxEditor(Align.RIGHT);
skipFencingIfSDActiveCheckBox = new EntityModelCheckBoxEditor(Align.RIGHT);
skipFencingIfConnectivityBrokenCheckBox = new EntityModelCheckBoxEditor(Align.RIGHT);
skipFencingIfGlusterBricksUpCheckBox = new EntityModelCheckBoxEditor(Align.RIGHT);
skipFencingIfGlusterQuorumNotMetCheckBox = new EntityModelCheckBoxEditor(Align.RIGHT);
spiceProxyOverrideEnabled = new EntityModelCheckBoxEditor(Align.RIGHT);
additionalFeaturesEditor = new ListModelCheckBoxGroup<>(new AbstractRenderer<AdditionalFeature>() {
@Override
public String render(AdditionalFeature feature) {
return feature.getDescription();
}
});
}
Aggregations