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


Java UsageViewNodeTextLocation类代码示例

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


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

示例1: getElementDescription

import com.intellij.usageView.UsageViewNodeTextLocation; //导入依赖的package包/类
@Override
public String getElementDescription(@NotNull PsiElement element, @NotNull ElementDescriptionLocation location) {
    if (location == UsageViewNodeTextLocation.INSTANCE && element instanceof PsiNamedElement) {
        return getElementDescription(element, UsageViewShortNameLocation.INSTANCE);
    }

    if (location == UsageViewShortNameLocation.INSTANCE || location == UsageViewLongNameLocation.INSTANCE) {
        if (element instanceof PsiNamedElement) {
            return ((PsiNamedElement) element).getName();
        }
    }

    if (location == UsageViewTypeLocation.INSTANCE) {
        if (element instanceof PsiModuleName) {
            return "module";
        } else if (element instanceof PsiTypeName) {
            return "type";
        } else if (element instanceof PsiVarName) {
            return "let";
        }
    }

    return element.toString();
}
 
开发者ID:reasonml-editor,项目名称:reasonml-idea-plugin,代码行数:25,代码来源:DescriptionProvider.java

示例2: getElementDescription

import com.intellij.usageView.UsageViewNodeTextLocation; //导入依赖的package包/类
@Override
public String getElementDescription(@NotNull PomTarget element, @NotNull ElementDescriptionLocation location) {
  if (!(element instanceof DomTarget)) return null;

  final DomTarget target = (DomTarget)element;

  DomElement domElement = target.getDomElement();
  final ElementPresentationTemplate template = domElement.getChildDescription().getPresentationTemplate();
  final ElementPresentation presentation = template != null ? template.createPresentation(domElement) : domElement.getPresentation();

  if (location == UsageViewTypeLocation.INSTANCE) {
    return presentation.getTypeName();
  }
  if (location == UsageViewNodeTextLocation.INSTANCE || location == UsageViewLongNameLocation.INSTANCE) {
    return presentation.getTypeName() + " " + StringUtil.notNullize(presentation.getElementName(), "''");
  }
  if (location instanceof HighlightUsagesDescriptionLocation) {
    return presentation.getTypeName();
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:DefaultDomTargetDescriptionProvider.java

示例3: getElementDescription

import com.intellij.usageView.UsageViewNodeTextLocation; //导入依赖的package包/类
@Override
    @Nullable
    public String getElementDescription(@NotNull PsiElement element, @NotNull ElementDescriptionLocation location) {
        if (!(element instanceof GLSLDeclarator)) return null;
        GLSLDeclarator declarator = (GLSLDeclarator) element;
        GLSLDeclaration declaration = declarator.getParentDeclaration();
        if (declaration == null) return null;

        if (location instanceof UsageViewTypeLocation) {
            return declaration.getDeclarationDescription();
        }

        if (location instanceof UsageViewLongNameLocation) {
            return declaration.getDeclarationDescription() + " '" + declarator.getName() + "'";
        }

        if (location instanceof UsageViewNodeTextLocation) {
            return declarator.getName();
        }
        return null;
//        return location.toString();
    }
 
开发者ID:Darkyenus,项目名称:glsl4idea,代码行数:23,代码来源:GLSLDescriptionProvider.java

示例4: getElementDescription

import com.intellij.usageView.UsageViewNodeTextLocation; //导入依赖的package包/类
public String getElementDescription(@NotNull PomTarget element, @NotNull ElementDescriptionLocation location) {
  if (!(element instanceof DomTarget)) return null;

  final DomTarget target = (DomTarget)element;

  DomElement domElement = target.getDomElement();
  final ElementPresentationTemplate template = domElement.getChildDescription().getPresentationTemplate();
  final ElementPresentation presentation = template != null ? template.createPresentation(domElement) : domElement.getPresentation();

  if (location == UsageViewTypeLocation.INSTANCE) {
    return presentation.getTypeName();
  }
  if (location == UsageViewNodeTextLocation.INSTANCE || location == UsageViewLongNameLocation.INSTANCE) {
    return presentation.getTypeName() + " " + StringUtil.notNullize(presentation.getElementName(), "''");
  }
  if (location instanceof HighlightUsagesDescriptionLocation) {
    return presentation.getTypeName();
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:DefaultDomTargetDescriptionProvider.java

示例5: getElementDescription

import com.intellij.usageView.UsageViewNodeTextLocation; //导入依赖的package包/类
@Nullable
@Override
public String getElementDescription(@NotNull PsiElement element, @NotNull ElementDescriptionLocation location) {
    if (!TranslationUtils.isTranslationFile(element.getContainingFile())) {
        return null;
    }

    if (location instanceof UsageViewTypeLocation) {
        return "Translation key";
    }

    if (location instanceof UsageViewNodeTextLocation || location instanceof UsageViewShortNameLocation || location instanceof UsageViewLongNameLocation) {
        return TranslationHashElement.newInstance(element).getFullKey();
    }

    return null;
}
 
开发者ID:letsdrink,项目名称:ouzo-phpstorm-plugin,代码行数:18,代码来源:TranslationKeyDescriptionProvider.java

示例6: getElementDescription

import com.intellij.usageView.UsageViewNodeTextLocation; //导入依赖的package包/类
@Nullable
@Override
public String getElementDescription(@NotNull PsiElement element, @NotNull ElementDescriptionLocation location) {
    if (location instanceof UsageViewTypeLocation) {
        if (element instanceof FrogAttribute) {
            return "Attribute";
        }
    } else if (location instanceof UsageViewNodeTextLocation
            || location instanceof UsageViewShortNameLocation
            || location instanceof UsageViewLongNameLocation) {
        if (element instanceof FrogAttribute) {
            return ((FrogAttribute) element).getName();
        }
    }

    return null;
}
 
开发者ID:Ladicek,项目名称:IntelliFrog,代码行数:18,代码来源:FrogElementDescriptionProvider.java

示例7: getElementDescription

import com.intellij.usageView.UsageViewNodeTextLocation; //导入依赖的package包/类
@Override
public String getElementDescription(@NotNull PomTarget element, @NotNull ElementDescriptionLocation location) {
  if (element instanceof PsiElement) return null;
  
  if (location == UsageViewTypeLocation.INSTANCE) {
    return getTypeName(element);
  }
  if (location == UsageViewNodeTextLocation.INSTANCE) {
    return getTypeName(element) + " " + StringUtil.notNullize(element instanceof PomNamedTarget ? ((PomNamedTarget)element).getName() : null, "''");
  }
  if (location instanceof HighlightUsagesDescriptionLocation) {
    return getTypeName(element);
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:DefaultPomTargetDescriptionProvider.java

示例8: getElementDescription

import com.intellij.usageView.UsageViewNodeTextLocation; //导入依赖的package包/类
@Override
public String getElementDescription(@Nonnull PomTarget element, @Nonnull ElementDescriptionLocation location) {
  if (element instanceof PsiElement) return null;

  if (location == UsageViewTypeLocation.INSTANCE) {
    return getTypeName(element);
  }
  if (location == UsageViewNodeTextLocation.INSTANCE) {
    return getTypeName(element) + " " + StringUtil.notNullize(element instanceof PomNamedTarget ? ((PomNamedTarget)element).getName() : null, "''");
  }
  if (location instanceof HighlightUsagesDescriptionLocation) {
    return getTypeName(element);
  }
  return null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:16,代码来源:DefaultPomTargetDescriptionProvider.java

示例9: getNodeText

import com.intellij.usageView.UsageViewNodeTextLocation; //导入依赖的package包/类
@NotNull
@Override
public String getNodeText(@NotNull PsiElement element, boolean useFullName) {
    return ElementDescriptionUtil.getElementDescription(element, UsageViewNodeTextLocation.INSTANCE);
}
 
开发者ID:reasonml-editor,项目名称:reasonml-idea-plugin,代码行数:6,代码来源:RmlFindUsagesProvider.java

示例10: getNodeText

import com.intellij.usageView.UsageViewNodeTextLocation; //导入依赖的package包/类
@NotNull
@Override
public String getNodeText(@NotNull PsiElement psiElement, boolean b) {
    return ElementDescriptionUtil.getElementDescription(psiElement, UsageViewNodeTextLocation.INSTANCE);
}
 
开发者ID:dubrousky,项目名称:CMaker,代码行数:6,代码来源:CMakeFindUsagesProvider.java


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