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


Java JVMNameUtil.getNonAnonymousClassName方法代码示例

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


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

示例1: addBreakpoint

import com.intellij.debugger.engine.JVMNameUtil; //导入方法依赖的package包/类
@Nullable
@Override
public XBreakpoint<JavaExceptionBreakpointProperties> addBreakpoint(final Project project, JComponent parentComponent) {
  final PsiClass throwableClass =
    JavaPsiFacade.getInstance(project).findClass(CommonClassNames.JAVA_LANG_THROWABLE, GlobalSearchScope.allScope(project));
  TreeClassChooser chooser = TreeClassChooserFactory.getInstance(project)
    .createInheritanceClassChooser(DebuggerBundle.message("add.exception.breakpoint.classchooser.title"),
                                   GlobalSearchScope.allScope(project), throwableClass, true, true, null);
  chooser.showDialog();
  final PsiClass selectedClass = chooser.getSelected();
  final String qName = selectedClass == null ? null : JVMNameUtil.getNonAnonymousClassName(selectedClass);

  if (qName != null && qName.length() > 0) {
    return ApplicationManager.getApplication().runWriteAction(new Computable<XBreakpoint<JavaExceptionBreakpointProperties>>() {
     @Override
     public XBreakpoint<JavaExceptionBreakpointProperties> compute() {
       return XDebuggerManager.getInstance(project).getBreakpointManager().addBreakpoint(
         JavaExceptionBreakpointType.this, new JavaExceptionBreakpointProperties(qName, ((PsiClassOwner)selectedClass.getContainingFile()).getPackageName()));
     }
   });
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:JavaExceptionBreakpointType.java

示例2: addBreakpoint

import com.intellij.debugger.engine.JVMNameUtil; //导入方法依赖的package包/类
@Override
public Breakpoint addBreakpoint(Project project) {
  ExceptionBreakpoint breakpoint = null;
  final PsiClass throwableClass =
    JavaPsiFacade.getInstance(project).findClass("java.lang.Throwable", GlobalSearchScope.allScope(project));
  TreeClassChooser chooser = TreeClassChooserFactory.getInstance(project)
    .createInheritanceClassChooser(DebuggerBundle.message("add.exception.breakpoint.classchooser.title"),
                                   GlobalSearchScope.allScope(project), throwableClass, true, true, null);
  chooser.showDialog();
  PsiClass selectedClass = chooser.getSelected();
  String qName = selectedClass == null ? null : JVMNameUtil.getNonAnonymousClassName(selectedClass);

  if (qName != null && qName.length() > 0) {
    breakpoint = DebuggerManagerEx.getInstanceEx(project).getBreakpointManager()
      .addExceptionBreakpoint(qName, ((PsiClassOwner)selectedClass.getContainingFile()).getPackageName());
  }
  return breakpoint;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:ExceptionBreakpointFactory.java

示例3: addBreakpoint

import com.intellij.debugger.engine.JVMNameUtil; //导入方法依赖的package包/类
@Nullable
@Override
public XBreakpoint<JavaExceptionBreakpointProperties> addBreakpoint(final Project project, JComponent parentComponent)
{
	final PsiClass throwableClass = JavaPsiFacade.getInstance(project).findClass("java.lang.Throwable", GlobalSearchScope.allScope(project));
	TreeClassChooser chooser = TreeClassChooserFactory.getInstance(project).createInheritanceClassChooser(DebuggerBundle.message("add.exception" +
			".breakpoint.classchooser.title"), GlobalSearchScope.allScope(project), throwableClass, true, true, null);
	chooser.showDialog();
	final PsiClass selectedClass = chooser.getSelected();
	final String qName = selectedClass == null ? null : JVMNameUtil.getNonAnonymousClassName(selectedClass);

	if(qName != null && qName.length() > 0)
	{
		return ApplicationManager.getApplication().runWriteAction(new Computable<XBreakpoint<JavaExceptionBreakpointProperties>>()
		{
			@Override
			public XBreakpoint<JavaExceptionBreakpointProperties> compute()
			{
				return XDebuggerManager.getInstance(project).getBreakpointManager().addBreakpoint(JavaExceptionBreakpointType.this,
						new JavaExceptionBreakpointProperties(qName, ((PsiClassOwner) selectedClass.getContainingFile()).getPackageName()));
			}
		});
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:26,代码来源:JavaExceptionBreakpointType.java

示例4: createClassFilter

import com.intellij.debugger.engine.JVMNameUtil; //导入方法依赖的package包/类
public static TargetClassFilter createClassFilter(PsiClass psiClass) {
  if (psiClass instanceof PsiAnonymousClass) {
    return TargetClassFilter.ALL;
  }
  if (PsiUtil.isLocalClass(psiClass)) {
    return new LocalClassFilter(psiClass.getName());
  }
  final String name = JVMNameUtil.getNonAnonymousClassName(psiClass);
  return name != null? new FQNameClassFilter(name) : TargetClassFilter.ALL;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:FieldEvaluator.java

示例5: createClassFilter

import com.intellij.debugger.engine.JVMNameUtil; //导入方法依赖的package包/类
public static TargetClassFilter createClassFilter(PsiClass psiClass)
{
	if(psiClass instanceof PsiAnonymousClass)
	{
		return TargetClassFilter.ALL;
	}
	if(PsiUtil.isLocalClass(psiClass))
	{
		return new LocalClassFilter(psiClass.getName());
	}
	final String name = JVMNameUtil.getNonAnonymousClassName(psiClass);
	return name != null ? new FQNameClassFilter(name) : TargetClassFilter.ALL;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:14,代码来源:FieldEvaluator.java

示例6: addCapturePointIfNeeded

import com.intellij.debugger.engine.JVMNameUtil; //导入方法依赖的package包/类
private static void addCapturePointIfNeeded(PsiModifierListOwner psiElement,
		PsiMethod psiMethod,
		String annotationName,
		String defaultExpression,
		boolean capture,
		List<CapturePoint> capturePointsFromAnnotations)
{
	CapturePoint capturePoint = new CapturePoint();
	capturePoint.myEnabled = false;
	if(capture)
	{
		capturePoint.myClassName = JVMNameUtil.getNonAnonymousClassName(psiMethod.getContainingClass());
		capturePoint.myMethodName = JVMNameUtil.getJVMMethodName(psiMethod);
	}
	else
	{
		capturePoint.myInsertClassName = JVMNameUtil.getNonAnonymousClassName(psiMethod.getContainingClass());
		capturePoint.myInsertMethodName = JVMNameUtil.getJVMMethodName(psiMethod);
	}

	PsiModifierList modifierList = psiElement.getModifierList();
	if(modifierList != null)
	{
		PsiAnnotation annotation = modifierList.findAnnotation(annotationName);
		if(annotation != null)
		{
			PsiAnnotationMemberValue keyExpressionValue = annotation.findAttributeValue("keyExpression");
			String keyExpression = keyExpressionValue != null ? StringUtil.unquoteString(keyExpressionValue.getText()) : null;
			if(StringUtil.isEmpty(keyExpression))
			{
				keyExpression = defaultExpression;
			}
			if(capture)
			{
				capturePoint.myCaptureKeyExpression = keyExpression;
			}
			else
			{
				capturePoint.myInsertKeyExpression = keyExpression;
			}

			PsiAnnotationMemberValue groupValue = annotation.findAttributeValue("group");
			String group = groupValue != null ? StringUtil.unquoteString(groupValue.getText()) : null;
			if(!StringUtil.isEmpty(group))
			{
				for(CapturePoint capturePointsFromAnnotation : capturePointsFromAnnotations)
				{
					if(StringUtil.startsWith(group, capturePointsFromAnnotation.myClassName) && StringUtil.endsWith(group, capturePointsFromAnnotation.myMethodName))
					{
						capturePointsFromAnnotation.myInsertClassName = capturePoint.myInsertClassName;
						capturePointsFromAnnotation.myInsertMethodName = capturePoint.myInsertMethodName;
						capturePointsFromAnnotation.myInsertKeyExpression = capturePoint.myInsertKeyExpression;
						return;
					}
				}
			}
		}
	}

	capturePointsFromAnnotations.add(capturePoint);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:62,代码来源:CaptureConfigurable.java


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