diff --git a/git/src/org/netbeans/modules/git/ui/blame/TooltipWindow.java b/git/src/org/netbeans/modules/git/ui/blame/TooltipWindow.java --- a/git/src/org/netbeans/modules/git/ui/blame/TooltipWindow.java +++ b/git/src/org/netbeans/modules/git/ui/blame/TooltipWindow.java @@ -280,49 +280,52 @@ normalStyle); // author - String author = annotateLine.getAuthor().toString(); - StyledDocumentHyperlink l = linkerSupport.getLinker(AuthorLinker.class, 0); - if(master.isKenai()) { - KenaiUser kenaiUser = master.getKenaiUser(author); - if(kenaiUser != null) { - l = new AuthorLinker( - kenaiUser, - authorStyle, - doc, - author, - KenaiUser.getChatLink( + { + String author = annotateLine.getAuthor().toString(); + StyledDocumentHyperlink l = linkerSupport.getLinker(AuthorLinker.class, 0); + if (master.isKenai()) { + KenaiUser kenaiUser = master.getKenaiUser(author); + if (kenaiUser != null) { + l = new AuthorLinker( + kenaiUser, + authorStyle, + doc, + author, + KenaiUser.getChatLink( master.getCurrentFileObject(), annotateLine.getLineNum())); - linkerSupport.add(l, 0); + linkerSupport.add(l, 0); + } + } + if (l != null) { + l.insertString(doc, authorStyle); + } else { + doc.insertString(doc.getLength(), author, normalStyle); } } - if(l != null) { - l.insertString(doc, authorStyle); - } else { - doc.insertString(doc.getLength(), author, normalStyle); - } - // date doc.insertString(doc.getLength(), " ", normalStyle); doc.insertString(doc.getLength(), DateFormat.getDateInstance().format(new Date(annotateLine.getRevisionInfo().getCommitTime())), normalStyle); doc.insertString(doc.getLength(), "\n", normalStyle); // commit msg - String commitMessage = annotateLine.getRevisionInfo().getFullMessage(); - List providers = Git.getInstance().getHyperlinkProviders(); - for (VCSHyperlinkProvider hp : providers) { - l = IssueLinker.create(hp, hyperlinkStyle, master.getRepositoryRoot(), doc, commitMessage); + { + StyledDocumentHyperlink l = null; + String commitMessage = annotateLine.getRevisionInfo().getFullMessage(); + List providers = Git.getInstance().getHyperlinkProviders(); + for (VCSHyperlinkProvider hp : providers) { + l = IssueLinker.create(hp, hyperlinkStyle, master.getRepositoryRoot(), doc, commitMessage); + if (l != null) { + linkerSupport.add(l, 0); + break; + } + } if (l != null) { - linkerSupport.add(l, 0); - break; + l.insertString(doc, normalStyle); + } else { + doc.insertString(doc.getLength(), commitMessage, normalStyle); } } - if(l != null) { - l.insertString(doc, normalStyle); - } else { - doc.insertString(doc.getLength(), commitMessage, normalStyle); - } - textPane.setDocument(doc); textPane.setEditable(false); Color color = new Color(233, 241, 255); diff --git a/mercurial/src/org/netbeans/modules/mercurial/ui/annotate/TooltipWindow.java b/mercurial/src/org/netbeans/modules/mercurial/ui/annotate/TooltipWindow.java --- a/mercurial/src/org/netbeans/modules/mercurial/ui/annotate/TooltipWindow.java +++ b/mercurial/src/org/netbeans/modules/mercurial/ui/annotate/TooltipWindow.java @@ -270,26 +270,28 @@ normalStyle); // author - String author = annotateLine.getAuthor(); - StyledDocumentHyperlink l = linkerSupport.getLinker(AuthorLinker.class, 0); - if(master.isKenai()) { - KenaiUser kenaiUser = master.getKenaiUser(author); - if(kenaiUser != null) { - l = new AuthorLinker( - kenaiUser, - authorStyle, - doc, - author, - KenaiUser.getChatLink( + { + String author = annotateLine.getAuthor(); + StyledDocumentHyperlink l = linkerSupport.getLinker(AuthorLinker.class, 0); + if (master.isKenai()) { + KenaiUser kenaiUser = master.getKenaiUser(author); + if (kenaiUser != null) { + l = new AuthorLinker( + kenaiUser, + authorStyle, + doc, + author, + KenaiUser.getChatLink( master.getCurrentFileObject(), annotateLine.getLineNum())); - linkerSupport.add(l, 0); + linkerSupport.add(l, 0); + } } - } - if(l != null) { - l.insertString(doc, authorStyle); - } else { - doc.insertString(doc.getLength(), author, normalStyle); + if (l != null) { + l.insertString(doc, authorStyle); + } else { + doc.insertString(doc.getLength(), author, normalStyle); + } } // date @@ -298,20 +300,23 @@ doc.insertString(doc.getLength(), "\n", normalStyle); // commit msg - String commitMessage = annotateLine.getCommitMessage(); - List providers = Mercurial.getInstance().getHyperlinkProviders(); - for (VCSHyperlinkProvider hp : providers) { - l = IssueLinker.create(hp, hyperlinkStyle, master.getRepositoryRoot(), doc, commitMessage); + { + StyledDocumentHyperlink l = null; + String commitMessage = annotateLine.getCommitMessage(); + List providers = Mercurial.getInstance().getHyperlinkProviders(); + for (VCSHyperlinkProvider hp : providers) { + l = IssueLinker.create(hp, hyperlinkStyle, master.getRepositoryRoot(), doc, commitMessage); + if (l != null) { + linkerSupport.add(l, 0); + break; + } + } if (l != null) { - linkerSupport.add(l, 0); - break; + l.insertString(doc, normalStyle); + } else { + doc.insertString(doc.getLength(), commitMessage, normalStyle); } } - if(l != null) { - l.insertString(doc, normalStyle); - } else { - doc.insertString(doc.getLength(), commitMessage, normalStyle); - } textPane.setDocument(doc); textPane.setEditable(false); diff --git a/subversion/src/org/netbeans/modules/subversion/ui/blame/TooltipWindow.java b/subversion/src/org/netbeans/modules/subversion/ui/blame/TooltipWindow.java --- a/subversion/src/org/netbeans/modules/subversion/ui/blame/TooltipWindow.java +++ b/subversion/src/org/netbeans/modules/subversion/ui/blame/TooltipWindow.java @@ -264,26 +264,28 @@ doc.insertString(doc.getLength(), annotateLine.getRevision() + " - ", normalStyle); // author - String author = annotateLine.getAuthor(); - StyledDocumentHyperlink l = linkerSupport.getLinker(AuthorLinker.class, 0); - if(master.isKenai()) { - KenaiUser kenaiUser = master.getKenaiUser(author); - if(kenaiUser != null) { - l = new AuthorLinker( - kenaiUser, - authorStyle, - doc, - author, - KenaiUser.getChatLink( + { + String author = annotateLine.getAuthor(); + StyledDocumentHyperlink l = linkerSupport.getLinker(AuthorLinker.class, 0); + if (master.isKenai()) { + KenaiUser kenaiUser = master.getKenaiUser(author); + if (kenaiUser != null) { + l = new AuthorLinker( + kenaiUser, + authorStyle, + doc, + author, + KenaiUser.getChatLink( master.getCurrentFileObject(), annotateLine.getLineNum())); - linkerSupport.add(l, 0); - } - } - if(l != null) { - l.insertString(doc, authorStyle); - } else { - doc.insertString(doc.getLength(), author, normalStyle); + linkerSupport.add(l, 0); + } + } + if (l != null) { + l.insertString(doc, authorStyle); + } else { + doc.insertString(doc.getLength(), author, normalStyle); + } } // date @@ -292,20 +294,23 @@ doc.insertString(doc.getLength(), "\n", normalStyle); // commit msg - String commitMessage = annotateLine.getCommitMessage(); - List providers = Subversion.getInstance().getHyperlinkProviders(); - for (VCSHyperlinkProvider hp : providers) { - l = IssueLinker.create(hp, hyperlinkStyle, master.getFile(), doc, commitMessage); + { + StyledDocumentHyperlink l = null; + String commitMessage = annotateLine.getCommitMessage(); + List providers = Subversion.getInstance().getHyperlinkProviders(); + for (VCSHyperlinkProvider hp : providers) { + l = IssueLinker.create(hp, hyperlinkStyle, master.getFile(), doc, commitMessage); + if (l != null) { + linkerSupport.add(l, 0); + break; + } + } if (l != null) { - linkerSupport.add(l, 0); - break; + l.insertString(doc, normalStyle); + } else { + doc.insertString(doc.getLength(), commitMessage, normalStyle); } } - if(l != null) { - l.insertString(doc, normalStyle); - } else { - doc.insertString(doc.getLength(), commitMessage, normalStyle); - } textPane.setDocument(doc); textPane.setEditable(false);