本文整理汇总了Java中com.intellij.usageView.UsageViewShortNameLocation类的典型用法代码示例。如果您正苦于以下问题:Java UsageViewShortNameLocation类的具体用法?Java UsageViewShortNameLocation怎么用?Java UsageViewShortNameLocation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UsageViewShortNameLocation类属于com.intellij.usageView包,在下文中一共展示了UsageViewShortNameLocation类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getElementDescription
import com.intellij.usageView.UsageViewShortNameLocation; //导入依赖的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.UsageViewShortNameLocation; //导入依赖的package包/类
@Nullable
@Override
public String getElementDescription(@NotNull final PsiElement element, @NotNull final ElementDescriptionLocation location) {
if (element instanceof PyStringLiteralExpression) {
final PyMagicLiteralExtensionPoint point = PyMagicLiteralTools.getPoint((PyStringLiteralExpression)element);
if (point != null) {
if (location instanceof UsageViewTypeLocation) {
return point.getLiteralType();
}
if ((location instanceof UsageViewShortNameLocation) || (location instanceof UsageViewLongNameLocation)) {
return ((StringLiteralExpression)element).getStringValue();
}
}
}
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:PyMagicLiteralElementDescriptionProvider.java
示例3: getElementDescription
import com.intellij.usageView.UsageViewShortNameLocation; //导入依赖的package包/类
@Nullable
@Override
public String getElementDescription(PsiElement element, ElementDescriptionLocation location) {
if (!(element instanceof BuildElement)) {
return null;
}
if (location instanceof UsageViewLongNameLocation) {
return ((BuildElement) element).getPresentableText();
}
if (location instanceof UsageViewShortNameLocation) {
if (element instanceof PsiNameIdentifierOwner) {
// this is used by rename operations, so needs to be accurate
return ((PsiNameIdentifierOwner) element).getName();
}
if (element instanceof PsiFile) {
return ((PsiFile) element).getName();
}
return ((BuildElement) element).getPresentableText();
}
return null;
}
开发者ID:bazelbuild,项目名称:intellij,代码行数:22,代码来源:BuildElementDescriptionProvider.java
示例4: getElementDescription
import com.intellij.usageView.UsageViewShortNameLocation; //导入依赖的package包/类
@Nullable
@Override
public String getElementDescription(@NotNull PsiElement element, @NotNull ElementDescriptionLocation location) {
// https://intellij-support.jetbrains.com/hc/en-us/community/posts/206765785-Custom-name-for-Find-Usages-of-symbol
if (location instanceof UsageViewLongNameLocation ||
location instanceof UsageViewShortNameLocation) {
if (element instanceof SchemaTypeDef) {
SchemaTypeDef schemaTypeDef = (SchemaTypeDef) element;
return SchemaPresentationUtil.getName(schemaTypeDef, true);
}
if (element instanceof SchemaQnSegment) {
SchemaQnSegment fqnSegment = (SchemaQnSegment) element;
return fqnSegment.getQn().toString();
}
if (element instanceof SchemaEntityTagRef) {
SchemaEntityTagRef tagRef = (SchemaEntityTagRef) element;
return tagRef.getQid().getText();
}
}
return null;
}
开发者ID:SumoLogic,项目名称:epigraph,代码行数:26,代码来源:SchemaElementDescriptionProvider.java
示例5: getElementDescription
import com.intellij.usageView.UsageViewShortNameLocation; //导入依赖的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: getElementInfo
import com.intellij.usageView.UsageViewShortNameLocation; //导入依赖的package包/类
@NotNull
@Override
public String getElementInfo(@NotNull PsiElement e)
{
if(e instanceof PsiLambdaExpression)
{
return PsiExpressionTrimRenderer.render((PsiExpression) e);
}
else if(e instanceof PsiAnonymousClass)
{
String name = ((PsiAnonymousClass) e).getBaseClassReference().getReferenceName();
return "new " + notNullize(name, "class");
}
String description = ElementDescriptionUtil.getElementDescription(e, UsageViewShortNameLocation.INSTANCE);
String suffix = e instanceof PsiParameterListOwner ? "()" : null;
return suffix != null ? description + suffix : description;
}
开发者ID:consulo,项目名称:consulo-java,代码行数:18,代码来源:JavaBreadcrumbsInfoProvider.java
示例7: getElementDescription
import com.intellij.usageView.UsageViewShortNameLocation; //导入依赖的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
示例8: getQuickNavigateInfo
import com.intellij.usageView.UsageViewShortNameLocation; //导入依赖的package包/类
@Nullable
private static String getQuickNavigateInfo(PsiElement element) {
final String name = ElementDescriptionUtil.getElementDescription(element, UsageViewShortNameLocation.INSTANCE);
if (StringUtil.isEmpty(name)) return null;
final String typeName = ElementDescriptionUtil.getElementDescription(element, UsageViewTypeLocation.INSTANCE);
final PsiFile file = element.getContainingFile();
final StringBuilder sb = new StringBuilder();
if (StringUtil.isNotEmpty(typeName)) sb.append(typeName).append(" ");
sb.append("\"").append(name).append("\"");
if (file != null && file.isPhysical()) {
sb.append(" [").append(file.getName()).append("]");
}
return sb.toString();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:CtrlMouseHandler.java
示例9: getElementDescription
import com.intellij.usageView.UsageViewShortNameLocation; //导入依赖的package包/类
@Nullable
@Override
@RequiredReadAction
public String getElementDescription(@NotNull PsiElement element, @NotNull ElementDescriptionLocation location)
{
if(location == UsageViewShortNameLocation.INSTANCE && element instanceof CSharpNamedElement)
{
return ((CSharpNamedElement) element).getNameWithAt();
}
return null;
}
开发者ID:consulo,项目名称:consulo-csharp,代码行数:12,代码来源:CSharpElementDescriptionProvider.java
注:本文中的com.intellij.usageView.UsageViewShortNameLocation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论