Search in sources :

Example 16 with EntityModelCheckBoxEditor

use of org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor in project ovirt-engine by oVirt.

the class HostPopupView method initEditors.

private void initEditors() {
    publicKeyEditor = new StringEntityModelTextAreaLabelEditor();
    // List boxes
    clusterEditor = new GroupedListModelListBoxEditor<>(new GroupedListModelListBox<Cluster>(new NameRenderer<Cluster>()) {

        @Override
        public String getModelLabel(Cluster model) {
            return model.getName();
        }

        @Override
        public String getGroupLabel(Cluster model) {
            return messages.hostDataCenter(model.getStoragePoolName());
        }

        @Override
        public Comparator<Cluster> getComparator() {
            return new DataCenterClusterComparator();
        }

        /**
         * Comparator that sorts on data center name first, and then cluster name. Ignoring case.
         */
        final class DataCenterClusterComparator implements Comparator<Cluster> {

            @Override
            public int compare(Cluster cluster1, Cluster cluster2) {
                if (cluster1.getStoragePoolName() != null && cluster2.getStoragePoolName() == null) {
                    return -1;
                } else if (cluster2.getStoragePoolName() != null && cluster1.getStoragePoolName() == null) {
                    return 1;
                } else if (cluster1.getStoragePoolName() == null && cluster2.getStoragePoolName() == null) {
                    return 0;
                }
                if (cluster1.getStoragePoolName().equals(cluster2.getStoragePoolName())) {
                    return cluster1.getName().compareToIgnoreCase(cluster2.getName());
                } else {
                    return cluster1.getStoragePoolName().compareToIgnoreCase(cluster2.getStoragePoolName());
                }
            }
        }
    });
    externalHostNameEditor = new ListModelListBoxEditor<>(new NameRenderer<VDS>());
    providersEditor = new ListModelListBoxEditor<>(new NameRenderer<Provider<OpenstackNetworkProviderProperties>>());
    externalDiscoveredHostsEditor = getListModelTypeAheadListBoxEditor();
    externalHostGroupsEditor = getListModelTypeAheadListBoxEditor();
    externalComputeResourceEditor = getListModelTypeAheadListBoxEditor();
    // Check boxes
    pmEnabledEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    pmEnabledEditor.setUsePatternFly(true);
    pmKdumpDetectionEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    pmKdumpDetectionEditor.setUsePatternFly(true);
    disableAutomaticPowerManagementEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    disableAutomaticPowerManagementEditor.setUsePatternFly(true);
    externalHostProviderEnabledEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    overrideIpTablesEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    // $NON-NLS-1$
    rbPassword = new RadioButton("1");
    // $NON-NLS-1$
    rbPublicKey = new RadioButton("1");
    // $NON-NLS-1$
    rbDiscoveredHost = new EntityModelRadioButtonEditor("2");
    // $NON-NLS-1$
    rbProvisionedHost = new EntityModelRadioButtonEditor("2");
    kernelCmdlineBlacklistNouveau = new EntityModelCheckBoxEditor(Align.RIGHT);
    kernelCmdlineIommu = new EntityModelCheckBoxEditor(Align.RIGHT);
    kernelCmdlineKvmNested = new EntityModelCheckBoxEditor(Align.RIGHT);
    kernelCmdlineUnsafeInterrupts = new EntityModelCheckBoxEditor(Align.RIGHT);
    kernelCmdlinePciRealloc = new EntityModelCheckBoxEditor(Align.RIGHT);
    consoleAddressEnabled = new EntityModelCheckBoxEditor(Align.RIGHT);
    hostedEngineDeployActionsEditor = new ListModelListBoxEditor<>(new EnumRenderer<HostedEngineDeployConfiguration.Action>());
}
Also used : StringEntityModelTextAreaLabelEditor(org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextAreaLabelEditor) NameRenderer(org.ovirt.engine.ui.common.widget.renderer.NameRenderer) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) RadioButton(com.google.gwt.user.client.ui.RadioButton) GroupedListModelListBox(org.ovirt.engine.ui.common.widget.editor.GroupedListModelListBox) EnumRenderer(org.ovirt.engine.ui.common.widget.renderer.EnumRenderer) EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor) OpenstackNetworkProviderProperties(org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties) EntityModelRadioButtonEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor) HostedEngineDeployConfiguration(org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration)

Example 17 with EntityModelCheckBoxEditor

use of org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor in project ovirt-engine by oVirt.

the class VolumePopupView method initCheckboxEditors.

private void initCheckboxEditors() {
    tcpTransportTypeEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    rdmaTransportTypeEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    arbiterVolumeEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    glusterAccessProtocolEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    nfsAccessProtocolEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    cifsAccessProtocolEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    optimizeForVirtStoreEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
}
Also used : EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor)

Example 18 with EntityModelCheckBoxEditor

use of org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor in project ovirt-engine by oVirt.

