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


Java DebuggerUtils.findClass方法代码示例

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


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

示例1: initEvaluatorAndChildrenExpression

import com.intellij.debugger.engine.DebuggerUtils; //导入方法依赖的package包/类
protected Cache initEvaluatorAndChildrenExpression(final Project project) {
  final Cache cache = new Cache();
  try {
    final PsiClass contextClass = DebuggerUtils.findClass(getClassName(), project, GlobalSearchScope.allScope(project));
    if(contextClass == null) {
      throw EvaluateExceptionUtil.CANNOT_FIND_SOURCE_CLASS;
    }
    final PsiType contextType = DebuggerUtils.getType(getClassName(), project);
    cache.myPsiChildrenExpression = null;
    JavaCodeFragment codeFragment = myDefaultFragmentFactory.createCodeFragment(myReferenceExpression, contextClass, project);
    codeFragment.forceResolveScope(GlobalSearchScope.allScope(project));
    codeFragment.setThisType(contextType);
    DebuggerUtils.checkSyntax(codeFragment);
    cache.myPsiChildrenExpression = ((PsiExpressionCodeFragment)codeFragment).getExpression();
    cache.myEvaluator = myDefaultFragmentFactory.getEvaluatorBuilder().build(cache.myPsiChildrenExpression, null);
  }
  catch (EvaluateException e) {
    cache.myException = e;
  }

  myCache = new SoftReference<Cache>(cache);
  return cache;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:CachedEvaluator.java

示例2: getEvaluationCode

import com.intellij.debugger.engine.DebuggerUtils; //导入方法依赖的package包/类
protected PsiCodeFragment getEvaluationCode(final StackFrameContext context) throws EvaluateException {
  Value value = myParentDescriptor.getValue();

  if(value instanceof ObjectReference) {
    final String typeName = value.type().name();

    final PsiClass psiClass = DebuggerUtils.findClass(myTypeName, myProject, context.getDebugProcess().getSearchScope());

    if (psiClass == null) {
      throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.invalid.type.name", typeName));
    }

    return createCodeFragment(psiClass);
  }
  else {
    throw EvaluateExceptionUtil.createEvaluateException(
      DebuggerBundle.message("evaluation.error.objref.expected", myParentDescriptor.getName())
    );
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:UserExpressionDescriptorImpl.java

示例3: getPsiClass

import com.intellij.debugger.engine.DebuggerUtils; //导入方法依赖的package包/类
@Nullable
private PsiClass getPsiClass(AnActionEvent e)
{
	final ReferenceType selectedClass = getSelectedClass(e);
	final Project project = e.getProject();
	if(selectedClass == null || project == null)
	{
		return null;
	}

	final ReferenceType targetClass = getObjectType(selectedClass);
	if(targetClass != null)
	{
		return DebuggerUtils.findClass(targetClass.name(), project, GlobalSearchScope.allScope(project));
	}

	return null;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:19,代码来源:JumpToTypeSourceAction.java

示例4: ClassChildrenExpressionConfigurable

import com.intellij.debugger.engine.DebuggerUtils; //导入方法依赖的package包/类
public ClassChildrenExpressionConfigurable(@NotNull Project project, @NotNull ExpressionChildrenRenderer renderer) {
  myRenderer = renderer;

  PsiClass psiClass = DebuggerUtils.findClass(myRenderer.getClassName(), project, GlobalSearchScope.allScope(project));
  myChildrenEditor = new DebuggerExpressionComboBox(project, this, psiClass, "ClassChildrenExpression");
  myExpandableEditor = new DebuggerExpressionComboBox(project, this, psiClass, "ClassChildrenExpression");

  myChildrenPanel.getComponent().setLayout(new BorderLayout());
  myChildrenPanel.getComponent().add(myChildrenEditor);

  myExpandablePanel.getComponent().setLayout(new BorderLayout());
  myExpandablePanel.getComponent().add(myExpandableEditor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ClassChildrenExpressionConfigurable.java

示例5: ClassChildrenExpressionConfigurable

import com.intellij.debugger.engine.DebuggerUtils; //导入方法依赖的package包/类
public ClassChildrenExpressionConfigurable(Project project, ExpressionChildrenRenderer renderer) {
  myRenderer = renderer;

  PsiClass psiClass = DebuggerUtils.findClass(myRenderer.getClassName(), project, GlobalSearchScope.allScope(project));
  myChildrenEditor   = ((DebuggerUtilsEx)DebuggerUtils.getInstance()).createEditor(project, psiClass, "ClassChildrenExpression");
  myExpandableEditor = ((DebuggerUtilsEx)DebuggerUtils.getInstance()).createEditor(project, psiClass, "ClassChildrenExpression");

  myChildrenPanel.getComponent().setLayout(new BorderLayout());
  myChildrenPanel.getComponent().add(myChildrenEditor);

  myExpandablePanel.getComponent().setLayout(new BorderLayout());
  myExpandablePanel.getComponent().add(myExpandableEditor);    
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:ClassChildrenExpressionConfigurable.java

示例6: ClassLabelExpressionConfigurable

import com.intellij.debugger.engine.DebuggerUtils; //导入方法依赖的package包/类
public ClassLabelExpressionConfigurable(@NotNull Project project, LabelRenderer renderer) {
  myRenderer = renderer;

  myCompletionEditor = new LabeledComponent<CompletionEditor>();
  final PsiClass psiClass = DebuggerUtils.findClass(myRenderer.getClassName(), project, GlobalSearchScope.allScope(project));
  myCompletionEditor.setComponent(((DebuggerUtilsEx)DebuggerUtils.getInstance()).createEditor(project, psiClass, "ClassLabelExpression"));
  myCompletionEditor.setText(DebuggerBundle.message("label.class.label.expression.configurable.node.label"));

  myPanel = new JPanel(new BorderLayout());
  myPanel.add(myCompletionEditor, BorderLayout.NORTH);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:ClassLabelExpressionConfigurable.java

示例7: getContext

import com.intellij.debugger.engine.DebuggerUtils; //导入方法依赖的package包/类
protected final PsiElement getContext(Project project, DebuggerContext context) {
  DebugProcess process = context.getDebugProcess();
  GlobalSearchScope scope = process != null ? process.getSearchScope() : GlobalSearchScope.allScope(project);
  return DebuggerUtils.findClass(getClassName(), project, scope);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:CompoundReferenceRenderer.java

示例8: getContext

import com.intellij.debugger.engine.DebuggerUtils; //导入方法依赖的package包/类
protected final PsiElement getContext(Project project, DebuggerContext context)
{
	DebugProcess process = context.getDebugProcess();
	GlobalSearchScope scope = process != null ? process.getSearchScope() : GlobalSearchScope.allScope(project);
	return DebuggerUtils.findClass(getClassName(), project, scope);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:7,代码来源:CompoundTypeRenderer.java


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