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


Java PositionUtil.getPsiElementAt方法代码示例

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


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

示例1: getPsiField

import com.intellij.debugger.impl.PositionUtil; //导入方法依赖的package包/类
public PsiField getPsiField() {
  final SourcePosition sourcePosition = getSourcePosition();
  try {
    final PsiField field = ApplicationManager.getApplication().runReadAction(new Computable<PsiField>() {
      @Override
      public PsiField compute() {
        final PsiClass psiClass = getPsiClassAt(sourcePosition);
        return psiClass != null ? psiClass.findFieldByName(getFieldName(), true) : null;
      }
    });
    if (field != null) {
      return field;
    }
  } catch (IndexNotReadyException ignored) {}
  return PositionUtil.getPsiElementAt(getProject(), PsiField.class, sourcePosition);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:FieldBreakpoint.java

示例2: reload

import com.intellij.debugger.impl.PositionUtil; //导入方法依赖的package包/类
@Override
protected void reload(PsiFile psiFile) {
  super.reload(psiFile);
  PsiField field = PositionUtil.getPsiElementAt(getProject(), PsiField.class, getSourcePosition());
  if(field != null) {
    setFieldName(field.getName());
    PsiClass psiClass = field.getContainingClass();
    if (psiClass != null) {
      getProperties().myClassName = psiClass.getQualifiedName();
    }
    myIsStatic = field.hasModifierProperty(PsiModifier.STATIC);
  }
  if (myIsStatic) {
    setInstanceFiltersEnabled(false);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:FieldBreakpoint.java

示例3: getPsiField

import com.intellij.debugger.impl.PositionUtil; //导入方法依赖的package包/类
public PsiField getPsiField()
{
	final SourcePosition sourcePosition = getSourcePosition();
	final PsiField field = ApplicationManager.getApplication().runReadAction(new Computable<PsiField>()
	{
		@Override
		public PsiField compute()
		{
			final PsiClass psiClass = getPsiClassAt(sourcePosition);
			return psiClass != null ? psiClass.findFieldByName(getFieldName(), true) : null;
		}
	});
	if(field != null)
	{
		return field;
	}
	return PositionUtil.getPsiElementAt(getProject(), PsiField.class, sourcePosition);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:19,代码来源:FieldBreakpoint.java

示例4: reload

import com.intellij.debugger.impl.PositionUtil; //导入方法依赖的package包/类
@Override
protected void reload(PsiFile psiFile)
{
	super.reload(psiFile);
	PsiField field = PositionUtil.getPsiElementAt(getProject(), PsiField.class, getSourcePosition());
	if(field != null)
	{
		setFieldName(field.getName());
		PsiClass psiClass = field.getContainingClass();
		if(psiClass != null)
		{
			getProperties().myClassName = psiClass.getQualifiedName();
		}
		myIsStatic = field.hasModifierProperty(PsiModifier.STATIC);
	}
	if(myIsStatic)
	{
		setInstanceFiltersEnabled(false);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:21,代码来源:FieldBreakpoint.java

示例5: getPsiField

import com.intellij.debugger.impl.PositionUtil; //导入方法依赖的package包/类
public PsiField getPsiField() {
  final SourcePosition sourcePosition = getSourcePosition();
  final PsiField field = ApplicationManager.getApplication().runReadAction(new Computable<PsiField>() {
    @Override
    public PsiField compute() {
      final PsiClass psiClass = getPsiClassAt(sourcePosition);
      return psiClass != null ? psiClass.findFieldByName(myFieldName, true) : null;
    }
  });
  if (field != null) {
    return field;
  }
  return PositionUtil.getPsiElementAt(getProject(), PsiField.class, sourcePosition);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:FieldBreakpoint.java

示例6: reload

import com.intellij.debugger.impl.PositionUtil; //导入方法依赖的package包/类
@Override
protected void reload(PsiFile psiFile) {
  super.reload(psiFile);
  PsiField field = PositionUtil.getPsiElementAt(getProject(), PsiField.class, getSourcePosition());
  if(field != null) {
    myFieldName = field.getName();
    myIsStatic = field.hasModifierProperty(PsiModifier.STATIC);
  }
  if (myIsStatic) {
    INSTANCE_FILTERS_ENABLED = false;
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:FieldBreakpoint.java

示例7: moveTo

import com.intellij.debugger.impl.PositionUtil; //导入方法依赖的package包/类
@Override
public boolean moveTo(@NotNull SourcePosition position) {
  final PsiField field = PositionUtil.getPsiElementAt(getProject(), PsiField.class, position);
  return field != null && super.moveTo(SourcePosition.createFromElement(field));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:6,代码来源:FieldBreakpoint.java

示例8: canMoveTo

import com.intellij.debugger.impl.PositionUtil; //导入方法依赖的package包/类
@Override
public boolean canMoveTo(final SourcePosition position) {
  return super.canMoveTo(position) && PositionUtil.getPsiElementAt(getProject(), PsiField.class, position) != null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:FieldBreakpoint.java

示例9: canMoveTo

import com.intellij.debugger.impl.PositionUtil; //导入方法依赖的package包/类
public boolean canMoveTo(final SourcePosition position) {
  return super.canMoveTo(position) && PositionUtil.getPsiElementAt(getProject(), PsiMethod.class, position) != null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:MethodBreakpoint.java


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