use of edu.stanford.bmir.protege.web.shared.tag.Tag in project webprotege by protegeproject.
the class TagRepository_IT method shouldUpdateTag.
@Test
public void shouldUpdateTag() {
Tag updatedTag = new Tag(tagId, projectId, "An updated label", THE_TAG_DESCRIPTION, COLOR, BG_COLOR);
repository.saveTag(updatedTag);
assertThat(getTagsCollectionSize(), is(1L));
Optional<Tag> foundTag = repository.findTagByTagId(tagId);
assertThat(foundTag, is(Optional.of(updatedTag)));
}
use of edu.stanford.bmir.protege.web.shared.tag.Tag in project webprotege by protegeproject.
the class EntityHierarchyTreeNodeRenderer method getHtmlRendering.
@Override
public String getHtmlRendering(EntityHierarchyNode node) {
StringBuilder sb = new StringBuilder();
sb.append("<div style='display: flex; flex-direction: row; align-items: center;'>");
String iconIri;
DataResource icon = getIcon(node);
sb.append("<img src='").append(icon.getSafeUri().asString()).append("'/>");
if (node.isDeprecated()) {
sb.append("<div style=\"text-decoration: line-through; color: #a0a0a0;\">");
} else {
sb.append("<div>");
}
sb.append(node.getBrowserText());
sb.append("</div>");
if (node.getOpenCommentCount() > 0) {
sb.append("<img style='padding-left: 6px;' src='").append(BUNDLE.svgCommentSmallFilledIcon().getSafeUri().asString()).append("'/>");
sb.append("<div style='padding-left: 4px; padding-bottom: 4px; font-size: smaller;'> (").append(node.getOpenCommentCount()).append(")</div>");
}
node.getWatches().stream().filter(w -> loggedInUserProvider.getCurrentUserId().equals(w.getUserId())).map(Watch::getType).forEach(watchType -> {
sb.append("<img style='padding-left: 4px;' src='");
if (watchType == WatchType.ENTITY) {
sb.append(BUNDLE.svgEyeIcon().getSafeUri().asString());
} else {
sb.append(BUNDLE.svgEyeIconDown().getSafeUri().asString());
}
sb.append("'/>");
});
Collection<Tag> tags = node.getTags();
tags.forEach(tag -> {
sb.append("<div title='").append(tag.getDescription()).append("' class='wp-tag wp-tag--inline-tag' style='color:").append(tag.getColor().getHex()).append("; background-color:").append(tag.getBackgroundColor().getHex()).append(";'>");
sb.append(tag.getLabel());
sb.append("</div>");
});
sb.append("</div>");
return sb.toString();
}
Aggregations