当前位置: 首页>>代码示例>>Java>>正文


Java IssueLinkHtmlRenderer类代码示例

本文整理汇总了Java中com.intellij.openapi.vcs.changes.issueLinks.IssueLinkHtmlRenderer的典型用法代码示例。如果您正苦于以下问题:Java IssueLinkHtmlRenderer类的具体用法?Java IssueLinkHtmlRenderer怎么用?Java IssueLinkHtmlRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IssueLinkHtmlRenderer类属于com.intellij.openapi.vcs.changes.issueLinks包,在下文中一共展示了IssueLinkHtmlRenderer类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateMessage

import com.intellij.openapi.vcs.changes.issueLinks.IssueLinkHtmlRenderer; //导入依赖的package包/类
private void updateMessage() {
  List selection = getSelection();
  final VcsFileRevision revision;
  if (selection.size() != 1) {
    revision = null;
    myComments.setText("");
    myOriginalComment = "";
  }
  else {
    revision = getFirstSelectedRevision();
    if (revision != null) {
      final String message = revision.getCommitMessage();
      myOriginalComment = message;
      @NonNls final String text = IssueLinkHtmlRenderer.formatTextIntoHtml(myVcs.getProject(), message);
      myComments.setText(text);
      myComments.setCaretPosition(0);
    }
  }
  if (myListener != null) {
    myListener.consume(revision);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:FileHistoryPanelImpl.java

示例2: getMessageText

import com.intellij.openapi.vcs.changes.issueLinks.IssueLinkHtmlRenderer; //导入依赖的package包/类
private String getMessageText(VcsFullCommitDetails commit) {
  String fullMessage = commit.getFullMessage();
  int separator = fullMessage.indexOf("\n\n");
  String subject = separator > 0 ? fullMessage.substring(0, separator) : fullMessage;
  String description = fullMessage.substring(subject.length());
  return "<b>" + escapeMultipleSpaces(IssueLinkHtmlRenderer.formatTextWithLinks(myProject, subject)) + "</b>" +
         escapeMultipleSpaces(IssueLinkHtmlRenderer.formatTextWithLinks(myProject, description));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:DetailsPanel.java

示例3: getTooltip

import com.intellij.openapi.vcs.changes.issueLinks.IssueLinkHtmlRenderer; //导入依赖的package包/类
public String getTooltip() {
  String hash = DvcsUtil.getShortHash(getUserObject().getId().toString());
  String date = DvcsUtil.getDateString(getUserObject());
  String author = getUserObject().getAuthor().getName();
  String message = IssueLinkHtmlRenderer.formatTextWithLinks(myProject, getUserObject().getFullMessage());
  return String.format("%s  %s  by %s\n\n%s", hash, date, author, message);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:CommitNode.java

示例4: initCommitMessageArea

import com.intellij.openapi.vcs.changes.issueLinks.IssueLinkHtmlRenderer; //导入依赖的package包/类
private void initCommitMessageArea(final Project project, final CommittedChangeList changeList) {
  myCommitMessageArea = new JEditorPane(UIUtil.HTML_MIME, "");
  myCommitMessageArea.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
  myCommitMessageArea.setEditable(false);
  @NonNls final String text = IssueLinkHtmlRenderer.formatTextIntoHtml(project, changeList.getComment().trim());
  myCommitMessageArea.setBackground(UIUtil.getComboBoxDisabledBackground());
  myCommitMessageArea.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE);
  commitMessageScroll = ScrollPaneFactory.createScrollPane(myCommitMessageArea);
  myCommitMessageArea.setText(text);
  myCommitMessageArea.setCaretPosition(0);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ChangeListViewerDialog.java

示例5: initCommitMessageArea

import com.intellij.openapi.vcs.changes.issueLinks.IssueLinkHtmlRenderer; //导入依赖的package包/类
private void initCommitMessageArea(final Project project, final CommittedChangeList changeList) {
  myCommitMessageArea = new JEditorPane(UIUtil.HTML_MIME, "");
  myCommitMessageArea.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
  myCommitMessageArea.setEditable(false);
  @NonNls final String text = IssueLinkHtmlRenderer.formatTextIntoHtml(project, changeList.getComment().trim());
  myCommitMessageArea.setBackground(UIUtil.getComboBoxDisabledBackground());
  myCommitMessageArea.addHyperlinkListener(new BrowserHyperlinkListener());
  commitMessageScroll = ScrollPaneFactory.createScrollPane(myCommitMessageArea);
  myCommitMessageArea.setText(text);
  myCommitMessageArea.setCaretPosition(0);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:ChangeListViewerDialog.java

示例6: setCommit

import com.intellij.openapi.vcs.changes.issueLinks.IssueLinkHtmlRenderer; //导入依赖的package包/类
public void setCommit(final VirtualFile root, final GitHeavyCommit c) {
  final String hash = myHighlighter.getResult(c.getHash().getValue());
  final String author = myHighlighter.getResult(c.getAuthor());
  final String committer = myHighlighter.getResult(c.getCommitter());
  final String comment = IssueLinkHtmlRenderer.formatTextWithLinks(myProject, c.getDescription(),
                                                                   new Convertor<String, String>() {
                                                                     @Override
                                                                     public String convert(String o) {
                                                                       return myHighlighter.getResult(o);
                                                                     }
                                                                   });

  final StringBuilder sb = new StringBuilder().append("<html><head>").append(UIUtil.getCssFontDeclaration(UIUtil.getLabelFont()))
    .append("</head><body><table>");
  final String stashName = myDetailsCache.getStashName(root, c.getShortHash());
  if (! StringUtil.isEmptyOrSpaces(stashName)) {
    sb.append("<tr valign=\"top\"><td><b>").append(stashName).append("</b></td><td></td></tr>");
  }
  sb.append("<tr valign=\"top\"><td><i>Hash:</i></td><td>").append(
    hash).append("</td></tr>" + "<tr valign=\"top\"><td><i>Author:</i></td><td>")
    .append(author).append(" (").append(c.getAuthorEmail()).append(") <i>at</i> ")
    .append(DateFormatUtil.formatPrettyDateTime(c.getAuthorTime()))
    .append("</td></tr>" + "<tr valign=\"top\"><td><i>Committer:</i></td><td>")
    .append(committer).append(" (").append(c.getComitterEmail()).append(") <i>at</i> ")
    .append(DateFormatUtil.formatPrettyDateTime(c.getDate())).append(
    "</td></tr>" + "<tr valign=\"top\"><td><i>Description:</i></td><td><b>")
    .append(comment).append("</b></td></tr>");
  sb.append("<tr valign=\"top\"><td><i>Contained in branches:</i><br/><a href=\"" + CONFIGURE_BRANCHES + "\">Configure</a></td><td>");
  myStartPattern = sb.toString();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:GitLogDetailsPanel.java

示例7: getMessageText

import com.intellij.openapi.vcs.changes.issueLinks.IssueLinkHtmlRenderer; //导入依赖的package包/类
@Nonnull
private String getMessageText(@Nonnull VcsFullCommitDetails commit) {
  String fullMessage = commit.getFullMessage();
  int separator = fullMessage.indexOf("\n\n");
  String subject = separator > 0 ? fullMessage.substring(0, separator) : fullMessage;
  String description = fullMessage.substring(subject.length());
  return "<b>" +
         getHtmlWithFonts(escapeMultipleSpaces(IssueLinkHtmlRenderer.formatTextWithLinks(myProject, subject)), Font.BOLD) +
         "</b>" +
         getHtmlWithFonts(escapeMultipleSpaces(IssueLinkHtmlRenderer.formatTextWithLinks(myProject, description)));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:CommitPanel.java

示例8: showDetailsPopup

import com.intellij.openapi.vcs.changes.issueLinks.IssueLinkHtmlRenderer; //导入依赖的package包/类
public static void showDetailsPopup(final Project project, final CommittedChangeList changeList) {
  StringBuilder detailsBuilder = new StringBuilder("<html><head>");
  detailsBuilder.append(UIUtil.getCssFontDeclaration(UIUtil.getLabelFont())).append("</head><body>");
  final AbstractVcs vcs = changeList.getVcs();
  CachingCommittedChangesProvider provider = null;
  if (vcs != null) {
    provider = vcs.getCachingCommittedChangesProvider();
    if (provider != null && provider.getChangelistTitle() != null) {
      detailsBuilder.append(provider.getChangelistTitle()).append(" #").append(changeList.getNumber()).append("<br>");
    }
  }
  @NonNls String committer = "<b>" + changeList.getCommitterName() + "</b>";
  detailsBuilder.append(VcsBundle.message("changelist.details.committed.format", committer,
                                          DateFormatUtil.formatPrettyDateTime(changeList.getCommitDate())));
  detailsBuilder.append("<br>");

  if (provider != null) {
    final CommittedChangeList originalChangeList = ReceivedChangeList.unwrap(changeList);
    for(ChangeListColumn column: provider.getColumns()) {
      if (ChangeListColumn.isCustom(column)) {
        String value = column.getValue(originalChangeList).toString();
        if (value.length() == 0) {
          value = "<none>";
        }
        detailsBuilder.append(column.getTitle()).append(": ").append(XmlStringUtil.escapeString(value)).append("<br>");
      }
    }
  }

  detailsBuilder.append(IssueLinkHtmlRenderer.formatTextWithLinks(project, changeList.getComment()));
  detailsBuilder.append("</body></html>");

  JEditorPane editorPane = new JEditorPane(UIUtil.HTML_MIME, detailsBuilder.toString());
  editorPane.setEditable(false);
  editorPane.setBackground(HintUtil.INFORMATION_COLOR);
  editorPane.select(0, 0);
  editorPane.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE);
  JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(editorPane);
  final JBPopup hint =
    JBPopupFactory.getInstance().createComponentPopupBuilder(scrollPane, editorPane)
      .setDimensionServiceKey(project, "changelist.details.popup", false)
      .setResizable(true)
      .setMovable(true)
      .setRequestFocus(true)
      .setTitle(VcsBundle.message("changelist.details.title"))
      .createPopup();
  hint.showInBestPositionFor(DataManager.getInstance().getDataContext());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:49,代码来源:ChangeListDetailsAction.java

示例9: formatText

import com.intellij.openapi.vcs.changes.issueLinks.IssueLinkHtmlRenderer; //导入依赖的package包/类
private String formatText(final CommittedChangeList list) {
  return IssueLinkHtmlRenderer.formatTextIntoHtml(myProject, list.getComment());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:CommittedChangesBrowser.java

示例10: showDetailsPopup

import com.intellij.openapi.vcs.changes.issueLinks.IssueLinkHtmlRenderer; //导入依赖的package包/类
public static void showDetailsPopup(final Project project, final CommittedChangeList changeList) {
  StringBuilder detailsBuilder = new StringBuilder("<html><head>");
  detailsBuilder.append(UIUtil.getCssFontDeclaration(UIUtil.getLabelFont())).append("</head><body>");
  final AbstractVcs vcs = changeList.getVcs();
  CachingCommittedChangesProvider provider = null;
  if (vcs != null) {
    provider = vcs.getCachingCommittedChangesProvider();
    if (provider != null && provider.getChangelistTitle() != null) {
      detailsBuilder.append(provider.getChangelistTitle()).append(" #").append(changeList.getNumber()).append("<br>");
    }
  }
  @NonNls String committer = "<b>" + changeList.getCommitterName() + "</b>";
  detailsBuilder.append(VcsBundle.message("changelist.details.committed.format", committer,
                                          DateFormatUtil.formatPrettyDateTime(changeList.getCommitDate())));
  detailsBuilder.append("<br>");

  if (provider != null) {
    final CommittedChangeList originalChangeList;
    if (changeList instanceof ReceivedChangeList) {
      originalChangeList = ((ReceivedChangeList) changeList).getBaseList();
    }
    else {
      originalChangeList = changeList;
    }
    for(ChangeListColumn column: provider.getColumns()) {
      if (ChangeListColumn.isCustom(column)) {
        String value = column.getValue(originalChangeList).toString();
        if (value.length() == 0) {
          value = "<none>";
        }
        detailsBuilder.append(column.getTitle()).append(": ").append(XmlStringUtil.escapeString(value)).append("<br>");
      }
    }
  }

  detailsBuilder.append(IssueLinkHtmlRenderer.formatTextWithLinks(project, changeList.getComment()));
  detailsBuilder.append("</body></html>");

  JEditorPane editorPane = new JEditorPane(UIUtil.HTML_MIME, detailsBuilder.toString());
  editorPane.setEditable(false);
  editorPane.setBackground(HintUtil.INFORMATION_COLOR);
  editorPane.select(0, 0);
  editorPane.addHyperlinkListener(new BrowserHyperlinkListener());
  JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(editorPane);
  final JBPopup hint =
    JBPopupFactory.getInstance().createComponentPopupBuilder(scrollPane, editorPane)
      .setDimensionServiceKey(project, "changelist.details.popup", false)
      .setResizable(true)
      .setMovable(true)
      .setRequestFocus(true)
      .setTitle(VcsBundle.message("changelist.details.title"))
      .createPopup();
  hint.showInBestPositionFor(DataManager.getInstance().getDataContext());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:55,代码来源:ChangeListDetailsAction.java

示例11: showDetailsPopup

import com.intellij.openapi.vcs.changes.issueLinks.IssueLinkHtmlRenderer; //导入依赖的package包/类
public static void showDetailsPopup(final Project project, final CommittedChangeList changeList) {
  StringBuilder detailsBuilder = new StringBuilder("<html><head>");
  detailsBuilder.append(UIUtil.getCssFontDeclaration(UIUtil.getLabelFont())).append("</head><body>");
  final AbstractVcs vcs = changeList.getVcs();
  CachingCommittedChangesProvider provider = null;
  if (vcs != null) {
    provider = vcs.getCachingCommittedChangesProvider();
    if (provider != null && provider.getChangelistTitle() != null) {
      detailsBuilder.append(provider.getChangelistTitle()).append(" #").append(changeList.getNumber()).append("<br>");
    }
  }
  @NonNls String committer = "<b>" + changeList.getCommitterName() + "</b>";
  detailsBuilder.append(VcsBundle.message("changelist.details.committed.format", committer,
                                          DateFormatUtil.formatPrettyDateTime(changeList.getCommitDate())));
  detailsBuilder.append("<br>");

  if (provider != null) {
    final CommittedChangeList originalChangeList;
    if (changeList instanceof ReceivedChangeList) {
      originalChangeList = ((ReceivedChangeList) changeList).getBaseList();
    }
    else {
      originalChangeList = changeList;
    }
    for(ChangeListColumn column: provider.getColumns()) {
      if (ChangeListColumn.isCustom(column)) {
        String value = column.getValue(originalChangeList).toString();
        if (value.length() == 0) {
          value = "<none>";
        }
        detailsBuilder.append(column.getTitle()).append(": ").append(XmlStringUtil.escapeString(value)).append("<br>");
      }
    }
  }

  detailsBuilder.append(IssueLinkHtmlRenderer.formatTextWithLinks(project, changeList.getComment()));
  detailsBuilder.append("</body></html>");

  JEditorPane editorPane = new JEditorPane(UIUtil.HTML_MIME, detailsBuilder.toString());
  editorPane.setEditable(false);
  editorPane.setBackground(HintUtil.INFORMATION_COLOR);
  editorPane.select(0, 0);
  editorPane.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE);
  JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(editorPane);
  final JBPopup hint =
    JBPopupFactory.getInstance().createComponentPopupBuilder(scrollPane, editorPane)
      .setDimensionServiceKey(project, "changelist.details.popup", false)
      .setResizable(true)
      .setMovable(true)
      .setRequestFocus(true)
      .setTitle(VcsBundle.message("changelist.details.title"))
      .createPopup();
  hint.showInBestPositionFor(DataManager.getInstance().getDataContext());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:55,代码来源:ChangeListDetailsAction.java


注:本文中的com.intellij.openapi.vcs.changes.issueLinks.IssueLinkHtmlRenderer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。