本文整理汇总了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();
}
示例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;
}
示例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;
}