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


Java JavaAnonymousClassesHelper.getName方法代码示例

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


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

示例1: getClassVMName

import com.intellij.ide.util.JavaAnonymousClassesHelper; //导入方法依赖的package包/类
@Nullable
public static String getClassVMName(@Nullable PsiClass containingClass)
{
	// no support for local classes for now
	if(containingClass == null || PsiUtil.isLocalClass(containingClass))
	{
		return null;
	}
	if(containingClass instanceof PsiAnonymousClass)
	{
		String parentName = getClassVMName(PsiTreeUtil.getParentOfType(containingClass, PsiClass.class));
		if(parentName == null)
		{
			return null;
		}
		else
		{
			return parentName + JavaAnonymousClassesHelper.getName((PsiAnonymousClass) containingClass);
		}
	}
	return ClassUtil.getJVMClassName(containingClass);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:23,代码来源:JVMNameUtil.java

示例2: getClassVMName

import com.intellij.ide.util.JavaAnonymousClassesHelper; //导入方法依赖的package包/类
@Nullable
public static String getClassVMName(@Nullable PsiClass containingClass) {
  // no support for local classes for now
  if (containingClass == null || PsiUtil.isLocalClass(containingClass)) return null;
  if (containingClass instanceof PsiAnonymousClass) {
    String parentName = getClassVMName(PsiTreeUtil.getParentOfType(containingClass, PsiClass.class));
    if (parentName == null) {
      return null;
    }
    else {
      return parentName + JavaAnonymousClassesHelper.getName((PsiAnonymousClass)containingClass);
    }
  }
  return ClassUtil.getJVMClassName(containingClass);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:JVMNameUtil.java

示例3: getPresentableText

import com.intellij.ide.util.JavaAnonymousClassesHelper; //导入方法依赖的package包/类
@Override
public String getPresentableText() {
  if (myName != null) return myName;
  final PsiClass element = getElement();

  if (element != null) {
    myName = JavaAnonymousClassesHelper.getName((PsiAnonymousClass)element);
    if (myName != null) return myName;
  }
  return "Anonymous";
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:JavaAnonymousClassTreeElement.java

示例4: getInternalName

import com.intellij.ide.util.JavaAnonymousClassesHelper; //导入方法依赖的package包/类
/**
 * Computes the internal class name of the given class.
 * For example, for PsiClass foo.bar.Foo.Bar it returns foo/bar/Foo$Bar.
 *
 * @param psiClass the class to look up the internal name for
 * @return the internal class name
 * @see ClassContext#getInternalName(String)
 */
@Nullable
public static String getInternalName(@NonNull PsiClass psiClass) {
  if (psiClass instanceof PsiAnonymousClass) {
    PsiClass parent = PsiTreeUtil.getParentOfType(psiClass, PsiClass.class);
    if (parent != null) {
      String internalName = getInternalName(parent);
      if (internalName == null) {
        return null;
      }
      return internalName + JavaAnonymousClassesHelper.getName((PsiAnonymousClass)psiClass);
    }
  }
  String sig = ClassUtil.getJVMClassName(psiClass);
  if (sig == null) {
    String qualifiedName = psiClass.getQualifiedName();
    if (qualifiedName != null) {
      return ClassContext.getInternalName(qualifiedName);
    }
    return null;
  } else if (sig.indexOf('.') != -1) {
    // Workaround -- ClassUtil doesn't treat this correctly!
    // .replace('.', '/');
    sig = ClassContext.getInternalName(sig);
  }
  return sig;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:IntellijLintUtils.java

示例5: getClassVMName

import com.intellij.ide.util.JavaAnonymousClassesHelper; //导入方法依赖的package包/类
@Nullable
private static String getClassVMName(PsiClass containingClass) {
  if (containingClass instanceof PsiAnonymousClass) {
    return getClassVMName(PsiTreeUtil.getParentOfType(containingClass, PsiClass.class)) +
           JavaAnonymousClassesHelper.getName((PsiAnonymousClass)containingClass);
  }
  return ClassUtil.getJVMClassName(containingClass);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ByteCodeViewerManager.java

示例6: getClassVMName

import com.intellij.ide.util.JavaAnonymousClassesHelper; //导入方法依赖的package包/类
@Nullable
private static String getClassVMName(PsiClass containingClass) {
  if (containingClass instanceof PsiAnonymousClass) {
    return getClassVMName(PsiTreeUtil.getParentOfType(containingClass, PsiClass.class)) + 
           JavaAnonymousClassesHelper.getName((PsiAnonymousClass)containingClass);
  }
  return ClassUtil.getJVMClassName(containingClass);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:ByteCodeViewerManager.java


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