use of org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer in project ovirt-engine by oVirt.
the class VolumeGeoRepSessionDetailsPopUpView method intiEditors.
private void intiEditors(final ApplicationConstants constants) {
checkPointStatus = new EntityModelLabelEditor<>(new AbstractRenderer<GlusterGeoRepSessionDetails>() {
@Override
public String render(GlusterGeoRepSessionDetails object) {
String checkPointStatusValue = object.getCheckPointStatus();
return checkPointStatusValue == null || checkPointStatusValue.isEmpty() ? constants.notAvailableLabel() : checkPointStatusValue;
}
});
crawlStatus = new EntityModelLabelEditor<>(new AbstractRenderer<GlusterGeoRepSessionDetails>() {
@Override
public String render(GlusterGeoRepSessionDetails object) {
return object.getCrawlStatus().toString();
}
});
dataOpsPending = new EntityModelLabelEditor<>(new AbstractRenderer<GlusterGeoRepSessionDetails>() {
@Override
public String render(GlusterGeoRepSessionDetails object) {
return object.getDataOpsPending().toString();
}
});
metaOpsPending = new EntityModelLabelEditor<>(new AbstractRenderer<GlusterGeoRepSessionDetails>() {
@Override
public String render(GlusterGeoRepSessionDetails object) {
return object.getMetaOpsPending().toString();
}
});
entryOpsPending = new EntityModelLabelEditor<>(new AbstractRenderer<GlusterGeoRepSessionDetails>() {
@Override
public String render(GlusterGeoRepSessionDetails object) {
return object.getEntryOpsPending().toString();
}
});
failures = new EntityModelLabelEditor<>(new AbstractRenderer<GlusterGeoRepSessionDetails>() {
@Override
public String render(GlusterGeoRepSessionDetails object) {
return object.getFailures().toString();
}
});
checkPointTime = new EntityModelLabelEditor<>(new AbstractRenderer<GlusterGeoRepSessionDetails>() {
@Override
public String render(GlusterGeoRepSessionDetails object) {
return new FullDateTimeRenderer().render(object.getCheckPointTime());
}
});
checkPointCompletedAt = new EntityModelLabelEditor<>(new AbstractRenderer<GlusterGeoRepSessionDetails>() {
@Override
public String render(GlusterGeoRepSessionDetails object) {
return new FullDateTimeRenderer().render(object.getCheckPointCompletedAt());
}
});
geoRepSessionSummaryTable = new EntityModelCellTable<>(false, true);
geoRepSessionSummaryTable.addColumn(new AbstractEntityModelTextColumn<GlusterGeoRepSessionDetails>() {
@Override
public String getText(GlusterGeoRepSessionDetails object) {
return object.getMasterBrickHostName() == null ? constants.notAvailableLabel() : object.getMasterBrickHostName();
}
}, constants.geoRepSessionHostName());
geoRepSessionSummaryTable.addColumn(new AbstractEntityModelTextColumn<GlusterGeoRepSessionDetails>() {
@Override
protected String getText(GlusterGeoRepSessionDetails entity) {
return (entity == null || entity.getStatus() == null) ? constants.notAvailableLabel() : entity.getStatus().toString();
}
}, constants.geoRepSessionStatus());
geoRepSessionSummaryTable.addColumn(new AbstractFullDateTimeColumn<EntityModel<GlusterGeoRepSessionDetails>>() {
@Override
protected Date getRawValue(EntityModel<GlusterGeoRepSessionDetails> object) {
GlusterGeoRepSessionDetails sessionDetail = object.getEntity();
return (sessionDetail == null || sessionDetail.getLastSyncedAt() == null) ? new Date() : sessionDetail.getLastSyncedAt();
}
}, constants.geoRepLastSyncedAt());
}
use of org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer in project ovirt-engine by oVirt.
the class EventPopupView method edit.
@Override
public void edit(final EventModel eventModel) {
driver.edit(eventModel);
AuditLog event = eventModel.getEvent();
eventIdLabel.asValueBox().setValue(String.valueOf(event.getLogTypeValue()));
eventTimeLabel.asValueBox().setValue(new FullDateTimeRenderer().render(event.getLogTime()));
eventMessageTextArea.asValueBox().setValue(event.getMessage());
}
use of org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer in project ovirt-engine by oVirt.
the class PermissionListModelTable method addCreationDateColum.
private void addCreationDateColum() {
AbstractTextColumn<Permission> creationDateColumn = new AbstractRenderedTextColumn<Permission, Date>(new FullDateTimeRenderer()) {
@Override
public Date getRawValue(Permission object) {
// GWT doesn't have TimeUnit.java
return new Date(object.getCreationDate() * 1000);
}
};
// $NON-NLS-1$
getTable().addColumn(creationDateColumn, constants.permissionsCreationDate(), "300px");
creationDateColumn.makeSortable();
}
Aggregations