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);
}
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()));
}
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);
}
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>());
}
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));
}
Aggregations