use of org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn in project ovirt-engine by oVirt.
the class SubTabVolumeBrickView method initTable.
void initTable() {
getTable().enableColumnResizing();
BrickStatusColumn brickStatusColumn = new BrickStatusColumn();
brickStatusColumn.setContextMenuTitle(constants.statusVolumeBrick());
brickStatusColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(brickStatusColumn, constants.empty(), "30px");
AbstractTextColumn<GlusterBrickEntity> serverColumn = new AbstractTextColumn<GlusterBrickEntity>() {
@Override
public String getValue(GlusterBrickEntity brick) {
return brick.getServerName();
}
};
serverColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(serverColumn, constants.serverVolumeBrick(), "300px");
AbstractTextColumn<GlusterBrickEntity> directoryColumn = new AbstractTextColumn<GlusterBrickEntity>() {
@Override
public String getValue(GlusterBrickEntity brick) {
String qualifiedName = brick.getQualifiedName();
if (brick.getIsArbiter()) {
// $NON-NLS-1$ //$NON-NLS-2$
qualifiedName += " (" + constants.arbiter() + ")";
}
return qualifiedName;
}
};
directoryColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(directoryColumn, constants.brickDirectoryVolumeBrick(), "400px");
getTable().addColumn(new Column<GlusterBrickEntity, BrickProperties>(new BrickCapacityCell()) {
@Override
public BrickProperties getValue(GlusterBrickEntity object) {
return object.getBrickProperties();
}
}, constants.volumeCapacity(), // $NON-NLS-1$
"100px");
BrickHealInfoColumn healInfoColumn = new BrickHealInfoColumn();
// $NON-NLS-1$
getTable().addColumn(healInfoColumn, constants.healInfo(), "110px");
getTable().addColumn(new VolumeActivityColumn<GlusterBrickEntity>(getActivityCell()), constants.activitiesOnVolume(), // $NON-NLS-1$
"100px");
}
use of org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn in project ovirt-engine by oVirt.
the class SubTabHostBrickView method initTable.
void initTable() {
getTable().enableColumnResizing();
BrickStatusColumn brickStatusColumn = new BrickStatusColumn();
brickStatusColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(brickStatusColumn, constants.empty(), "30px");
AbstractTextColumn<GlusterBrickEntity> volNameColumn = new AbstractTextColumn<GlusterBrickEntity>() {
@Override
public String getValue(GlusterBrickEntity object) {
return object.getVolumeName();
}
};
volNameColumn.makeSortable();
getTable().addColumn(volNameColumn, constants.volumeName());
AbstractTextColumn<GlusterBrickEntity> brickDirColumn = new AbstractTextColumn<GlusterBrickEntity>() {
@Override
public String getValue(GlusterBrickEntity object) {
return object.getBrickDirectory();
}
};
brickDirColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(brickDirColumn, constants.brickDirectoryBricks(), "220px");
BrickHealInfoColumn healInfoColumn = new BrickHealInfoColumn();
// $NON-NLS-1$
getTable().addColumn(healInfoColumn, constants.healInfo(), "110px");
}
use of org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn in project ovirt-engine by oVirt.
the class SubTabHostGlusterStorageDevicesView method initTable.
void initTable() {
getTable().enableColumnResizing();
StorageDeviceStatusColumn storageDeviceStatusColumn = new StorageDeviceStatusColumn();
storageDeviceStatusColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(storageDeviceStatusColumn, constants.empty(), "30px");
AbstractTextColumn<StorageDevice> deviceNameColumn = new AbstractTextColumn<StorageDevice>() {
@Override
public String getValue(StorageDevice object) {
return object.getName();
}
};
deviceNameColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(deviceNameColumn, constants.deviceName(), "250px");
AbstractTextColumn<StorageDevice> descriptionColumn = new AbstractTextColumn<StorageDevice>() {
@Override
public String getValue(StorageDevice object) {
return object.getDescription();
}
};
descriptionColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(descriptionColumn, constants.description(), "300px");
AbstractTextColumn<StorageDevice> sizeColumn = new AbstractTextColumn<StorageDevice>() {
@Override
public String getValue(StorageDevice object) {
Pair<SizeUnit, Double> convertedSize = SizeConverter.autoConvert(object.getSize(), SizeUnit.MiB);
// $NON-NLS-1$
return formatSize(convertedSize.getSecond()) + " " + convertedSize.getFirst().toString();
}
};
sizeColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(sizeColumn, constants.size(), "100px");
AbstractTextColumn<StorageDevice> mountPointColumn = new AbstractTextColumn<StorageDevice>() {
@Override
public String getValue(StorageDevice object) {
return object.getMountPoint();
}
};
mountPointColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(mountPointColumn, constants.mountPoint(), "170px");
AbstractTextColumn<StorageDevice> fsTypeColumn = new AbstractTextColumn<StorageDevice>() {
@Override
public String getValue(StorageDevice object) {
return object.getFsType();
}
};
fsTypeColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(fsTypeColumn, constants.fileSystemType(), "170px");
}
use of org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn in project ovirt-engine by oVirt.
the class SubTabDataCenterQuotaView method initTable.
void initTable() {
getTable().enableColumnResizing();
QuotaDcStatusColumn dcStatusColumn = new QuotaDcStatusColumn();
dcStatusColumn.setContextMenuTitle(constants.dcStatusQuota());
// $NON-NLS-1$
getTable().addColumn(dcStatusColumn, constants.empty(), "30px");
AbstractTextColumn<Quota> nameColumn = new AbstractTextColumn<Quota>() {
@Override
public String getValue(Quota object) {
// $NON-NLS-1$
return object.getQuotaName() == null ? "" : object.getQuotaName();
}
};
nameColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(nameColumn, constants.nameQuota(), "400px");
AbstractTextColumn<Quota> descriptionColumn = new AbstractTextColumn<Quota>() {
@Override
public String getValue(Quota object) {
// $NON-NLS-1$
return object.getDescription() == null ? "" : object.getDescription();
}
};
descriptionColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(descriptionColumn, constants.descriptionQuota(), "400px");
}
use of org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn in project ovirt-engine by oVirt.
the class CpuProfilesListModelTable method initTable.
@Override
public void initTable() {
getTable().enableColumnResizing();
AbstractTextColumn<CpuProfile> nameColumn = new AbstractTextColumn<CpuProfile>() {
@Override
public String getValue(CpuProfile object) {
return object.getName();
}
};
// $NON-NLS-1$
getTable().addColumn(nameColumn, constants.profileNameLabel(), "200px");
nameColumn.makeSortable();
AbstractTextColumn<CpuProfile> descriptionColumn = new AbstractTextColumn<CpuProfile>() {
@Override
public String getValue(CpuProfile object) {
return object.getDescription();
}
};
// $NON-NLS-1$
getTable().addColumn(descriptionColumn, constants.profileDescriptionLabel(), "200px");
descriptionColumn.makeSortable();
AbstractTextColumn<CpuProfile> qosColumn = new AbstractTextColumn<CpuProfile>() {
@Override
public String getValue(CpuProfile object) {
String name = constants.unlimitedQos();
if (object.getQosId() != null) {
CpuQos cpuQos = getModel().getQos(object.getQosId());
if (cpuQos != null) {
name = cpuQos.getName();
}
}
return name;
}
};
// $NON-NLS-1$
getTable().addColumn(qosColumn, constants.cpuQosName(), "200px");
qosColumn.makeSortable();
// Add selection listener
getModel().getSelectedItemChangedEvent().addListener((ev, sender, args) -> updatePermissionPanel());
getModel().getItemsChangedEvent().addListener((ev, sender, args) -> updatePermissionPanel());
}
Aggregations