Search in sources :

Example 1 with NullSafeRenderer

use of org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer in project ovirt-engine by oVirt.

the class ReplaceBrickPopupView method initEditors.

private void initEditors() {
    showBricksListEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    serverEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<VDS>() {

        @Override
        public String renderNullSafe(VDS vds) {
            return vds.getHostName();
        }
    });
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) NullSafeRenderer(org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer) EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor)

Example 2 with NullSafeRenderer

use of org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer in project ovirt-engine by oVirt.

the class AddBrickPopupView method initEditors.

private void initEditors() {
    volumeTypeEditor = new EntityModelLabelEditor<>(new EnumRenderer<GlusterVolumeType>());
    forceEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    showBricksListEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    serverEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<VDS>() {

        @Override
        public String renderNullSafe(VDS vds) {
            return vds.getHostName();
        }
    });
}
Also used : EnumRenderer(org.ovirt.engine.ui.common.widget.renderer.EnumRenderer) VDS(org.ovirt.engine.core.common.businessentities.VDS) NullSafeRenderer(org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer) EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor)

Example 3 with NullSafeRenderer

use of org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer 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)

Example 4 with NullSafeRenderer

use of org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer in project ovirt-engine by oVirt.

the class HostConfigureLocalStoragePopupView method initialize.

private void initialize() {
    dataCenterVersionEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<Version>() {

        @Override
        public String renderNullSafe(Version object) {
            return object.getValue();
        }
    });
    clusterCpuTypeEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<ServerCpu>() {

        @Override
        public String renderNullSafe(ServerCpu object) {
            return object.getCpuName();
        }
    });
    // Optimization options.
    // $NON-NLS-1$
    optimizationNoneEditor = new EntityModelRadioButtonEditor("1");
    // $NON-NLS-1$
    optimizationForServerEditor = new EntityModelRadioButtonEditor("1");
    // $NON-NLS-1$
    optimizationForDesktopEditor = new EntityModelRadioButtonEditor("1");
    // $NON-NLS-1$
    optimizationCustomEditor = new EntityModelRadioButtonEditor("1");
    optimizationCustomEditor.setVisible(false);
    countThreadsAsCoresEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    memoryOptimizationInfo = new InfoIcon(templates.italicText(constants.clusterPopupMemoryOptimizationInfo()));
    memoryOptimizationInfo.setTooltipMaxWidth(TooltipWidth.W520);
    cpuThreadsInfo = new InfoIcon(templates.italicText(constants.clusterPopupCpuThreadsInfo()));
    cpuThreadsInfo.setTooltipMaxWidth(TooltipWidth.W620);
}
Also used : Version(org.ovirt.engine.core.compat.Version) InfoIcon(org.ovirt.engine.ui.common.widget.dialog.InfoIcon) NullSafeRenderer(org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer) ServerCpu(org.ovirt.engine.core.common.businessentities.ServerCpu) EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor) EntityModelRadioButtonEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor)

Example 5 with NullSafeRenderer

use of org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer in project ovirt-engine by oVirt.

the class HostInstallPopupView method initEditors.

void initEditors() {
    isoEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<RpmVersion>() {

        @Override
        public String renderNullSafe(RpmVersion version) {
            // Format string to contain major.minor version only.
            return version.getRpmName();
        }
    });
    // $NON-NLS-1$
    rbPassword = new RadioButton("1");
    // $NON-NLS-1$
    rbPublicKey = new RadioButton("1");
    publicKeyEditor = new StringEntityModelTextAreaLabelEditor();
    activateHostAfterInstallEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    overrideIpTablesEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
}
Also used : StringEntityModelTextAreaLabelEditor(org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextAreaLabelEditor) NullSafeRenderer(org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer) RadioButton(com.google.gwt.user.client.ui.RadioButton) EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor) RpmVersion(org.ovirt.engine.core.compat.RpmVersion)

Aggregations

NullSafeRenderer (org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer)10 EntityModelCheckBoxEditor (org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor)8 EnumRenderer (org.ovirt.engine.ui.common.widget.renderer.EnumRenderer)4 RepoImage (org.ovirt.engine.core.common.businessentities.storage.RepoImage)3 EntityModelRadioButtonEditor (org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor)3 AbstractRenderer (com.google.gwt.text.shared.AbstractRenderer)2 Quota (org.ovirt.engine.core.common.businessentities.Quota)2 ServerCpu (org.ovirt.engine.core.common.businessentities.ServerCpu)2 VDS (org.ovirt.engine.core.common.businessentities.VDS)2 Version (org.ovirt.engine.core.compat.Version)2 ListModelTypeAheadChangeableListBoxEditor (org.ovirt.engine.ui.common.widget.editor.ListModelTypeAheadChangeableListBoxEditor)2 VncKeyMapRenderer (org.ovirt.engine.ui.common.widget.editor.VncKeyMapRenderer)2 BooleanRendererWithNullText (org.ovirt.engine.ui.common.widget.renderer.BooleanRendererWithNullText)2 NameRenderer (org.ovirt.engine.ui.common.widget.renderer.NameRenderer)2 NumberFormatRenderer (com.google.gwt.text.client.NumberFormatRenderer)1 RadioButton (com.google.gwt.user.client.ui.RadioButton)1 ArchitectureType (org.ovirt.engine.core.common.businessentities.ArchitectureType)1 BootSequence (org.ovirt.engine.core.common.businessentities.BootSequence)1 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)1 InstanceType (org.ovirt.engine.core.common.businessentities.InstanceType)1