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


Java UsageViewLongNameLocation.INSTANCE属性代码示例

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


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

示例1: getElementDescription

@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,代码行数:24,代码来源:DescriptionProvider.java

示例2: getElementDescription

@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,代码行数:21,代码来源:DefaultDomTargetDescriptionProvider.java

示例3: getElementDescription

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,代码行数:20,代码来源:DefaultDomTargetDescriptionProvider.java


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