use of org.ovirt.engine.ui.common.widget.table.column.AbstractBooleanColumn in project ovirt-engine by oVirt.
the class MainDataCenterView method initTable.
void initTable() {
getTable().enableColumnResizing();
DcStatusColumn statusIconColumn = new DcStatusColumn();
statusIconColumn.setContextMenuTitle(constants.statusIconDc());
// $NON-NLS-1$
getTable().addColumn(statusIconColumn, constants.empty(), "30px");
DcAdditionalStatusColumn additionalStatusColumn = new DcAdditionalStatusColumn();
additionalStatusColumn.setContextMenuTitle(constants.additionalStatusDataCenter());
// $NON-NLS-1$
getTable().addColumn(additionalStatusColumn, constants.empty(), "30px");
AbstractTextColumn<StoragePool> nameColumn = new AbstractLinkColumn<StoragePool>(new FieldUpdater<StoragePool, String>() {
@Override
public void update(int index, StoragePool storagePool, String value) {
Map<String, String> parameters = new HashMap<>();
parameters.put(FragmentParams.NAME.getName(), storagePool.getName());
// The link was clicked, now fire an event to switch to details.
getPlaceTransitionHandler().handlePlaceTransition(WebAdminApplicationPlaces.dataCenterStorageSubTabPlace, parameters);
}
}) {
@Override
public String getValue(StoragePool object) {
return object.getName();
}
};
nameColumn.makeSortable(StoragePoolFieldAutoCompleter.NAME);
// $NON-NLS-1$
getTable().addColumn(nameColumn, constants.nameDc(), "150px");
CommentColumn<StoragePool> commentColumn = new CommentColumn<>();
getTable().addColumnWithHtmlHeader(commentColumn, SafeHtmlUtils.fromSafeConstant(constants.commentLabel()), // $NON-NLS-1$
"75px");
AbstractTextColumn<StoragePool> storageTypeColumn = new AbstractBooleanColumn<StoragePool>(constants.storageTypeLocal(), constants.storageTypeShared()) {
@Override
protected Boolean getRawValue(StoragePool object) {
return object.isLocal();
}
};
storageTypeColumn.makeSortable(StoragePoolFieldAutoCompleter.LOCAL);
// $NON-NLS-1$
getTable().addColumn(storageTypeColumn, constants.storgeTypeDc(), "150px");
AbstractTextColumn<StoragePool> statusColumn = new AbstractEnumColumn<StoragePool, StoragePoolStatus>() {
@Override
public StoragePoolStatus getRawValue(StoragePool object) {
return object.getStatus();
}
};
statusColumn.makeSortable(StoragePoolFieldAutoCompleter.STATUS);
// $NON-NLS-1$
getTable().addColumn(statusColumn, constants.statusDc(), "150px");
AbstractTextColumn<StoragePool> versionColumn = new AbstractTextColumn<StoragePool>() {
@Override
public String getValue(StoragePool object) {
return object.getCompatibilityVersion().getValue();
}
};
versionColumn.makeSortable(StoragePoolFieldAutoCompleter.COMPATIBILITY_VERSION);
// $NON-NLS-1$
getTable().addColumn(versionColumn, constants.comptVersDc(), "150px");
AbstractTextColumn<StoragePool> descColumn = new AbstractTextColumn<StoragePool>() {
@Override
public String getValue(StoragePool object) {
return object.getdescription();
}
};
descColumn.makeSortable(StoragePoolFieldAutoCompleter.DESCRIPTION);
// $NON-NLS-1$
getTable().addColumn(descColumn, constants.descriptionDc(), "300px");
}
Aggregations