本文整理汇总了Java中com.intellij.xml.util.XmlStringUtil.wrapInHtml方法的典型用法代码示例。如果您正苦于以下问题:Java XmlStringUtil.wrapInHtml方法的具体用法?Java XmlStringUtil.wrapInHtml怎么用?Java XmlStringUtil.wrapInHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.xml.util.XmlStringUtil
的用法示例。
在下文中一共展示了XmlStringUtil.wrapInHtml方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fun
import com.intellij.xml.util.XmlStringUtil; //导入方法依赖的package包/类
@Override
public String fun(PsiElement nameIdentifier) {
PsiModifierListOwner owner = (PsiModifierListOwner)nameIdentifier.getParent();
boolean hasInferred = false;
boolean hasExternal = false;
for (PsiAnnotation annotation : findSignatureNonCodeAnnotations(owner, true)) {
hasExternal |= AnnotationUtil.isExternalAnnotation(annotation);
hasInferred |= AnnotationUtil.isInferredAnnotation(annotation);
}
String header;
if (hasInferred && hasExternal) {
header = "External and <i>inferred</i>";
} else if (hasInferred) {
header = "<i>Inferred</i>";
} else {
header = "External";
}
return XmlStringUtil.wrapInHtml(header + " annotations available. Full signature:<p>\n" + JavaDocInfoGenerator.generateSignature(owner));
}
示例2: generateDoc
import com.intellij.xml.util.XmlStringUtil; //导入方法依赖的package包/类
@Override
public String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
if (!(element instanceof TaskPsiElement)) return null;
final Task task = ((TaskPsiElement)element).getTask();
final StringBuilder builder = new StringBuilder();
builder.append("<b>Summary:</b> ").append(task.getSummary()).append("<br>");
builder.append("<b>Id:</b> ").append(task.getId()).append("<br>");
if (task.getCreated() != null) {
builder.append("<b>Created at:</b> ").append(task.getCreated()).append("<br>");
}
if (task.getUpdated() != null) {
builder.append("<b>Updated at:</b> ").append(task.getUpdated()).append("<br>");
}
final String description = task.getDescription();
if (description != null) {
final MarkdownProcessor processor = new MarkdownProcessor();
builder.append("<b>Description:</b><br>").append(processor.markdown(description));
}
for (Comment comment : task.getComments()) {
comment.appendTo(builder);
}
return XmlStringUtil.wrapInHtml(builder);
}
示例3: update
import com.intellij.xml.util.XmlStringUtil; //导入方法依赖的package包/类
@Override
protected void update(PresentationData presentation) {
final Collection<ArtifactProblemDescription> problems = ((ArtifactEditorImpl)myContext.getThisArtifactEditor()).getValidationManager().getProblems(this);
if (problems == null || problems.isEmpty()) {
super.update(presentation);
return;
}
StringBuilder buffer = StringBuilderSpinAllocator.alloc();
final String tooltip;
boolean isError = false;
try {
for (ArtifactProblemDescription problem : problems) {
isError |= problem.getSeverity() == ProjectStructureProblemType.Severity.ERROR;
buffer.append(problem.getMessage(false)).append("<br>");
}
tooltip = XmlStringUtil.wrapInHtml(buffer);
}
finally {
StringBuilderSpinAllocator.dispose(buffer);
}
getElementPresentation().render(presentation, addErrorHighlighting(isError, SimpleTextAttributes.REGULAR_ATTRIBUTES),
addErrorHighlighting(isError, SimpleTextAttributes.GRAY_ATTRIBUTES));
presentation.setTooltip(tooltip);
}
示例4: getTooltipText
import com.intellij.xml.util.XmlStringUtil; //导入方法依赖的package包/类
@Override
public String getTooltipText() {
if (myEntry == null) return null;
final Library library = myEntry.getLibrary();
if (library == null) return null;
final String name = library.getName();
if (name != null) {
final List<String> invalidUrls = ((LibraryEx)library).getInvalidRootUrls(OrderRootType.CLASSES);
if (!invalidUrls.isEmpty()) {
return ProjectBundle.message("project.roots.tooltip.library.has.broken.paths", name, invalidUrls.size());
}
}
final List<String> descriptions = LibraryPresentationManager.getInstance().getDescriptions(library, myContext);
if (descriptions.isEmpty()) return null;
return XmlStringUtil.wrapInHtml(StringUtil.join(descriptions, "<br>"));
}
示例5: notifyError
import com.intellij.xml.util.XmlStringUtil; //导入方法依赖的package包/类
public void notifyError(@Nullable HgCommandResult result,
@NotNull String failureTitle,
@NotNull String failureDescription,
@Nullable NotificationListener listener) {
List<String> err;
String errorMessage;
if (StringUtil.isEmptyOrSpaces(failureDescription)) {
failureDescription = failureTitle;
}
if (result == null) {
errorMessage = failureDescription;
} else {
err = result.getErrorLines();
if (err.isEmpty()) {
LOG.assertTrue(!StringUtil.isEmptyOrSpaces(failureDescription),
"Failure title, failure description and errors log can not be empty at the same time");
errorMessage = failureDescription;
} else if (failureDescription.isEmpty()) {
errorMessage = XmlStringUtil.wrapInHtml(StringUtil.join(err, "<br>"));
} else {
errorMessage = XmlStringUtil.wrapInHtml(failureDescription + "<br>" + StringUtil.join(err, "<br>"));
}
}
VcsNotifier.getInstance(myProject).notifyError(failureTitle, errorMessage, listener);
}
示例6: createCompositeTooltip
import com.intellij.xml.util.XmlStringUtil; //导入方法依赖的package包/类
@Nullable
private static String createCompositeTooltip(List<HighlightInfo> infos) {
StringBuilder result = new StringBuilder();
for (HighlightInfo info : infos) {
String toolTip = info.getToolTip();
if (toolTip != null) {
if (result.length() != 0) {
result.append(LINE_BREAK);
}
toolTip = XmlStringUtil.stripHtml(toolTip);
result.append(toolTip);
}
}
if (result.length() == 0) {
return null;
}
return XmlStringUtil.wrapInHtml(result);
}
示例7: dressDescription
import com.intellij.xml.util.XmlStringUtil; //导入方法依赖的package包/类
@Override
protected boolean dressDescription(@NotNull final Editor editor) {
final List<String> problems = StringUtil.split(UIUtil.getHtmlBody(new Html(myText).setKeepFont(true)), UIUtil.BORDER_LINE);
String text = "";
for (String problem : problems) {
final String ref = getLinkRef(problem);
if (ref != null) {
String description = TooltipLinkHandlerEP.getDescription(ref, editor);
if (description != null) {
description = DefaultInspectionToolPresentation.stripUIRefsFromInspectionDescription(UIUtil.getHtmlBody(new Html(description).setKeepFont(true)));
text += UIUtil.getHtmlBody(new Html(problem).setKeepFont(true)).replace(DaemonBundle.message("inspection.extended.description"),
DaemonBundle.message("inspection.collapse.description")) +
END_MARKER + "<p>" + description + UIUtil.BORDER_LINE;
}
}
else {
text += UIUtil.getHtmlBody(new Html(problem).setKeepFont(true)) + UIUtil.BORDER_LINE;
}
}
if (!text.isEmpty()) { //otherwise do not change anything
myText = XmlStringUtil.wrapInHtml(StringUtil.trimEnd(text, UIUtil.BORDER_LINE));
return true;
}
return false;
}
示例8: showError
import com.intellij.xml.util.XmlStringUtil; //导入方法依赖的package包/类
public void showError(@NotNull String message, @NotNull List<? extends ConfigurationErrorQuickFix> quickFixes) {
myErrorLabel.setVisible(true);
final String errorText = XmlStringUtil.wrapInHtml(message);
if (myErrorLabel.isShowing()) {
myErrorLabel.setText(errorText);
}
else {
myErrorText = errorText;
}
myMainPanel.setVisible(true);
myCurrentQuickFixes = quickFixes;
myFixButton.setVisible(!quickFixes.isEmpty());
if (!quickFixes.isEmpty()) {
myFixButton.setText(quickFixes.size() == 1 ? ContainerUtil.getFirstItem(quickFixes, null).getActionName() : "Fix...");
}
}
示例9: dressDescription
import com.intellij.xml.util.XmlStringUtil; //导入方法依赖的package包/类
@Override
protected boolean dressDescription(@Nonnull final Editor editor) {
final List<String> problems = StringUtil.split(UIUtil.getHtmlBody(new Html(myText).setKeepFont(true)), UIUtil.BORDER_LINE);
String text = "";
for (String problem : problems) {
final String ref = getLinkRef(problem);
if (ref != null) {
String description = TooltipLinkHandlerEP.getDescription(ref, editor);
if (description != null) {
description = DefaultInspectionToolPresentation.stripUIRefsFromInspectionDescription(UIUtil.getHtmlBody(new Html(description).setKeepFont(true)));
text += UIUtil.getHtmlBody(new Html(problem).setKeepFont(true)).replace(DaemonBundle.message("inspection.extended.description"),
DaemonBundle.message("inspection.collapse.description")) +
END_MARKER + "<p>" + description + UIUtil.BORDER_LINE;
}
}
else {
text += UIUtil.getHtmlBody(new Html(problem).setKeepFont(true)) + UIUtil.BORDER_LINE;
}
}
if (!text.isEmpty()) { //otherwise do not change anything
myText = XmlStringUtil.wrapInHtml(StringUtil.trimEnd(text, UIUtil.BORDER_LINE));
return true;
}
return false;
}
示例10: showError
import com.intellij.xml.util.XmlStringUtil; //导入方法依赖的package包/类
public void showError(@Nonnull String message, @Nonnull List<? extends ConfigurationErrorQuickFix> quickFixes) {
myErrorLabel.setVisible(true);
final String errorText = XmlStringUtil.wrapInHtml(message);
if (myErrorLabel.isShowing()) {
myErrorLabel.setText(errorText);
}
else {
myErrorText = errorText;
}
myMainPanel.setVisible(true);
myCurrentQuickFixes = quickFixes;
myFixButton.setVisible(!quickFixes.isEmpty());
if (!quickFixes.isEmpty()) {
myFixButton.setText(quickFixes.size() == 1 ? ContainerUtil.getFirstItem(quickFixes, null).getActionName() : "Fix...");
}
}
示例11: getTooltipText
import com.intellij.xml.util.XmlStringUtil; //导入方法依赖的package包/类
@Override
public String getTooltipText() {
final Library library = myEntry.getLibrary();
if (library == null) return null;
final String name = library.getName();
if (name != null) {
final List<String> invalidUrls = ((LibraryEx)library).getInvalidRootUrls(BinariesOrderRootType.getInstance());
if (!invalidUrls.isEmpty()) {
return ProjectBundle.message("project.roots.tooltip.library.has.broken.paths", name, invalidUrls.size());
}
}
final List<String> descriptions = LibraryPresentationManager.getInstance().getDescriptions(library, myContext);
if (descriptions.isEmpty()) return null;
return XmlStringUtil.wrapInHtml(StringUtil.join(descriptions, "<br>"));
}
示例12: buildOneLineMismatchDescription
import com.intellij.xml.util.XmlStringUtil; //导入方法依赖的package包/类
private static String buildOneLineMismatchDescription(@NotNull PsiExpressionList list,
@NotNull MethodCandidateInfo candidateInfo,
@NotNull Ref<PsiElement> elementToHighlight) {
final PsiExpression[] expressions = list.getExpressions();
final PsiMethod resolvedMethod = candidateInfo.getElement();
final PsiSubstitutor substitutor = candidateInfo.getSubstitutor();
final PsiParameter[] parameters = resolvedMethod.getParameterList().getParameters();
if (expressions.length == parameters.length && parameters.length > 1) {
int idx = -1;
for (int i = 0; i < expressions.length; i++) {
PsiExpression expression = expressions[i];
if (!TypeConversionUtil.areTypesAssignmentCompatible(substitutor.substitute(parameters[i].getType()), expression)) {
if (idx != -1) {
idx = -1;
break;
}
else {
idx = i;
}
}
}
if (idx > -1) {
final PsiExpression wrongArg = expressions[idx];
final PsiType argType = wrongArg.getType();
if (argType != null) {
elementToHighlight.set(wrongArg);
final String message = JavaErrorMessages
.message("incompatible.call.types", idx + 1, substitutor.substitute(parameters[idx].getType()).getCanonicalText(), argType.getCanonicalText());
return XmlStringUtil.wrapInHtml("<body>" + XmlStringUtil.escapeString(message) +
" <a href=\"#assignment/" + XmlStringUtil.escapeString(createMismatchedArgumentsHtmlTooltip(candidateInfo, list)) + "\"" +
(UIUtil.isUnderDarcula() ? " color=\"7AB4C9\" " : "") +
">" + DaemonBundle.message("inspection.extended.description") + "</a></body>");
}
}
}
return null;
}
示例13: showError
import com.intellij.xml.util.XmlStringUtil; //导入方法依赖的package包/类
public void showError(@NotNull String message, @NotNull List<? extends ConfigurationErrorQuickFix> quickFixes) {
myErrorLabel.setVisible(true);
final String errorText = XmlStringUtil.wrapInHtml(message);
if (myErrorLabel.isShowing()) {
myErrorLabel.setText(errorText);
}
myErrorText = errorText;
myMainPanel.setVisible(true);
myCurrentQuickFixes = quickFixes;
myFixButton.setVisible(!quickFixes.isEmpty());
if (!quickFixes.isEmpty()) {
myFixButton.setText(quickFixes.size() == 1 ? ContainerUtil.getFirstItem(quickFixes, null).getActionName() : IdeBundle.message("button.fix"));
}
}
示例14: suggestSecondInvocation
import com.intellij.xml.util.XmlStringUtil; //导入方法依赖的package包/类
@NotNull
private static String suggestSecondInvocation(@NotNull FindUsagesOptions options, @NotNull FindUsagesHandler handler, @NotNull String text) {
final String title = getSecondInvocationTitle(options, handler);
if (title != null) {
text += "<br><small> " + title + "</small>";
}
return XmlStringUtil.wrapInHtml(text);
}
示例15: ChangesetFormatter
import com.intellij.xml.util.XmlStringUtil; //导入方法依赖的package包/类
private ChangesetFormatter(HgChangesetStatus status, List<HgRevisionNumber> changesets) {
StringBuilder builder = new StringBuilder();
builder.append("<b>").append(status.getStatusName()).append(" changesets</b>:<br>");
for (HgRevisionNumber revisionNumber : changesets) {
builder.append(revisionNumber.asString()).append(" ").append(revisionNumber.getCommitMessage()).append(" (")
.append(revisionNumber.getAuthor()).append(")<br>");
}
string = XmlStringUtil.wrapInHtml(builder);
}