本文整理汇总了Java中com.intellij.openapi.vcs.IssueNavigationConfiguration.LinkMatch方法的典型用法代码示例。如果您正苦于以下问题:Java IssueNavigationConfiguration.LinkMatch方法的具体用法?Java IssueNavigationConfiguration.LinkMatch怎么用?Java IssueNavigationConfiguration.LinkMatch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.vcs.IssueNavigationConfiguration
的用法示例。
在下文中一共展示了IssueNavigationConfiguration.LinkMatch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: formatTextWithLinks
import com.intellij.openapi.vcs.IssueNavigationConfiguration; //导入方法依赖的package包/类
@SuppressWarnings({"HardCodedStringLiteral"})
public static String formatTextWithLinks(final Project project, final String c, final Convertor<String, String> convertor) {
if (c == null) return "";
String comment = XmlTagUtilBase.escapeString(c, false);
StringBuilder commentBuilder = new StringBuilder();
IssueNavigationConfiguration config = IssueNavigationConfiguration.getInstance(project);
final List<IssueNavigationConfiguration.LinkMatch> list = config.findIssueLinks(comment);
int pos = 0;
for(IssueNavigationConfiguration.LinkMatch match: list) {
TextRange range = match.getRange();
commentBuilder.append(convertor.convert(comment.substring(pos, range.getStartOffset()))).append("<a href=\"").append(match.getTargetUrl()).append("\">");
commentBuilder.append(range.substring(comment)).append("</a>");
pos = range.getEndOffset();
}
commentBuilder.append(convertor.convert(comment.substring(pos)));
comment = commentBuilder.toString();
return comment.replace("\n", "<br>");
}
示例2: append
import com.intellij.openapi.vcs.IssueNavigationConfiguration; //导入方法依赖的package包/类
private void append(final String piece, final SimpleTextAttributes baseStyle, final IssueNavigationConfiguration.LinkMatch match) {
myColoredComponent.append(piece, baseStyle, new SimpleColoredComponent.BrowserLauncherTag(match.getTargetUrl()));
}