Java 类com.intellij.psi.impl.source.tree.java.ImportStatementElement 实例源码

项目:intellij-ce-playground    文件:JavaUsageToPsiElementProvider.java   
@Override
public PsiElement getAppropriateParentFrom(PsiElement element) {
  if (element.getLanguage() == JAVA) {
    int hopes = 0;
    while (hopes++ < MAX_HOPES && element != null) {
      if (element instanceof PsiField ||
          element instanceof PsiMethod ||
          element instanceof ImportStatementElement ||
          element instanceof PsiClass
        ) return element;

      element = element.getParent();
    }
  }
  return null;
}
项目:tools-idea    文件:JavaUsageToPsiElementProvider.java   
@Override
public PsiElement getAppropriateParentFrom(PsiElement element) {
  if (element.getLanguage() == JAVA) {
    int hopes = 0;
    while (hopes++ < MAX_HOPES && element != null) {
      if (element instanceof PsiField ||
          element instanceof PsiMethod ||
          element instanceof ImportStatementElement ||
          element instanceof PsiClass
        ) return element;

      element = element.getParent();
    }
  }
  return null;
}
项目:consulo-java    文件:JavaUsageToPsiElementProvider.java   
@Override
public PsiElement getAppropriateParentFrom(PsiElement element) {
  if (element.getLanguage() == JavaLanguage.INSTANCE) {
    int hopes = 0;
    while (hopes++ < MAX_HOPES && element != null) {
      if (element instanceof PsiField ||
          element instanceof PsiMethod ||
          element instanceof ImportStatementElement ||
          element instanceof PsiClass
        ) return element;

      element = element.getParent();
    }
  }
  return null;
}