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