use of org.ovirt.engine.ui.common.widget.label.NoItemsLabel in project ovirt-engine by oVirt.
the class RegisterEntityInfoPanel method initAppsTable.
protected void initAppsTable() {
appsTable = new EntityModelCellTable<>(false, true);
AbstractTextColumn<String> appNameColumn = new AbstractTextColumn<String>() {
@Override
public String getValue(String appName) {
return appName;
}
};
appsTable.addColumn(appNameColumn, constants.nameSnapshot());
appsTable.setRowData(new ArrayList<EntityModel>());
// $NON-NLS-1$
appsTable.setWidth("100%");
appsTable.setSelectionModel(new NoSelectionModel());
appsTable.setEmptyTableWidget(new NoItemsLabel());
}
use of org.ovirt.engine.ui.common.widget.label.NoItemsLabel in project ovirt-engine by oVirt.
the class VmDiskAttachPopupWidget method initLunDisksTable.
private void initLunDisksTable() {
lunDiskTable.enableColumnResizing();
AbstractTextColumn<EntityModel> aliasColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getDiskAlias();
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(aliasColumn, constants.aliasVmDiskTable(), "60px");
AbstractTextColumn<EntityModel> descriptionColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getDiskDescription();
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(descriptionColumn, constants.descriptionVmDiskTable(), "85px");
AbstractTextColumn<EntityModel> lunIdColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getLun().getLUNId();
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(lunIdColumn, constants.lunIdSanStorage(), "60px");
AbstractTextColumn<EntityModel> idColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getId().toString();
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(idColumn, constants.idVmDiskTable(), "60px");
AbstractDiskSizeColumn<EntityModel> sizeColumn = new AbstractDiskSizeColumn<EntityModel>(SizeConverter.SizeUnit.GiB) {
@Override
protected Long getRawValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return (long) disk.getLun().getDeviceSize();
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(sizeColumn, constants.devSizeSanStorage(), "70px");
AbstractTextColumn<EntityModel> pathColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return String.valueOf(disk.getLun().getPathCount());
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(pathColumn, constants.pathSanStorage(), "40px");
AbstractTextColumn<EntityModel> vendorIdColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getLun().getVendorId();
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(vendorIdColumn, constants.vendorIdSanStorage(), "70px");
AbstractTextColumn<EntityModel> productIdColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getLun().getProductId();
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(productIdColumn, constants.productIdSanStorage(), "70px");
AbstractTextColumn<EntityModel> serialColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getLun().getSerial();
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(serialColumn, constants.serialSanStorage(), "70px");
// $NON-NLS-1$
lunDiskTable.addColumn(getDiskInterfaceSelectionColumn(), constants.interfaceVmDiskPopup(), "115px");
lunDiskTable.addColumn(getReadOnlyCheckBoxColumn(), new ImageResourceHeader(resources.readOnlyDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.readOnly())), // $NON-NLS-1$
"30px");
lunDiskTable.addColumn(getBootCheckBoxColumn(), new ImageResourceHeader(resources.bootableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.bootableDisk())), // $NON-NLS-1$
"30px");
lunDiskTable.addColumn(new AbstractImageResourceColumn<EntityModel>() {
@Override
public ImageResource getValue(EntityModel object) {
Disk disk = ((DiskModel) object.getEntity()).getDisk();
return disk.isShareable() ? resources.shareableDiskIcon() : null;
}
@Override
public SafeHtml getTooltip(EntityModel object) {
Disk disk = ((DiskModel) object.getEntity()).getDisk();
if (disk.isShareable()) {
return SafeHtmlUtils.fromSafeConstant(constants.shareable());
}
return null;
}
}, new ImageResourceHeader(resources.shareableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.shareable())), // $NON-NLS-1$
"30px");
// $NON-NLS-1$
lunDiskTable.setWidth("100%");
lunDiskTable.setEmptyTableWidget(new NoItemsLabel());
}
use of org.ovirt.engine.ui.common.widget.label.NoItemsLabel in project ovirt-engine by oVirt.
the class VmDiskAttachPopupWidget method initCinderDisksTable.
private void initCinderDisksTable() {
cinderDiskTable.enableColumnResizing();
AbstractTextColumn<EntityModel> aliasColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
CinderDisk disk = (CinderDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getDiskAlias();
}
};
// $NON-NLS-1$
cinderDiskTable.addColumn(aliasColumn, constants.aliasVmDiskTable(), "100px");
AbstractTextColumn<EntityModel> descriptionColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
CinderDisk disk = (CinderDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getDiskDescription();
}
};
// $NON-NLS-1$
cinderDiskTable.addColumn(descriptionColumn, constants.descriptionVmDiskTable(), "100px");
AbstractDiskSizeColumn<EntityModel> sizeColumn = new AbstractDiskSizeColumn<EntityModel>(SizeConverter.SizeUnit.GiB) {
@Override
protected Long getRawValue(EntityModel object) {
CinderDisk disk = (CinderDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getSizeInGigabytes();
}
};
// $NON-NLS-1$
cinderDiskTable.addColumn(sizeColumn, constants.provisionedSizeVmDiskTable(), "100px");
// $NON-NLS-1$
cinderDiskTable.addColumn(getDiskInterfaceSelectionColumn(), constants.interfaceVmDiskPopup(), "115px");
AbstractTextColumn<EntityModel> cinderVolumeTypeColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
Disk disk = ((DiskModel) object.getEntity()).getDisk();
return disk.getCinderVolumeType();
}
};
// $NON-NLS-1$
cinderDiskTable.addColumn(cinderVolumeTypeColumn, constants.cinderVolumeTypeDisk(), "90px");
cinderDiskTable.addColumn(getReadOnlyCheckBoxColumn(), new ImageResourceHeader(resources.readOnlyDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.readOnly())), // $NON-NLS-1$
"30px");
cinderDiskTable.addColumn(getBootCheckBoxColumn(), new ImageResourceHeader(resources.bootableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.bootableDisk())), // $NON-NLS-1$
"30px");
cinderDiskTable.addColumn(new AbstractImageResourceColumn<EntityModel>() {
@Override
public ImageResource getValue(EntityModel object) {
Disk disk = ((DiskModel) object.getEntity()).getDisk();
return disk.isShareable() ? resources.shareableDiskIcon() : null;
}
@Override
public SafeHtml getTooltip(EntityModel object) {
Disk disk = ((DiskModel) object.getEntity()).getDisk();
if (disk.isShareable()) {
return SafeHtmlUtils.fromSafeConstant(constants.shareable());
}
return null;
}
}, new ImageResourceHeader(resources.shareableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.shareable())), // $NON-NLS-1$
"30px");
// $NON-NLS-1$
cinderDiskTable.setWidth("100%");
cinderDiskTable.setEmptyTableWidget(new NoItemsLabel());
}
use of org.ovirt.engine.ui.common.widget.label.NoItemsLabel in project ovirt-engine by oVirt.
the class VmDiskAttachPopupWidget method initDiskImagesTable.
private void initDiskImagesTable() {
imageDiskTable.enableColumnResizing();
AbstractTextColumn<EntityModel> aliasColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
DiskImage diskImage = (DiskImage) ((DiskModel) object.getEntity()).getDisk();
return diskImage.getDiskAlias();
}
};
// $NON-NLS-1$
imageDiskTable.addColumn(aliasColumn, constants.aliasVmDiskTable(), "85px");
AbstractTextColumn<EntityModel> descriptionColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
DiskImage diskImage = (DiskImage) ((DiskModel) object.getEntity()).getDisk();
return diskImage.getDiskDescription();
}
};
// $NON-NLS-1$
imageDiskTable.addColumn(descriptionColumn, constants.descriptionVmDiskTable(), "85px");
AbstractTextColumn<EntityModel> idColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
DiskImage diskImage = (DiskImage) ((DiskModel) object.getEntity()).getDisk();
return diskImage.getId().toString();
}
};
// $NON-NLS-1$
imageDiskTable.addColumn(idColumn, constants.idVmDiskTable(), "85px");
AbstractDiskSizeColumn<EntityModel> sizeColumn = new AbstractDiskSizeColumn<EntityModel>() {
@Override
protected Long getRawValue(EntityModel object) {
DiskImage diskImage = (DiskImage) ((DiskModel) object.getEntity()).getDisk();
return diskImage.getSize();
}
};
// $NON-NLS-1$
imageDiskTable.addColumn(sizeColumn, constants.provisionedSizeVmDiskTable(), "100px");
AbstractDiskSizeColumn<EntityModel> actualSizeColumn = new AbstractDiskSizeColumn<EntityModel>() {
@Override
protected Long getRawValue(EntityModel object) {
DiskImage diskImage = (DiskImage) ((DiskModel) object.getEntity()).getDisk();
return diskImage.getActualSizeInBytes();
}
};
// $NON-NLS-1$
imageDiskTable.addColumn(actualSizeColumn, constants.sizeVmDiskTable(), "100px");
AbstractTextColumn<EntityModel> storageDomainColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
DiskImage diskImage = (DiskImage) ((DiskModel) object.getEntity()).getDisk();
return diskImage.getStoragesNames().get(0);
}
};
// $NON-NLS-1$
imageDiskTable.addColumn(storageDomainColumn, constants.storageDomainVmDiskTable(), "100px");
// $NON-NLS-1$
imageDiskTable.addColumn(getDiskInterfaceSelectionColumn(), constants.interfaceVmDiskPopup(), "115px");
imageDiskTable.addColumn(getReadOnlyCheckBoxColumn(), new ImageResourceHeader(resources.readOnlyDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.readOnly())), // $NON-NLS-1$
"30px");
imageDiskTable.addColumn(getBootCheckBoxColumn(), new ImageResourceHeader(resources.bootableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.bootableDisk())), // $NON-NLS-1$
"30px");
imageDiskTable.addColumn(new AbstractImageResourceColumn<EntityModel>() {
@Override
public ImageResource getValue(EntityModel object) {
Disk disk = ((DiskModel) object.getEntity()).getDisk();
return disk.isShareable() ? resources.shareableDiskIcon() : null;
}
@Override
public SafeHtml getTooltip(EntityModel object) {
Disk disk = ((DiskModel) object.getEntity()).getDisk();
if (disk.isShareable()) {
return SafeHtmlUtils.fromSafeConstant(constants.shareable());
}
return null;
}
}, new ImageResourceHeader(resources.shareableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.shareable())), // $NON-NLS-1$
"30px");
// $NON-NLS-1$
imageDiskTable.setWidth("100%");
imageDiskTable.setEmptyTableWidget(new NoItemsLabel());
}
use of org.ovirt.engine.ui.common.widget.label.NoItemsLabel 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