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