當前位置: 首頁>>代碼示例>>Java>>正文


Java JavaAnonymousClassesHelper類代碼示例

本文整理匯總了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);
}
 
開發者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類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。