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


Java JavaDummyHolder类代码示例

本文整理汇总了Java中com.intellij.psi.impl.source.JavaDummyHolder的典型用法代码示例。如果您正苦于以下问题:Java JavaDummyHolder类的具体用法?Java JavaDummyHolder怎么用?Java JavaDummyHolder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JavaDummyHolder类属于com.intellij.psi.impl.source包,在下文中一共展示了JavaDummyHolder类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: arePackagesTheSame

import com.intellij.psi.impl.source.JavaDummyHolder; //导入依赖的package包/类
@Override
public boolean arePackagesTheSame(@NotNull PsiElement element1, @NotNull PsiElement element2) {
  PsiFile file1 = FileContextUtil.getContextFile(element1);
  PsiFile file2 = FileContextUtil.getContextFile(element2);
  if (Comparing.equal(file1, file2)) return true;
  if (file1 instanceof JavaDummyHolder && file2 instanceof JavaDummyHolder) return true;
  if (file1 instanceof JavaDummyHolder || file2 instanceof JavaDummyHolder) {
    JavaDummyHolder dummyHolder = (JavaDummyHolder) (file1 instanceof JavaDummyHolder ? file1 : file2);
    PsiElement other = file1 instanceof JavaDummyHolder ? file2 : file1;
    return dummyHolder.isSamePackage(other);
  }
  if (!(file1 instanceof PsiClassOwner)) return false;
  if (!(file2 instanceof PsiClassOwner)) return false;
  String package1 = ((PsiClassOwner) file1).getPackageName();
  String package2 = ((PsiClassOwner) file2).getPackageName();
  return Comparing.equal(package1, package2);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:JavaPsiFacadeImpl.java

示例2: isInPackage

import com.intellij.psi.impl.source.JavaDummyHolder; //导入依赖的package包/类
@Override
public boolean isInPackage(@NotNull PsiElement element, @NotNull PsiPackage aPackage) {
  final PsiFile file = FileContextUtil.getContextFile(element);
  if (file instanceof JavaDummyHolder) {
    return ((JavaDummyHolder) file).isInPackage(aPackage);
  }
  if (file instanceof PsiJavaFile) {
    final String packageName = ((PsiJavaFile) file).getPackageName();
    return packageName.equals(aPackage.getQualifiedName());
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:JavaPsiFacadeImpl.java

示例3: processDeclarations

import com.intellij.psi.impl.source.JavaDummyHolder; //导入依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) {
  if (lastParent == null) return true;
  if (lastParent.getContext() instanceof JavaDummyHolder) {
    return processor.execute(this, state);
  }

  if (lastParent.getParent() != this) return true;
  final ASTNode lastParentTree = SourceTreeToPsiMap.psiElementToTree(lastParent);

  return getChildRole(lastParentTree) != ChildRole.INITIALIZER ||
         processor.execute(this, state);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:PsiLocalVariableImpl.java

示例4: isInPackage

import com.intellij.psi.impl.source.JavaDummyHolder; //导入依赖的package包/类
@Override
public boolean isInPackage(@NotNull PsiElement element, @NotNull PsiJavaPackage aPackage)
{
	final PsiFile file = FileContextUtil.getContextFile(element);
	if(file instanceof JavaDummyHolder)
	{
		return ((JavaDummyHolder) file).isInPackage(aPackage);
	}
	if(file instanceof PsiJavaFile)
	{
		final String packageName = ((PsiJavaFile) file).getPackageName();
		return packageName.equals(aPackage.getQualifiedName());
	}
	return false;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:16,代码来源:JavaPsiFacadeImpl.java

示例5: arePackagesTheSame

import com.intellij.psi.impl.source.JavaDummyHolder; //导入依赖的package包/类
@Override
public boolean arePackagesTheSame(@NotNull PsiElement element1, @NotNull PsiElement element2)
{
	PsiFile file1 = FileContextUtil.getContextFile(element1);
	PsiFile file2 = FileContextUtil.getContextFile(element2);
	if(Comparing.equal(file1, file2))
	{
		return true;
	}
	if(file1 instanceof JavaDummyHolder && file2 instanceof JavaDummyHolder)
	{
		return true;
	}
	if(file1 instanceof JavaDummyHolder || file2 instanceof JavaDummyHolder)
	{
		JavaDummyHolder dummyHolder = (JavaDummyHolder) (file1 instanceof JavaDummyHolder ? file1 : file2);
		PsiElement other = file1 instanceof JavaDummyHolder ? file2 : file1;
		return dummyHolder.isSamePackage(other);
	}
	if(!(file1 instanceof PsiClassOwner))
	{
		return false;
	}
	if(!(file2 instanceof PsiClassOwner))
	{
		return false;
	}
	String package1 = ((PsiClassOwner) file1).getPackageName();
	String package2 = ((PsiClassOwner) file2).getPackageName();
	return Comparing.equal(package1, package2);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:32,代码来源:JavaPsiFacadeImpl.java


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