use of org.ovirt.engine.ui.common.widget.table.column.GlusterConfigAwareColumn in project ovirt-engine by oVirt.
the class GlusterVolumeGeoReplicationSessionConfigPopupView method initConfigTable.
private void initConfigTable() {
geoReplicationConfigTable = new EntityModelCellTable<>(false, true);
geoReplicationConfigTable.setSelectionModel(new NoSelectionModel());
geoReplicationConfigTable.addColumn(new AbstractEntityModelTextColumn<Pair<Boolean, GlusterGeoRepSessionConfiguration>>() {
@Override
protected String getText(Pair<Boolean, GlusterGeoRepSessionConfiguration> entity) {
return entity.getSecond().getKey();
}
}, constants.optionKeyVolumeParameter(), // $NON-NLS-1$
"150px");
geoReplicationConfigTable.addColumn(new AbstractScrollableTextColumn<EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>>>() {
@Override
public String getValue(EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>> object) {
return object.getEntity().getSecond().getDescription() == null ? constants.notAvailableLabel() : object.getEntity().getSecond().getDescription();
}
}, constants.descriptionVolumeParameter(), // $NON-NLS-1$
"300px");
geoReplicationConfigTable.addColumn(new GlusterConfigAwareColumn(), constants.optionValueVolumeParameter(), // $NON-NLS-1$
"200px");
geoReplicationConfigTable.addColumn(new AbstractCheckboxColumn<EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>>>(true, (index, object, value) -> object.getEntity().setFirst(value)) {
@Override
protected boolean canEdit(EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>> object) {
return true;
}
@Override
public Boolean getValue(EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>> object) {
return object.getEntity().getFirst();
}
}, constants.resetGeoRepSessionConfig());
}
Aggregations