Search in sources :

Example 11 with AdditionalFeature

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("");
        }
    });
}
Also used : Version(org.ovirt.engine.core.compat.Version) List(java.util.List) AdditionalFeature(org.ovirt.engine.core.common.businessentities.AdditionalFeature) MigrationPolicy(org.ovirt.engine.core.common.migration.MigrationPolicy)

Example 12 with AdditionalFeature

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();
        }
    });
}
Also used : AbstractRenderer(com.google.gwt.text.shared.AbstractRenderer) AdditionalFeature(org.ovirt.engine.core.common.businessentities.AdditionalFeature) EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor)

Aggregations

AdditionalFeature (org.ovirt.engine.core.common.businessentities.AdditionalFeature)12 SupportedAdditionalClusterFeature (org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature)6 List (java.util.List)4 Version (org.ovirt.engine.core.compat.Version)4 ArrayList (java.util.ArrayList)3 HashSet (java.util.HashSet)3 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)3 MigrationPolicy (org.ovirt.engine.core.common.migration.MigrationPolicy)3 Arrays (java.util.Arrays)2 Collection (java.util.Collection)2 Collections (java.util.Collections)2 Comparator (java.util.Comparator)2 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 Map (java.util.Map)2 Objects (java.util.Objects)2 Set (java.util.Set)2 ArchitectureType (org.ovirt.engine.core.common.businessentities.ArchitectureType)2 MacPool (org.ovirt.engine.core.common.businessentities.MacPool)2 MigrateOnErrorOptions (org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions)2