use of com.google.gwt.view.client.NoSelectionModel in project ovirt-engine by oVirt.
the class RegisterEntityInfoPanel method initDisksTable.
protected void initDisksTable() {
disksTable = new EntityModelCellTable<>(false, true);
disksTable.enableColumnResizing();
AbstractTextColumn<Disk> aliasColumn = new AbstractTextColumn<Disk>() {
@Override
public String getValue(Disk object) {
return object.getDiskAlias();
}
};
// $NON-NLS-1$
disksTable.addColumn(aliasColumn, constants.aliasDisk(), "80px");
AbstractDiskSizeColumn<Disk> sizeColumn = new AbstractDiskSizeColumn<Disk>() {
@Override
protected Long getRawValue(Disk object) {
return object.getSize();
}
};
// $NON-NLS-1$
disksTable.addColumn(sizeColumn, constants.provisionedSizeDisk(), "80px");
AbstractDiskSizeColumn<Disk> actualSizeColumn = new AbstractDiskSizeColumn<Disk>() {
@Override
protected Long getRawValue(Disk object) {
return (object.getDiskStorageType() != DiskStorageType.LUN) ? ((DiskImage) object).getActualSizeInBytes() : 0;
}
};
// $NON-NLS-1$
disksTable.addColumn(actualSizeColumn, constants.sizeDisk(), "80px");
AbstractTextColumn<Disk> allocationColumn = new AbstractEnumColumn<Disk, VolumeType>() {
@Override
protected VolumeType getRawValue(Disk object) {
return (object.getDiskStorageType() != DiskStorageType.LUN) ? VolumeType.forValue(((DiskImage) object).getVolumeType().getValue()) : VolumeType.Unassigned;
}
};
// $NON-NLS-1$
disksTable.addColumn(allocationColumn, constants.allocationDisk(), "110px");
AbstractTextColumn<Disk> statusColumn = new AbstractEnumColumn<Disk, ImageStatus>() {
@Override
protected ImageStatus getRawValue(Disk object) {
return (object.getDiskStorageType() != DiskStorageType.LUN) ? ((DiskImage) object).getImageStatus() : ImageStatus.OK;
}
};
// $NON-NLS-1$
disksTable.addColumn(statusColumn, constants.statusDisk(), "65px");
AbstractTextColumn<Disk> diskStorageTypeColumn = new AbstractTextColumn<Disk>() {
@Override
public String getValue(Disk object) {
return object.getDiskStorageType().toString();
}
};
// $NON-NLS-1$
disksTable.addColumn(diskStorageTypeColumn, constants.storageTypeDisk(), "100px");
AbstractTextColumn<Disk> dateCreatedColumn = new AbstractFullDateTimeColumn<Disk>() {
@Override
protected Date getRawValue(Disk object) {
return (object.getDiskStorageType() != DiskStorageType.LUN) ? ((DiskImage) object).getCreationDate() : null;
}
};
// $NON-NLS-1$
disksTable.addColumn(dateCreatedColumn, constants.creationDateDisk(), "100px");
AbstractTextColumn<Disk> descriptionColumn = new AbstractTextColumn<Disk>() {
@Override
public String getValue(Disk object) {
return object.getDiskDescription();
}
};
// $NON-NLS-1$
disksTable.addColumn(descriptionColumn, constants.descriptionDisk(), "100px");
if (registerEntityModel.isQuotaEnabled()) {
// $NON-NLS-1$
disksTable.addColumn(getDiskQuotaColumn(), constants.quotaVm(), "100px");
}
disksTable.setRowData(new ArrayList<EntityModel>());
// $NON-NLS-1$
disksTable.setWidth("100%");
disksTable.setSelectionModel(new NoSelectionModel());
disksTable.setEmptyTableWidget(new NoItemsLabel());
}
use of com.google.gwt.view.client.NoSelectionModel in project ovirt-engine by oVirt.
the class RegisterEntityInfoPanel method initContainersTable.
protected void initContainersTable() {
containersTable = new EntityModelCellTable<>(false, true);
containersTable.addColumn(new AbstractTextColumn<GuestContainer>() {
@Override
public String getValue(GuestContainer row) {
return row.getId().toString();
}
}, constants.idContainer());
containersTable.addColumn(new AbstractTextColumn<GuestContainer>() {
@Override
public String getValue(GuestContainer row) {
// $NON-NLS-1$
return String.join(", ", row.getNames());
}
}, constants.namesContainer());
containersTable.addColumn(new AbstractTextColumn<GuestContainer>() {
@Override
public String getValue(GuestContainer row) {
return row.getImage();
}
}, constants.imageContainer());
containersTable.addColumn(new AbstractTextColumn<GuestContainer>() {
@Override
public String getValue(GuestContainer row) {
return row.getCommand();
}
}, constants.commandContainer());
containersTable.addColumn(new AbstractTextColumn<GuestContainer>() {
@Override
public String getValue(GuestContainer row) {
return row.getStatus();
}
}, constants.statusContainer());
containersTable.setRowData(new ArrayList<EntityModel>());
// $NON-NLS-1$
containersTable.setWidth("100%");
containersTable.setSelectionModel(new NoSelectionModel());
containersTable.setEmptyTableWidget(new NoItemsLabel());
}
Aggregations