use of org.ovirt.engine.core.common.businessentities.storage.RepoImage in project ovirt-engine by oVirt.
the class ImportExportImagePopupView method initTable.
private void initTable(ImportExportRepoImageBaseModel model) {
imageList = new EntityModelCellTable<>(SelectionMode.NONE, true);
imageList.enableColumnResizing();
if (model.isImportModel()) {
imageList.addColumn(new AbstractEntityModelTextColumn<RepoImage>() {
@Override
public String getText(RepoImage image) {
return image.getRepoImageTitle();
}
}, constants.fileNameIso(), // $NON-NLS-1$
"100%");
imageList.addColumn(new DiskAliasTextColumn(new DiskAliasFieldUpdater()), templates.sub(constants.diskSnapshotAlias(), constants.clickToEdit()), // $NON-NLS-1$
"150px");
imageList.addColumn(new AbstractEntityModelTextColumn<RepoImage>() {
@Override
public String getText(RepoImage image) {
return image.getFileType().toString();
}
}, constants.typeIso(), // $NON-NLS-1$
"75px");
imageList.addColumn(new AbstractDiskSizeColumn<EntityModel<RepoImage>>(SizeConverter.SizeUnit.BYTES) {
@Override
protected Long getRawValue(EntityModel<RepoImage> image) {
return image.getEntity().getSize();
}
}, constants.size(), // $NON-NLS-1$
"75px");
} else {
imageList.addColumn(new AbstractEntityModelTextColumn<DiskImage>() {
@Override
public String getText(DiskImage image) {
return image.getDiskAlias();
}
}, constants.fileNameIso(), // $NON-NLS-1$
"100%");
imageList.addColumn(new AbstractEntityModelTextColumn<DiskImage>() {
@Override
public String getText(DiskImage image) {
return ImageFileType.Disk.toString();
}
}, constants.typeIso(), // $NON-NLS-1$
"75px");
imageList.addColumn(new AbstractDiskSizeColumn<EntityModel<DiskImage>>(SizeConverter.SizeUnit.BYTES) {
@Override
protected Long getRawValue(EntityModel<DiskImage> image) {
return image.getEntity().getSize();
}
}, constants.provisionedSizeTemplate(), // $NON-NLS-1$
"75px");
}
// $NON-NLS-1$
imageList.setWidth("100%");
imageList.setEmptyTableWidget(new NoItemsLabel());
imageListPanel.setWidget(imageList);
}
Aggregations