Search in sources :

Example 6 with EntityModelCheckBoxEditor

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

the class GlusterVolumeGeoRepCreateSessionPopupView method initEditors.

private void initEditors() {
    showEligibleVolumes = new EntityModelCheckBoxEditor(Align.RIGHT);
    startSessionEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    slaveClusterEditor = new ListModelTypeAheadListBoxEditor<>(new ListModelTypeAheadListBoxEditor.NullSafeSuggestBoxRenderer<String>() {

        @Override
        public String getReplacementStringNullSafe(String data) {
            return data;
        }

        @Override
        public String getDisplayStringNullSafe(String data) {
            return templates.typeAheadNameDescription(data == null ? constants.empty() : data, constants.empty()).asString();
        }
    });
    slaveHostIpEditor = new ListModelTypeAheadListBoxEditor<>(new ListModelTypeAheadListBoxEditor.NullSafeSuggestBoxRenderer<Pair<String, Guid>>() {

        @Override
        public String getReplacementStringNullSafe(Pair<String, Guid> data) {
            return data.getFirst();
        }

        @Override
        public String getDisplayStringNullSafe(Pair<String, Guid> data) {
            return templates.typeAheadNameDescription(data == null ? constants.empty() : data.getFirst(), constants.empty()).asString();
        }
    });
    slaveVolumeEditor = new ListModelTypeAheadListBoxEditor<>(new ListModelTypeAheadListBoxEditor.NullSafeSuggestBoxRenderer<GlusterVolumeEntity>() {

        @Override
        public String getReplacementStringNullSafe(GlusterVolumeEntity data) {
            return data.getName();
        }

        @Override
        public String getDisplayStringNullSafe(GlusterVolumeEntity data) {
            return templates.typeAheadNameDescription(data.getName() == null ? constants.empty() : data.getName(), data.getClusterName() == null ? constants.empty() : data.getClusterName()).asString();
        }
    });
}
Also used : GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor) Guid(org.ovirt.engine.core.compat.Guid) Pair(org.ovirt.engine.core.common.utils.Pair)

Example 7 with EntityModelCheckBoxEditor

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

the class StoragePopupView method initListBoxEditors.

@SuppressWarnings({ "unchecked", "rawtypes" })
void initListBoxEditors() {
    datacenterListEditor = new ListModelListBoxEditor<>(new AbstractRenderer<StoragePool>() {

        @Override
        public String render(StoragePool storage) {
            // $NON-NLS-1$
            String formattedString = "";
            if (storage != null) {
                // Get formatted storage type and format using Enum renders
                // $NON-NLS-1$
                String storageType = storage.isLocal() ? constants.storageTypeLocal() : "";
                String storageFormatType = // $NON-NLS-1$
                storage.getStoragePoolFormatType() == null ? // $NON-NLS-1$
                "" : new EnumRenderer<StorageFormatType>().render(storage.getStoragePoolFormatType());
                // Add storage type and format if available
                if (!storageType.isEmpty() || !storageFormatType.isEmpty()) {
                    // $NON-NLS-1$
                    formattedString = " (";
                    if (storage.isLocal()) {
                        formattedString += storageType;
                    } else {
                        formattedString += storageFormatType;
                    }
                    // $NON-NLS-1$
                    formattedString += ")";
                }
                formattedString = storage.getName() + formattedString;
            }
            return formattedString;
        }
    });
    formatListEditor = new ListModelListBoxEditor<>(new EnumRenderer());
    hostListEditor = new ListModelListBoxEditor<>(new NameRenderer<VDS>());
    domainFunctionListEditor = new ListModelListBoxEditor<>(new EnumRenderer<StorageDomainType>());
    storageTypeListEditor = new ListModelListBoxEditor<>(new EnumRenderer<StorageType>());
    activateDomainEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    wipeAfterDeleteEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    backup = new EntityModelCheckBoxEditor(Align.RIGHT);
    discardAfterDeleteEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
}
Also used : EnumRenderer(org.ovirt.engine.ui.common.widget.renderer.EnumRenderer) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) AbstractRenderer(com.google.gwt.text.shared.AbstractRenderer) NameRenderer(org.ovirt.engine.ui.common.widget.renderer.NameRenderer) EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor)

Example 8 with EntityModelCheckBoxEditor

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

the class ImportCloneDialogPopupView method initSelectWidgets.

private void initSelectWidgets() {
    applyToAllEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    // $NON-NLS-1$
    cloneEditor = new EntityModelRadioButtonEditor("1");
    // $NON-NLS-1$
    noCloneEditor = new EntityModelRadioButtonEditor("1");
}
Also used : EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor) EntityModelRadioButtonEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor)

Example 9 with EntityModelCheckBoxEditor

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

the class MultipleHostsPopupView method initEditors.

private void initEditors() {
    hostsTable = new EntityModelCellTable<>(SelectionMode.SINGLE, true);
    useCommonPasswordEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    configureFirewallEditor = new EntityModelCheckBoxEditor(Align.LEFT);
    configureFirewallEditor.setAccessible(true);
}
Also used : EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor)

Example 10 with EntityModelCheckBoxEditor

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

the class GlusterStorageView method initEditors.

void initEditors() {
    linkGlusterVolumeEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    glusterVolumesEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<GlusterVolumeEntity>() {

        @Override
        protected String renderNullSafe(GlusterVolumeEntity glusterVolume) {
            if (glusterVolume == null) {
                // $NON-NLS-1$
                return "";
            } else {
                if (glusterVolume.getBricks().isEmpty()) {
                    return glusterVolume.getName();
                }
                GlusterBrickEntity brick = glusterVolume.getBricks().get(0);
                if (brick == null) {
                    return glusterVolume.getName();
                }
                String server = brick.getNetworkId() != null && StringHelper.isNotNullOrEmpty(brick.getNetworkAddress()) ? brick.getNetworkAddress() : brick.getServerName();
                // $NON-NLS-1$
                return server + ":/" + glusterVolume.getName();
            }
        }
    });
}
Also used : GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) NullSafeRenderer(org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer) EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor)

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