the class ImportVmFromExternalProviderPopupView method initListBoxEditors.

private void initListBoxEditors() {
    destClusterEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<Cluster>() {

        @Override
        public String renderNullSafe(Cluster object) {
            return object.getName();
        }
    });
    destClusterQuotaEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<Quota>() {

        @Override
        public String renderNullSafe(Quota object) {
            return object.getQuotaName();
        }
    });
    destStorageEditor = new ListModelListBoxEditor<>(new StorageDomainFreeSpaceRenderer());
    cpuProfileEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<CpuProfile>() {

        @Override
        protected String renderNullSafe(CpuProfile object) {
            return object.getName();
        }
    });
    disksAllocationEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<VolumeType>() {

        @Override
        protected String renderNullSafe(VolumeType object) {
            return new EnumRenderer<VolumeType>().render(object);
        }
    });
    attachDriversEditor = new EntityModelCheckBoxEditor(Align.LEFT);
    cdImageEditor = new ListModelListBoxOnlyEditor<>(new NullSafeRenderer<RepoImage>() {

        @Override
        protected String renderNullSafe(RepoImage object) {
            return object.getRepoImageId();
        }
    });
}
Also used : VolumeType(org.ovirt.engine.core.common.businessentities.storage.VolumeType) Quota(org.ovirt.engine.core.common.businessentities.Quota) RepoImage(org.ovirt.engine.core.common.businessentities.storage.RepoImage) NullSafeRenderer(org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer) CpuProfile(org.ovirt.engine.core.common.businessentities.profiles.CpuProfile) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor) StorageDomainFreeSpaceRenderer(org.ovirt.engine.ui.common.widget.renderer.StorageDomainFreeSpaceRenderer)

Example 19 with EntityModelCheckBoxEditor

use of org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor 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)

Example 20 with EntityModelCheckBoxEditor

use of org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor in project ovirt-engine by oVirt.

the class GlusterHookResolveConflictsPopupView method initEditors.

private void initEditors() {
    contentSourcesTable = new EntityModelCellTable<>(false, true);
    statusEditor = new EntityModelLabelEditor<>(new EnumRenderer<GlusterHookStatus>());
    resolveContentConflict = new EntityModelCheckBoxEditor(Align.RIGHT);
    useContentSourceEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<GlusterServerHook>() {

        @Override
        protected String renderNullSafe(GlusterServerHook hook) {
            return hook.getServerName();
        }
    });
    resolveStatusConflict = new EntityModelCheckBoxEditor(Align.RIGHT);
    // $NON-NLS-1$
    resolveStatusConflictEnable = new EntityModelRadioButtonEditor("status", Align.RIGHT);
    // $NON-NLS-1$
    resolveStatusConflictDisable = new EntityModelRadioButtonEditor("status", Align.RIGHT);
    resolveMissingConflict = new EntityModelCheckBoxEditor(Align.RIGHT);
    // $NON-NLS-1$
    resolveMissingConflictCopyEditor = new EntityModelRadioButtonEditor("missing_hook", Align.RIGHT);
    // $NON-NLS-1$
    resolveMissingConflictRemoveEditor = new EntityModelRadioButtonEditor("missing_hook", Align.RIGHT);
}
Also used : EnumRenderer(org.ovirt.engine.ui.common.widget.renderer.EnumRenderer) GlusterServerHook(org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook) NullSafeRenderer(org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer) EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor) EntityModelRadioButtonEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor)

Aggregations

EntityModelCheckBoxEditor (org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor)28 EnumRenderer (org.ovirt.engine.ui.common.widget.renderer.EnumRenderer)9 NullSafeRenderer (org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer)8 EntityModelRadioButtonEditor (org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor)7 InfoIcon (org.ovirt.engine.ui.common.widget.dialog.InfoIcon)5 NameRenderer (org.ovirt.engine.ui.common.widget.renderer.NameRenderer)4 AbstractRenderer (com.google.gwt.text.shared.AbstractRenderer)3 RadioButton (com.google.gwt.user.client.ui.RadioButton)2 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)2 OpenstackNetworkProviderProperties (org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties)2 Quota (org.ovirt.engine.core.common.businessentities.Quota)2 VDS (org.ovirt.engine.core.common.businessentities.VDS)2 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)2 RepoImage (org.ovirt.engine.core.common.businessentities.storage.RepoImage)2 EntityModelWidgetWithInfo (org.ovirt.engine.ui.common.widget.EntityModelWidgetWithInfo)2 GroupedListModelListBox (org.ovirt.engine.ui.common.widget.editor.GroupedListModelListBox)2 StringEntityModelTextAreaLabelEditor (org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextAreaLabelEditor)2 EnableableFormLabel (org.ovirt.engine.ui.common.widget.label.EnableableFormLabel)2 StorageDomainFreeSpaceRenderer (org.ovirt.engine.ui.common.widget.renderer.StorageDomainFreeSpaceRenderer)2 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)2