本文整理匯總了Java中com.intellij.codeInspection.util.RefFilter類的典型用法代碼示例。如果您正苦於以下問題:Java RefFilter類的具體用法?Java RefFilter怎麽用?Java RefFilter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RefFilter類屬於com.intellij.codeInspection.util包,在下文中一共展示了RefFilter類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: exportResults
import com.intellij.codeInspection.util.RefFilter; //導入依賴的package包/類
@Override
public void exportResults(@NotNull final Element parentNode, @NotNull RefEntity refEntity) {
if (!(refEntity instanceof RefJavaElement)) return;
final RefFilter filter = getFilter();
if (!getIgnoredRefElements().contains(refEntity) && filter.accepts((RefJavaElement)refEntity)) {
refEntity = getRefManager().getRefinedElement(refEntity);
Element element = refEntity.getRefManager().export(refEntity, parentNode, -1);
if (element == null) return;
@NonNls Element problemClassElement = new Element(InspectionsBundle.message("inspection.export.results.problem.element.tag"));
final RefElement refElement = (RefElement)refEntity;
final HighlightSeverity severity = getSeverity(refElement);
final String attributeKey =
getTextAttributeKey(refElement.getRefManager().getProject(), severity, ProblemHighlightType.LIKE_UNUSED_SYMBOL);
problemClassElement.setAttribute("severity", severity.myName);
problemClassElement.setAttribute("attribute_key", attributeKey);
problemClassElement.addContent(InspectionsBundle.message("inspection.export.results.dead.code"));
element.addContent(problemClassElement);
@NonNls Element hintsElement = new Element("hints");
for (String hint : HINTS) {
@NonNls Element hintElement = new Element("hint");
hintElement.setAttribute("value", hint);
hintsElement.addContent(hintElement);
}
element.addContent(hintsElement);
Element descriptionElement = new Element(InspectionsBundle.message("inspection.export.results.description.tag"));
StringBuffer buf = new StringBuffer();
DeadHTMLComposer.appendProblemSynopsis((RefElement)refEntity, buf);
descriptionElement.addContent(buf.toString());
element.addContent(descriptionElement);
}
}
示例2: exportResults
import com.intellij.codeInspection.util.RefFilter; //導入依賴的package包/類
@Override
public void exportResults(@NotNull final Element parentNode, @NotNull RefEntity refEntity) {
if (!(refEntity instanceof RefJavaElement)) return;
final RefFilter filter = getFilter();
if (!getIgnoredRefElements().contains(refEntity) && filter.accepts((RefJavaElement)refEntity)) {
refEntity = getRefManager().getRefinedElement(refEntity);
Element element = refEntity.getRefManager().export(refEntity, parentNode, -1);
if (element == null) return;
@NonNls Element problemClassElement = new Element(InspectionsBundle.message("inspection.export.results.problem.element.tag"));
final RefElement refElement = (RefElement)refEntity;
final HighlightSeverity severity = getSeverity(refElement, getContext(), getToolWrapper());
final String attributeKey =
getTextAttributeKey(refElement.getRefManager().getProject(), severity, ProblemHighlightType.LIKE_UNUSED_SYMBOL);
problemClassElement.setAttribute("severity", severity.myName);
problemClassElement.setAttribute("attribute_key", attributeKey);
problemClassElement.addContent(InspectionsBundle.message("inspection.export.results.dead.code"));
element.addContent(problemClassElement);
@NonNls Element hintsElement = new Element("hints");
for (String hint : HINTS) {
@NonNls Element hintElement = new Element("hint");
hintElement.setAttribute("value", hint);
hintsElement.addContent(hintElement);
}
element.addContent(hintsElement);
Element descriptionElement = new Element(InspectionsBundle.message("inspection.export.results.description.tag"));
StringBuffer buf = new StringBuffer();
DeadHTMLComposer.appendProblemSynopsis((RefElement)refEntity, buf);
descriptionElement.addContent(buf.toString());
element.addContent(descriptionElement);
}
}
示例3: getFilter
import com.intellij.codeInspection.util.RefFilter; //導入依賴的package包/類
public RefFilter getFilter()
{
if(myFilter == null)
{
myFilter = new WeakUnreferencedFilter(getTool(), getContext());
}
return myFilter;
}
示例4: getFilter
import com.intellij.codeInspection.util.RefFilter; //導入依賴的package包/類
@Override
public RefFilter getFilter() {
return myFilter;
}
示例5: getFilter
import com.intellij.codeInspection.util.RefFilter; //導入依賴的package包/類
public RefFilter getFilter() {
if (myFilter == null) {
myFilter = new WeakUnreferencedFilter(getTool(), getContext());
}
return myFilter;
}
示例6: getFilter
import com.intellij.codeInspection.util.RefFilter; //導入依賴的package包/類
@Override
public RefFilter getFilter()
{
return myFilter;
}
示例7: exportResults
import com.intellij.codeInspection.util.RefFilter; //導入依賴的package包/類
@Override
public void exportResults(@NotNull final Element parentNode, @NotNull RefEntity refEntity)
{
if(!(refEntity instanceof RefJavaElement))
{
return;
}
final RefFilter filter = getFilter();
if(!getIgnoredRefElements().contains(refEntity) && filter.accepts((RefJavaElement) refEntity))
{
refEntity = getRefManager().getRefinedElement(refEntity);
Element element = refEntity.getRefManager().export(refEntity, parentNode, -1);
if(element == null)
{
return;
}
@NonNls Element problemClassElement = new Element(InspectionsBundle.message("inspection.export.results" +
".problem.element.tag"));
final RefElement refElement = (RefElement) refEntity;
final HighlightSeverity severity = getSeverity(refElement);
final String attributeKey = getTextAttributeKey(refElement.getRefManager().getProject(), severity,
ProblemHighlightType.LIKE_UNUSED_SYMBOL);
problemClassElement.setAttribute("severity", severity.myName);
problemClassElement.setAttribute("attribute_key", attributeKey);
problemClassElement.addContent(InspectionsBundle.message("inspection.export.results.dead.code"));
element.addContent(problemClassElement);
@NonNls Element hintsElement = new Element("hints");
for(String hint : HINTS)
{
@NonNls Element hintElement = new Element("hint");
hintElement.setAttribute("value", hint);
hintsElement.addContent(hintElement);
}
element.addContent(hintsElement);
Element descriptionElement = new Element(InspectionsBundle.message("inspection.export.results.description" +
".tag"));
StringBuffer buf = new StringBuffer();
DeadHTMLComposer.appendProblemSynopsis((RefElement) refEntity, buf);
descriptionElement.addContent(buf.toString());
element.addContent(descriptionElement);
}
}