Search in sources :

Example 1 with EntityModelCheckBoxEditor

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

the class RemoveBrickPopupView method initEditors.

private void initEditors() {
    migrateEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    migrateInfoIcon = new InfoIcon(templates.italicText(constants.removeBricksMigrateDataInfo()));
}
Also used : InfoIcon(org.ovirt.engine.ui.common.widget.dialog.InfoIcon) EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor)

Example 2 with EntityModelCheckBoxEditor

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

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

the class ManageGlusterSwiftPopupView method initEditors.

private void initEditors() {
    swiftStatusEditor = new EntityModelLabelEditor<>(new EnumRenderer<GlusterServiceStatus>());
    // $NON-NLS-1$
    startSwift = new EntityModelRadioButtonEditor("swift_action", Align.RIGHT);
    // $NON-NLS-1$
    stopSwift = new EntityModelRadioButtonEditor("swift_action", Align.RIGHT);
    // $NON-NLS-1$
    restartSwift = new EntityModelRadioButtonEditor("swift_action", Align.RIGHT);
    manageSwiftServerLevel = new EntityModelCheckBoxEditor(Align.RIGHT);
    hostServicesTable = new EntityModelCellTable<>(false, true);
    hostServicesTable.addColumn(new AbstractEntityModelTextColumn<GlusterServerService>() {

        @Override
        public String getText(GlusterServerService entity) {
            return entity.getHostName();
        }
    }, constants.hostGlusterSwift());
    hostServicesTable.addColumn(new AbstractEnumColumn<EntityModel, ServiceType>() {

        @Override
        protected ServiceType getRawValue(EntityModel object) {
            return ((GlusterSwiftServiceModel) object).getEntity().getServiceType();
        }
    }, constants.serviceNameGlusterSwift());
    hostServicesTable.addColumn(new AbstractEnumColumn<EntityModel, GlusterServiceStatus>() {

        @Override
        protected GlusterServiceStatus getRawValue(EntityModel object) {
            return ((GlusterSwiftServiceModel) object).getEntity().getStatus();
        }
    }, constants.serviceStatusGlusterSwift());
    Column<EntityModel, Boolean> startSwiftColumn = new Column<EntityModel, Boolean>(new RadioboxCell(false, true)) {

        @Override
        public Boolean getValue(EntityModel object) {
            GlusterSwiftServiceModel swiftServiceModel = (GlusterSwiftServiceModel) object;
            return swiftServiceModel.getStartSwift().getEntity();
        }

        @Override
        public void render(Context context, EntityModel object, SafeHtmlBuilder sb) {
            GlusterSwiftServiceModel swiftServiceModel = (GlusterSwiftServiceModel) object;
            if (swiftServiceModel.getStartSwift().getIsChangable()) {
                super.render(context, object, sb);
            }
        }
    };
    startSwiftColumn.setFieldUpdater((index, object, value) -> {
        GlusterSwiftServiceModel swiftModel = (GlusterSwiftServiceModel) object;
        swiftModel.getStartSwift().setEntity(value);
        if (value) {
            swiftModel.getStopSwift().setEntity(false);
            swiftModel.getRestartSwift().setEntity(false);
            hostServicesTable.redraw();
        }
    });
    hostServicesTable.addColumn(startSwiftColumn, constants.startGlusterSwift());
    Column<EntityModel, Boolean> stopSwiftColumn = new Column<EntityModel, Boolean>(new RadioboxCell(false, true)) {

        @Override
        public Boolean getValue(EntityModel object) {
            GlusterSwiftServiceModel swiftServiceModel = (GlusterSwiftServiceModel) object;
            return swiftServiceModel.getStopSwift().getEntity();
        }

        @Override
        public void render(Context context, EntityModel object, SafeHtmlBuilder sb) {
            GlusterSwiftServiceModel swiftServiceModel = (GlusterSwiftServiceModel) object;
            if (swiftServiceModel.getStopSwift().getIsChangable()) {
                super.render(context, object, sb);
            }
        }
    };
    stopSwiftColumn.setFieldUpdater((index, object, value) -> {
        GlusterSwiftServiceModel swiftModel = (GlusterSwiftServiceModel) object;
        if (swiftModel.getStopSwift().getIsChangable()) {
            swiftModel.getStopSwift().setEntity(value);
            if (value) {
                swiftModel.getStartSwift().setEntity(false);
                swiftModel.getRestartSwift().setEntity(false);
                hostServicesTable.redraw();
            }
        }
    });
    hostServicesTable.addColumn(stopSwiftColumn, constants.stopGlusterSwift());
    Column<EntityModel, Boolean> restartSwiftColumn = new Column<EntityModel, Boolean>(new RadioboxCell(false, true)) {

        @Override
        public Boolean getValue(EntityModel object) {
            GlusterSwiftServiceModel swiftServiceModel = (GlusterSwiftServiceModel) object;
            return swiftServiceModel.getRestartSwift().getEntity();
        }

        @Override
        public void render(Context context, EntityModel object, SafeHtmlBuilder sb) {
            GlusterSwiftServiceModel swiftServiceModel = (GlusterSwiftServiceModel) object;
            if (swiftServiceModel.getRestartSwift().getIsChangable()) {
                super.render(context, object, sb);
            }
        }
    };
    restartSwiftColumn.setFieldUpdater((index, object, value) -> {
        GlusterSwiftServiceModel swiftModel = (GlusterSwiftServiceModel) object;
        swiftModel.getRestartSwift().setEntity(value);
        if (value) {
            swiftModel.getStartSwift().setEntity(false);
            swiftModel.getStopSwift().setEntity(false);
            hostServicesTable.redraw();
        }
    });
    hostServicesTable.addColumn(restartSwiftColumn, constants.restartGlusterSwift());
}
Also used : Context(com.google.gwt.cell.client.Cell.Context) GlusterServerService(org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) RadioboxCell(org.ovirt.engine.ui.common.widget.table.cell.RadioboxCell) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) EnumRenderer(org.ovirt.engine.ui.common.widget.renderer.EnumRenderer) GlusterServiceStatus(org.ovirt.engine.core.common.businessentities.gluster.GlusterServiceStatus) AbstractEntityModelTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn) AbstractEnumColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn) Column(com.google.gwt.user.cellview.client.Column) ServiceType(org.ovirt.engine.core.common.businessentities.gluster.ServiceType) EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor) GlusterSwiftServiceModel(org.ovirt.engine.ui.uicommonweb.models.clusters.GlusterSwiftServiceModel) EntityModelRadioButtonEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor)

Example 4 with EntityModelCheckBoxEditor

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

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

the class GeoRepActionConfirmPopUpView method initEditors.

private void initEditors() {
    forceEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    geoRepForceHelpIcon = new InfoIcon(templates.italicText(constants.notAvailableLabel()));
}
Also used : InfoIcon(org.ovirt.engine.ui.common.widget.dialog.InfoIcon) 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