當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。