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