Search in sources :

Example 1 with NameRenderer

use of org.ovirt.engine.ui.common.widget.renderer.NameRenderer 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 2 with NameRenderer

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

the class VmDiskPopupWidget method initManualWidgets.

@SuppressWarnings({ "unchecked", "rawtypes" })
private void initManualWidgets() {
    storageDomainEditor = new ListModelListBoxEditor<>(new StorageDomainFreeSpaceRenderer());
    hostListEditor = new ListModelListBoxEditor<>(new NameRenderer<VDS>());
    diskProfileEditor = new ListModelListBoxEditor<>(new NameRenderer<DiskProfile>());
    quotaEditor = new ListModelListBoxEditor<>(new NameRenderer<Quota>());
    interfaceEditor = new ListModelListBoxEditor<>(new EnumRenderer());
    datacenterEditor = new ListModelListBoxEditor<>(new NameRenderer<StoragePool>());
    cinderVolumeTypeEditor = new ListModelListBoxEditor<>();
    volumeTypeEditor = new ListModelListBoxEditor<>(new EnumRenderer());
    storageTypeEditor = new ListModelListBoxEditor<>(new EnumRenderer());
    plugDiskToVmEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    wipeAfterDeleteEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    isBootableEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    isShareableEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    isReadOnlyEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    passDiscardEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    isUsingScsiReservationEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    isScsiPassthroughEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    isSgIoUnfilteredEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
    interfaceInfoIcon = new InfoIcon(templates.italicText(constants.diskInterfaceInfo()));
    cinderVolumeTypeInfoIcon = new InfoIcon(templates.italicText(constants.cinderVolumeTypeInfoIcon()));
    scsiReservationInfoIcon = new InfoIcon(templates.italicText(constants.scsiReservationInfoIcon()));
}
Also used : EnumRenderer(org.ovirt.engine.ui.common.widget.renderer.EnumRenderer) NameRenderer(org.ovirt.engine.ui.common.widget.renderer.NameRenderer) InfoIcon(org.ovirt.engine.ui.common.widget.dialog.InfoIcon) EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor) StorageDomainFreeSpaceRenderer(org.ovirt.engine.ui.common.widget.renderer.StorageDomainFreeSpaceRenderer)

Example 3 with NameRenderer

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

the class VmRunOncePopupWidget method initComboBox.

void initComboBox() {
    sysPrepDomainNameListBoxEditor = new ListModelListBoxEditor<>();
    sysPrepDomainNameTextBoxEditor = new StringEntityModelTextBoxEditor();
    sysPrepDomainNameListBoxEditor.asListBox().addValueChangeHandler(event -> runOnceModel.sysPrepListBoxChanged());
    sysPrepDomainNameComboBox = new ComboBox<>(sysPrepDomainNameListBoxEditor, sysPrepDomainNameTextBoxEditor);
    defaultHostEditor = new ListModelListBoxEditor<>(new NameRenderer<VDS>());
    emulatedMachine = new ListModelTypeAheadChangeableListBoxEditor(new ListModelTypeAheadChangeableListBoxEditor.NullSafeSuggestBoxRenderer() {

        @Override
        public String getDisplayStringNullSafe(String data) {
            return typeAheadNameTemplateNullSafe(data);
        }
    }, false);
    customCpu = new ListModelTypeAheadChangeableListBoxEditor(new ListModelTypeAheadChangeableListBoxEditor.NullSafeSuggestBoxRenderer() {

        @Override
        public String getDisplayStringNullSafe(String data) {
            return typeAheadNameTemplateNullSafe(data);
        }
    }, false);
}
Also used : NameRenderer(org.ovirt.engine.ui.common.widget.renderer.NameRenderer) StringEntityModelTextBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextBoxEditor) ListModelTypeAheadChangeableListBoxEditor(org.ovirt.engine.ui.common.widget.editor.ListModelTypeAheadChangeableListBoxEditor)

Example 4 with NameRenderer

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

the class VmMigratePopupView method initEditors.

void initEditors() {
    // $NON-NLS-1$
    selectHostAutomaticallyEditor = new EntityModelRadioButtonEditor("1");
    // $NON-NLS-1$
    selectDestinationHostEditor = new EntityModelRadioButtonEditor("1");
    hostsListEditor = new ListModelListBoxEditor<>(new NameRenderer<VDS>());
}
Also used : NameRenderer(org.ovirt.engine.ui.common.widget.renderer.NameRenderer) EntityModelRadioButtonEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor)

Example 5 with NameRenderer

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

the class GlusterClusterSnapshotConfigureOptionsPopupView method initEditors.

private void initEditors() {
    clusterEditor = new ListModelListBoxEditor<>(new NameRenderer<Cluster>());
    configsTable = new EntityModelCellTable<>(false, true);
    configsTable.setSelectionModel(new NoSelectionModel());
    configsTable.addColumn(new AbstractEntityModelTextColumn<GlusterVolumeSnapshotConfig>() {

        @Override
        public String getText(GlusterVolumeSnapshotConfig object) {
            return object.getParamName();
        }
    }, constants.volumeSnapshotConfigName(), // $NON-NLS-1$
    "200px");
    Column<EntityModel<GlusterVolumeSnapshotConfig>, String> valueColumn = new Column<EntityModel<GlusterVolumeSnapshotConfig>, String>(new TextInputCell()) {

        @Override
        public String getValue(EntityModel<GlusterVolumeSnapshotConfig> object) {
            return object.getEntity().getParamValue();
        }
    };
    // $NON-NLS-1$
    configsTable.addColumn(valueColumn, constants.volumeSnapshotConfigValue(), "100px");
    valueColumn.setFieldUpdater((index, object, value) -> object.getEntity().setParamValue(value));
}
Also used : GlusterVolumeSnapshotConfig(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig) AbstractEntityModelTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn) Column(com.google.gwt.user.cellview.client.Column) NameRenderer(org.ovirt.engine.ui.common.widget.renderer.NameRenderer) NoSelectionModel(com.google.gwt.view.client.NoSelectionModel) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) TextInputCell(com.google.gwt.cell.client.TextInputCell)

Aggregations

NameRenderer (org.ovirt.engine.ui.common.widget.renderer.NameRenderer)10 EnumRenderer (org.ovirt.engine.ui.common.widget.renderer.EnumRenderer)5 EntityModelCheckBoxEditor (org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor)4 AbstractRenderer (com.google.gwt.text.shared.AbstractRenderer)3 EntityModelRadioButtonEditor (org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor)3 Column (com.google.gwt.user.cellview.client.Column)2 OpenstackNetworkProviderProperties (org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties)2 Provider (org.ovirt.engine.core.common.businessentities.Provider)2 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)2 GroupedListModelListBox (org.ovirt.engine.ui.common.widget.editor.GroupedListModelListBox)2 BooleanRendererWithNullText (org.ovirt.engine.ui.common.widget.renderer.BooleanRendererWithNullText)2 NullSafeRenderer (org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer)2 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)2 AssetProvider (org.ovirt.engine.ui.webadmin.gin.AssetProvider)2 Context (com.google.gwt.cell.client.Cell.Context)1 TextInputCell (com.google.gwt.cell.client.TextInputCell)1 GWT (com.google.gwt.core.client.GWT)1 EventBus (com.google.gwt.event.shared.EventBus)1 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)1 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)1