--- a/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionDoc.java
+++ a/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionDoc.java
@@ -46,6 +46,7 @@
import java.net.URL;
import java.util.concurrent.Callable;
+import java.util.concurrent.Future;
import javax.lang.model.element.Element;
import javax.swing.Action;
import org.netbeans.api.java.source.CompilationController;
@@ -77,6 +78,10 @@
return elementJavadoc.getText();
}
+ public Future "); //NOI18N
if (!useJavadoc) {
@@ -454,14 +504,14 @@
inheritedReturnTags != null && inheritedReturnTags.isEmpty() ||
paramPos != null && !paramPos.isEmpty() ||
throwsTypes != null && !throwsTypes.isEmpty()) {
- String s = inheritedDocFor(mdoc, mdoc.containingClass(), inheritedTags, inheritedReturnTags,
- paramPos, inheritedParamTags, inheritedParamInlineTags,
- throwsTypes, inheritedThrowsTags, inheritedThrowsInlineTags, cancel);
- if (s != null) {
- sb.append(s);
- sb.append("
"); //NOI18N sb.append(getMethodTags(mdoc, returnTags, paramTags, - throwsTags, throwsInlineTags)); + throwsTags, throwsInlineTags, ctx)); sb.append("
"); //NOI18N - return sb; + return new Now(sb.toString()); } } else { if (inlineTags.length > 0 || doc.tags().length > 0) { - sb.append(getDeprecatedTag(doc)); - sb.append(inlineTags(doc, inlineTags)); + sb.append(getDeprecatedTag(doc, ctx)); + sb.append(inlineTags(doc, inlineTags, ctx)); sb.append(""); //NOI18N - sb.append(getTags(doc)); + sb.append(getTags(doc, ctx)); sb.append("
"); //NOI18N - return sb; + return new Now(sb.toString()); } } } - String jdText = page != null ? HTMLJavadocParser.getJavadocText(page, false) : docURL != null ? HTMLJavadocParser.getJavadocText(docURL, false) : null; - if (jdText != null) - sb.append(jdText); - else - sb.append(NbBundle.getMessage(ElementJavadoc.class, "javadoc_content_not_found")); //NOI18N - sb.append(""); //NOI18N - return sb; + + final Callable"); //NOI18N
- sb.append(getAnnotations(mdoc.annotations()));
+ sb.append(getAnnotations(mdoc.annotations(), ctx));
int len = sb.length();
sb.append(Modifier.toString(mdoc.modifierSpecifier() &~ Modifier.NATIVE));
len = sb.length() - len;
@@ -621,7 +684,7 @@
}
sb.append("<"); //NOI18N
for (int i = 0; i < tvars.length; i++) {
- len += appendType(sb, tvars[i], false, true, false);
+ len += appendType(sb, tvars[i], false, true, false, ctx);
if (i < tvars.length - 1) {
sb.append(","); //NOI18N
len++;
@@ -635,7 +698,7 @@
sb.append(' '); //NOI18N
len++;
}
- len += appendType(sb, ((MethodDoc)mdoc).returnType(), false, false, false);
+ len += appendType(sb, ((MethodDoc)mdoc).returnType(), false, false, false, ctx);
}
String name = mdoc.name();
len += name.length();
@@ -645,9 +708,9 @@
len++;
Parameter[] params = mdoc.parameters();
for(int i = 0; i < params.length; i++) {
- sb.append(getAnnotations(params[i].annotations()));
+ sb.append(getAnnotations(params[i].annotations(), ctx));
boolean varArg = i == params.length - 1 && mdoc.isVarArgs();
- appendType(sb, params[i].type(), varArg, false, false);
+ appendType(sb, params[i].type(), varArg, false, false, ctx);
sb.append(' ').append(params[i].name()); //NOI18N
String dim = params[i].type().dimension();
if (dim.length() > 0) {
@@ -665,7 +728,7 @@
if (exs.length > 0) {
sb.append(" throws "); //NOI18N
for (int i = 0; i < exs.length; i++) {
- appendType(sb, exs[i], false, false, false);
+ appendType(sb, exs[i], false, false, false, ctx);
if (i < exs.length - 1)
sb.append(", "); //NOI18N
}
@@ -674,25 +737,25 @@
return sb;
}
- private CharSequence getFieldHeader(FieldDoc fdoc) {
+ private CharSequence getFieldHeader(FieldDoc fdoc, Pair "); //NOI18N
- sb.append(getAnnotations(fdoc.annotations()));
+ sb.append(getAnnotations(fdoc.annotations(), ctx));
int len = sb.length();
sb.append(fdoc.modifiers());
len = sb.length() - len;
if (len > 0)
sb.append(' '); //NOI18N
- appendType(sb, fdoc.type(), false, false, false);
+ appendType(sb, fdoc.type(), false, false, false, ctx);
sb.append(" ").append(fdoc.name()).append(""); //NOI18N
sb.append(" "); //NOI18N
- sb.append(getAnnotations(cdoc.annotations()));
+ sb.append(getAnnotations(cdoc.annotations(), ctx));
int mods = cdoc.modifierSpecifier() & ~Modifier.INTERFACE;
if (cdoc.isEnum())
mods &= ~Modifier.FINAL;
@@ -712,7 +775,7 @@
if (tvars.length > 0) {
sb.append("<"); //NOI18N
for (int i = 0; i < tvars.length; i++) {
- appendType(sb, tvars[i], false, true, false);
+ appendType(sb, tvars[i], false, true, false, ctx);
if (i < tvars.length - 1)
sb.append(","); //NOI18N
}
@@ -724,14 +787,14 @@
Type supercls = cdoc.superclassType();
if (supercls != null) {
sb.append(" extends "); //NOI18N
- appendType(sb, supercls, false, false, false);
+ appendType(sb, supercls, false, false, false, ctx);
}
}
Type[] ifaces = cdoc.interfaceTypes();
if (ifaces.length > 0) {
sb.append(cdoc.isInterface() ? " extends " : " implements "); //NOI18N
for (int i = 0; i < ifaces.length; i++) {
- appendType(sb, ifaces[i], false, false, false);
+ appendType(sb, ifaces[i], false, false, false, ctx);
if (i < ifaces.length - 1)
sb.append(", "); //NOI18N
}
@@ -741,29 +804,29 @@
return sb;
}
- private CharSequence getPackageHeader(PackageDoc pdoc) {
+ private CharSequence getPackageHeader(PackageDoc pdoc, Pair "); //NOI18N
- sb.append(getAnnotations(pdoc.annotations()));
+ sb.append(getAnnotations(pdoc.annotations(), ctx));
sb.append("package ").append(pdoc.name()).append(""); //NOI18N
sb.append(" "); //NOI18N
+ sb.append("").append(NbBundle.getMessage(ElementJavadoc.class, "JCD-deprecated")).append(" ").append(inlineTags(doc, tag.inlineTags(),ctx)).append(" "); //NOI18N
break;
}
}
return sb;
}
- private CharSequence inlineTags(Doc doc, Tag[] tags) {
+ private CharSequence inlineTags(Doc doc, Tag[] tags, Pair
"); //NOI18N
}
StringBuilder par = new StringBuilder();
@@ -818,7 +881,7 @@
List").append(pTag.parameterName()).append("
"); //NOI18N
Tag[] its = pTag.inlineTags();
if (its.length > 0) {
- CharSequence cs = inlineTags(doc, its);
+ CharSequence cs = inlineTags(doc, its, ctx);
if (cs.length() > 0) {
tpar.append(" - "); //NOI18N
tpar.append(cs);
@@ -849,7 +912,7 @@
thr.append(""); //NOI18N
Type exType = throwsTag.exceptionType();
if (exType != null) {
- createLink(thr, eu.elementFor(exType.asClassDoc()), exType.simpleTypeName());
+ createLink(thr, ctx.second.elementFor(exType.asClassDoc()), exType.simpleTypeName());
} else {
thr.append(throwsTag.exceptionName());
}
@@ -857,7 +920,7 @@
List
" + (label != null && label.length() > 0 ? label : (refClass.simpleTypeName() + "." + memberName)) + "
"); //NOI18N
+ createLink(see, ctx.second.elementFor(stag.referencedMember()), "" + (label != null && label.length() > 0 ? label : (refClass.simpleTypeName() + "." + memberName)) + "
"); //NOI18N
} else {
see.append(className);
see.append('.'); //NOI18N
@@ -886,7 +949,7 @@
see.append(", "); //NOI18N
} else if (className != null) {
if (refClass != null) {
- createLink(see, eu.elementFor(refClass), "" + (label != null && label.length() > 0 ? label : refClass.simpleTypeName()) + "
"); //NOI18N
+ createLink(see, ctx.second.elementFor(refClass), "" + (label != null && label.length() > 0 ? label : refClass.simpleTypeName()) + "
"); //NOI18N
} else {
see.append(className);
}
@@ -921,7 +984,7 @@
return sb;
}
- private CharSequence getTags(Doc doc) {
+ private CharSequence getTags(Doc doc, Pair
"); //NOI18N
} else if (THROWS_TAG.equals(tag.kind()) && !doc.isMethod()) {
thr.append(""); //NOI18N
Type exType = ((ThrowsTag)tag).exceptionType();
if (exType != null)
- createLink(thr, eu.elementFor(exType.asClassDoc()), exType.simpleTypeName());
+ createLink(thr, ctx.second.elementFor(exType.asClassDoc()), exType.simpleTypeName());
else
thr.append(((ThrowsTag)tag).exceptionName());
thr.append("
"); //NOI18N
Tag[] its = tag.inlineTags();
if (its.length > 0) {
thr.append(" - "); //NOI18N
- thr.append(inlineTags(doc, its));
+ thr.append(inlineTags(doc, its, ctx));
}
thr.append("
"); //NOI18N
} else if (RETURN_TAG.equals(tag.kind()) && !doc.isMethod()) {
- ret.append(inlineTags(doc, tag.inlineTags()));
+ ret.append(inlineTags(doc, tag.inlineTags(), ctx));
ret.append("
"); //NOI18N
} else if (SEE_TAG.equals(tag.kind())) {
SeeTag stag = (SeeTag)tag;
@@ -961,7 +1024,7 @@
String label = stag.label();
if (memberName != null) {
if (refClass != null) {
- createLink(see, eu.elementFor(stag.referencedMember()), "" + (label != null && label.length() > 0 ? label : (refClass.simpleTypeName() + "." + memberName)) + "
"); //NOI18N
+ createLink(see, ctx.second.elementFor(stag.referencedMember()), "" + (label != null && label.length() > 0 ? label : (refClass.simpleTypeName() + "." + memberName)) + "
"); //NOI18N
} else {
see.append(className);
see.append('.'); //NOI18N
@@ -970,7 +1033,7 @@
see.append(", "); //NOI18N
} else if (className != null) {
if (refClass != null) {
- createLink(see, eu.elementFor(refClass), "" + (label != null && label.length() > 0 ? label : refClass.simpleTypeName()) + "
"); //NOI18N
+ createLink(see, ctx.second.elementFor(refClass), "" + (label != null && label.length() > 0 ? label : refClass.simpleTypeName()) + "
"); //NOI18N
} else {
see.append(className);
}
@@ -1002,18 +1065,18 @@
return sb;
}
- private CharSequence getDeprecatedTag(Doc doc) {
+ private CharSequence getDeprecatedTag(Doc doc, Pair") + (label != null && label.length() > 0 ? label : (refClass.simpleTypeName() + "." + memberName)) + (plain ? "" : "
")); //NOI18N
+ createLink(sb, ctx.second.elementFor(stag.referencedMember()), (plain ? "" : "") + (label != null && label.length() > 0 ? label : (refClass.simpleTypeName() + "." + memberName)) + (plain ? "" : "
")); //NOI18N
} else {
sb.append(stag.referencedClassName());
sb.append('.'); //NOI18N
@@ -1043,7 +1106,7 @@
}
} else {
if (refClass != null) {
- createLink(sb, eu.elementFor(refClass), (plain ? "" : "") + (label != null && label.length() > 0 ? label : refClass.simpleTypeName()) + (plain ? "" : "
")); //NOI18N
+ createLink(sb, ctx.second.elementFor(refClass), (plain ? "" : "") + (label != null && label.length() > 0 ? label : refClass.simpleTypeName()) + (plain ? "" : "
")); //NOI18N
} else {
sb.append(stag.referencedClassName());
}
@@ -1053,7 +1116,7 @@
if (doc.isMethod()) {
MethodDoc mdoc = ((MethodDoc)doc).overriddenMethod();
if (mdoc != null)
- sb.append(inlineTags(mdoc, mdoc.inlineTags()));
+ sb.append(inlineTags(mdoc, mdoc.inlineTags(),ctx));
}
} else if (LITERAL_TAG.equals(tag.kind())) {
try {
@@ -1114,7 +1177,7 @@
sb.append(' '); //NOI18N
}
- private int appendType(StringBuilder sb, Type type, boolean varArg, boolean typeVar, boolean annotation) {
+ private int appendType(StringBuilder sb, Type type, boolean varArg, boolean typeVar, boolean annotation, Pair