本文整理匯總了Java中com.intellij.ide.util.JavaAnonymousClassesHelper類的典型用法代碼示例。如果您正苦於以下問題:Java JavaAnonymousClassesHelper類的具體用法?Java JavaAnonymousClassesHelper怎麽用?Java JavaAnonymousClassesHelper使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JavaAnonymousClassesHelper類屬於com.intellij.ide.util包,在下文中一共展示了JavaAnonymousClassesHelper類的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);
}