Apply find/replace functionallity on comments and messages

Putting a CommentLink section in the gerrit.config file will run a custom
find/replace on comments and messages in Gerrit.  This is useful for turning
specific strings into links to a bug tracking system.

Bug: issue 19
Signed-off-by: Brad Larson <bklarson@gmail.com>
This commit is contained in:
Brad Larson
2009-11-03 14:30:26 -06:00
parent a64286d39d
commit 991a31bac3
6 changed files with 72 additions and 2 deletions

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.client.changes;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.reviewdb.ChangeMessage;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
@@ -25,7 +26,7 @@ public class MessagePanel extends Composite {
public MessagePanel(final ChangeMessage msg) {
final Widget l =
new SafeHtmlBuilder().append(msg.getMessage().trim()).wikify()
.toBlockWidget();
.replaceAll(Gerrit.getConfig().getCommentLinks()).toBlockWidget();
l.setStyleName("gerrit-ChangeMessage-Message");
initWidget(l);
}