use of edu.stanford.bmir.protege.web.shared.issues.Comment in project webprotege by protegeproject.
the class CommentPostedEventView method setValue.
public void setValue(CommentPostedEvent event) {
Comment comment = event.getComment();
UserId createdBy = comment.getCreatedBy();
userNameLabel.setText(createdBy.getUserName());
userIconHolder.setWidget(UserIcon.get(createdBy));
final java.util.Optional<OWLEntityData> targetAsEntityData = event.getEntity();
if (targetAsEntityData.isPresent()) {
entityLabel.setEntity(targetAsEntityData.get());
entityLabel.setVisible(true);
} else {
entityLabel.setVisible(false);
}
timeLabel.setBaseTime(comment.getCreatedAt());
final SafeHtmlBuilder builder = new SafeHtmlBuilder();
bodyLabel.setHTML(builder.appendHtmlConstant(comment.getRenderedBody()).toSafeHtml());
}
use of edu.stanford.bmir.protege.web.shared.issues.Comment in project webprotege by protegeproject.
the class CommentConverter method fromDocument.
@Override
public Comment fromDocument(@Nonnull Document document) {
UserId createdBy = UserId.getUserId(document.getString(CREATED_BY));
long createdAt = document.getLong(CREATED_AT);
Optional<Long> updatedAt = Optional.ofNullable(document.getLong(UPDATED_AT));
String body = document.getString(BODY);
return new Comment(CommentId.create(), createdBy, createdAt, updatedAt, body, body);
}
Aggregations