Source:
private VmTreeItem createVmItem(VM vm) { EntityModelCellTable<ListModel> table = new EntityModelCellTable<>(false, vmRowResources, true); AbstractColumn<EntityModel, EntityModel> vmImageWithNameColumn = new AbstractColumn<EntityModel, EntityModel>(createVmImageWithNameCompositeCell()) { @Override public EntityModel getValue(EntityModel object) { return object; } }; AbstractTextColumn<EntityModel> diskSizeColumn = new AbstractTextColumn<EntityModel>() { @Override public String getValue(EntityModel entity) { ArrayList<DiskImage> diskImages = asVm(entity).getDiskList(); return diskImages != null ? diskImages.size() + "" : "0"; } }; AbstractTextColumn<EntityModel> virtualSizeColumn = new AbstractTextColumn<EntityModel>() { @Override public String getValue(EntityModel entity) { return messages.gigabytes(String.valueOf( ((Double) asVm(entity).getDiskSize()).intValue() + constants.gb())); } }; AbstractTextColumn<EntityModel> actualSizeColumn = new AbstractTextColumn<EntityModel>() { @Override public String getValue(EntityModel entity) { return messages.gigabytes(String.valueOf( ((Double) asVm(entity).getActualDiskWithSnapshotsSize()).intValue() + constants.gb())); } }; AbstractTextColumn<EntityModel> snapshotsColumn = new AbstractTextColumn<EntityModel>() { @Override public String getValue(EntityModel entity) { ArrayList<DiskImage> diskImages = asVm(entity).getDiskList(); return diskImages != null ? diskImages.size() > 0 ? diskImages.get(0).getSnapshots().size() + "" : "0" : "0"; } }; table.addColumn(vmImageWithNameColumn, "", "39%"); table.addColumn(diskSizeColumn, "", "10%"); table.addColumn(virtualSizeColumn, "", "10%"); table.addColumn(actualSizeColumn, "", "10%"); table.addColumn(snapshotsColumn, "", "31%"); table.setSelectionModel(vmSelectionModel); EntityModel entityModel = new EntityModel(); entityModel.setEntity(vm); table.setRowData(Arrays.asList(entityModel)); return new VmTreeItem(table, vm); }

Target:
private VmTreeItem createVmItem(VM vm) { EntityModelCellTable<ListModel> table = new EntityModelCellTable<>(false, vmRowResources, true); AbstractColumn<EntityModel, EntityModel> vmImageWithNameColumn = new AbstractColumn<EntityModel, EntityModel>(createVmImageWithNameCompositeCell()) { @Override public EntityModel getValue(EntityModel object) { return object; } }; AbstractTextColumn<EntityModel> diskSizeColumn = new AbstractTextColumn<EntityModel>() { @Override public String getValue(EntityModel entity) { ArrayList<DiskImage> diskImages = asVm(entity).getDiskList(); return diskImages != null ? diskImages.size() + "" : "0"; } }; AbstractTextColumn<EntityModel> virtualSizeColumn = new AbstractTextColumn<EntityModel>() { @Override public String getValue(EntityModel entity) { return messages.gigabytes(String.valueOf( ((Double) asVm(entity).getDiskSize()).intValue())); } }; AbstractTextColumn<EntityModel> actualSizeColumn = new AbstractTextColumn<EntityModel>() { @Override public String getValue(EntityModel entity) { return messages.gigabytes(String.valueOf( ((Double) asVm(entity).getActualDiskWithSnapshotsSize()).intValue())); } }; AbstractTextColumn<EntityModel> snapshotsColumn = new AbstractTextColumn<EntityModel>() { @Override public String getValue(EntityModel entity) { ArrayList<DiskImage> diskImages = asVm(entity).getDiskList(); return diskImages != null ? diskImages.size() > 0 ? diskImages.get(0).getSnapshots().size() + "" : "0" : "0"; } }; table.addColumn(vmImageWithNameColumn, "", "39%"); table.addColumn(diskSizeColumn, "", "10%"); table.addColumn(virtualSizeColumn, "", "10%"); table.addColumn(actualSizeColumn, "", "10%"); table.addColumn(snapshotsColumn, "", "31%"); table.setSelectionModel(vmSelectionModel); EntityModel entityModel = new EntityModel(); entityModel.setEntity(vm); table.setRowData(Arrays.asList(entityModel)); return new VmTreeItem(table, vm); }