當前位置: 首頁>>代碼示例>>Java>>正文


Java RefFilter.accepts方法代碼示例

本文整理匯總了Java中com.intellij.codeInspection.util.RefFilter.accepts方法的典型用法代碼示例。如果您正苦於以下問題:Java RefFilter.accepts方法的具體用法?Java RefFilter.accepts怎麽用?Java RefFilter.accepts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.codeInspection.util.RefFilter的用法示例。


在下文中一共展示了RefFilter.accepts方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:38,代碼來源:UnusedDeclarationPresentation.java

示例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);
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:38,代碼來源:UnusedDeclarationPresentation.java

示例3: 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);
	}
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:49,代碼來源:UnusedDeclarationPresentation.java


注:本文中的com.intellij.codeInspection.util.RefFilter.accepts方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。