use of com.google.gwtexpui.safehtml.client.FindReplace in project gerrit by GerritCodeReview.
the class ConfigInfo method commentlinks.
final List<FindReplace> commentlinks() {
JsArray<CommentLinkInfo> cls = commentlinks0().values();
List<FindReplace> commentLinks = new ArrayList<>(cls.length());
for (int i = 0; i < cls.length(); i++) {
CommentLinkInfo cl = cls.get(i);
if (!cl.enabled()) {
continue;
}
if (cl.link() != null) {
commentLinks.add(new LinkFindReplace(cl.match(), cl.link()));
} else {
try {
FindReplace fr = new RawFindReplace(cl.match(), cl.html());
commentLinks.add(fr);
} catch (RuntimeException e) {
int index = e.getMessage().indexOf("at Object");
new ErrorDialog("Invalid commentlink configuration: " + (index == -1 ? e.getMessage() : e.getMessage().substring(0, index))).center();
}
}
}
return commentLinks;
}
Aggregations