當前位置: 首頁>>代碼示例>>Java>>正文


Java ThrowSearchUtil.isSearchable方法代碼示例

本文整理匯總了Java中com.intellij.psi.impl.search.ThrowSearchUtil.isSearchable方法的典型用法代碼示例。如果您正苦於以下問題:Java ThrowSearchUtil.isSearchable方法的具體用法?Java ThrowSearchUtil.isSearchable怎麽用?Java ThrowSearchUtil.isSearchable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.psi.impl.search.ThrowSearchUtil的用法示例。


在下文中一共展示了ThrowSearchUtil.isSearchable方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getHelpId

import com.intellij.psi.impl.search.ThrowSearchUtil; //導入方法依賴的package包/類
@Override
public String getHelpId(@NotNull PsiElement element) {
  if (element instanceof PsiPackage) {
    return HelpID.FIND_PACKAGE_USAGES;
  }
  if (element instanceof PsiClass) {
    return HelpID.FIND_CLASS_USAGES;
  }
  if (element instanceof PsiMethod) {
    return HelpID.FIND_METHOD_USAGES;
  }
  if (ThrowSearchUtil.isSearchable(element)) {
    return HelpID.FIND_THROW_USAGES;
  }
  return com.intellij.lang.HelpID.FIND_OTHER_USAGES;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:JavaFindUsagesProvider.java

示例2: getFindUsagesDialog

import com.intellij.psi.impl.search.ThrowSearchUtil; //導入方法依賴的package包/類
@Override
@NotNull
public AbstractFindUsagesDialog getFindUsagesDialog(boolean isSingleFile, boolean toShowInNewTab, boolean mustOpenInNewTab) {
  PsiElement element = getPsiElement();
  if (element instanceof PsiPackage) {
    return new FindPackageUsagesDialog(element, getProject(), myFactory.getFindPackageOptions(), toShowInNewTab, mustOpenInNewTab, isSingleFile, this);
  }
  if (element instanceof PsiClass) {
    return new FindClassUsagesDialog(element, getProject(), myFactory.getFindClassOptions(), toShowInNewTab, mustOpenInNewTab, isSingleFile, this);
  }
  if (element instanceof PsiMethod) {
    return new FindMethodUsagesDialog(element, getProject(), myFactory.getFindMethodOptions(), toShowInNewTab, mustOpenInNewTab, isSingleFile, this);
  }
  if (element instanceof PsiVariable) {
    return new FindVariableUsagesDialog(element, getProject(), myFactory.getFindVariableOptions(), toShowInNewTab, mustOpenInNewTab, isSingleFile, this);
  }
  if (ThrowSearchUtil.isSearchable(element)) {
    return new FindThrowUsagesDialog(element, getProject(), myFactory.getFindThrowOptions(), toShowInNewTab, mustOpenInNewTab, isSingleFile, this);
  }
  return super.getFindUsagesDialog(isSingleFile, toShowInNewTab, mustOpenInNewTab);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:JavaFindUsagesHandler.java

示例3: getFindUsagesOptions

import com.intellij.psi.impl.search.ThrowSearchUtil; //導入方法依賴的package包/類
@Override
@NotNull
public FindUsagesOptions getFindUsagesOptions(@Nullable final DataContext dataContext) {
  PsiElement element = getPsiElement();
  if (element instanceof PsiPackage) {
    return myFactory.getFindPackageOptions();
  }
  if (element instanceof PsiClass) {
    return myFactory.getFindClassOptions();
  }
  if (element instanceof PsiMethod) {
    return myFactory.getFindMethodOptions();
  }
  if (element instanceof PsiVariable) {
    return myFactory.getFindVariableOptions();
  }
  if (ThrowSearchUtil.isSearchable(element)) {
    return myFactory.getFindThrowOptions();
  }
  return super.getFindUsagesOptions(dataContext);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:JavaFindUsagesHandler.java

示例4: getHelpId

import com.intellij.psi.impl.search.ThrowSearchUtil; //導入方法依賴的package包/類
@Override
public String getHelpId(@NotNull PsiElement element) {
  if (element instanceof PsiPackage) {
    return HelpID.FIND_PACKAGE_USAGES;
  }
  if (element instanceof PsiClass) {
    return HelpID.FIND_CLASS_USAGES;
  }
  if (element instanceof PsiMethod) {
    return HelpID.FIND_METHOD_USAGES;
  }
  if (ThrowSearchUtil.isSearchable(element)) {
    return HelpID.FIND_THROW_USAGES;
  }
  return HelpID.FIND_OTHER_USAGES;
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:17,代碼來源:JavaFindUsagesProvider.java

示例5: canFindUsagesFor

import com.intellij.psi.impl.search.ThrowSearchUtil; //導入方法依賴的package包/類
@Override
public boolean canFindUsagesFor(@NotNull PsiElement element)
{
	if(element instanceof PsiDirectory)
	{
		PsiPackage psiPackage = JavaDirectoryService.getInstance().getPackage((PsiDirectory) element);
		return psiPackage != null && psiPackage.getQualifiedName().length() != 0;
	}

	return element instanceof PsiClass ||
			element instanceof PsiVariable ||
			element instanceof PsiMethod ||
			element instanceof PsiPackage ||
			element instanceof PsiLabeledStatement ||
			ThrowSearchUtil.isSearchable(element) ||
			element instanceof PsiMetaOwner && ((PsiMetaOwner) element).getMetaData() != null;
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:18,代碼來源:JavaFindUsagesProvider.java

示例6: getHelpId

import com.intellij.psi.impl.search.ThrowSearchUtil; //導入方法依賴的package包/類
@Override
public String getHelpId(@NotNull PsiElement element)
{
	if(element instanceof PsiPackage)
	{
		return HelpID.FIND_PACKAGE_USAGES;
	}
	if(element instanceof PsiClass)
	{
		return HelpID.FIND_CLASS_USAGES;
	}
	if(element instanceof PsiMethod)
	{
		return HelpID.FIND_METHOD_USAGES;
	}
	if(ThrowSearchUtil.isSearchable(element))
	{
		return HelpID.FIND_THROW_USAGES;
	}
	return HelpID.FIND_OTHER_USAGES;
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:22,代碼來源:JavaFindUsagesProvider.java

示例7: canFindUsagesFor

import com.intellij.psi.impl.search.ThrowSearchUtil; //導入方法依賴的package包/類
@Override
public boolean canFindUsagesFor(@NotNull PsiElement element) {
  if (element instanceof PsiDirectory) {
    PsiPackage psiPackage = JavaDirectoryService.getInstance().getPackage((PsiDirectory)element);
    return psiPackage != null && psiPackage.getQualifiedName().length() != 0;
  }

  return element instanceof PsiClass ||
         element instanceof PsiVariable ||
         element instanceof PsiMethod ||
         element instanceof PsiPackage ||
         element instanceof PsiLabeledStatement ||
         ThrowSearchUtil.isSearchable(element) ||
         element instanceof PsiMetaOwner && ((PsiMetaOwner)element).getMetaData() != null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:16,代碼來源:JavaFindUsagesProvider.java

示例8: getFindUsagesDialog

import com.intellij.psi.impl.search.ThrowSearchUtil; //導入方法依賴的package包/類
@Override
@NotNull
public AbstractFindUsagesDialog getFindUsagesDialog(boolean isSingleFile,
		boolean toShowInNewTab,
		boolean mustOpenInNewTab)
{
	PsiElement element = getPsiElement();
	if(element instanceof PsiPackage)
	{
		return new FindPackageUsagesDialog(element, getProject(), myFactory.getFindPackageOptions(),
				toShowInNewTab, mustOpenInNewTab, isSingleFile, this);
	}
	if(element instanceof PsiClass)
	{
		return new FindClassUsagesDialog(element, getProject(), myFactory.getFindClassOptions(), toShowInNewTab,
				mustOpenInNewTab, isSingleFile, this);
	}
	if(element instanceof PsiMethod)
	{
		return new FindMethodUsagesDialog(element, getProject(), myFactory.getFindMethodOptions(), toShowInNewTab,
				mustOpenInNewTab, isSingleFile, this);
	}
	if(element instanceof PsiVariable)
	{
		return new FindVariableUsagesDialog(element, getProject(), myFactory.getFindVariableOptions(),
				toShowInNewTab, mustOpenInNewTab, isSingleFile, this);
	}
	if(ThrowSearchUtil.isSearchable(element))
	{
		return new FindThrowUsagesDialog(element, getProject(), myFactory.getFindThrowOptions(), toShowInNewTab,
				mustOpenInNewTab, isSingleFile, this);
	}
	return super.getFindUsagesDialog(isSingleFile, toShowInNewTab, mustOpenInNewTab);
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:35,代碼來源:JavaFindUsagesHandler.java

示例9: getFindUsagesOptions

import com.intellij.psi.impl.search.ThrowSearchUtil; //導入方法依賴的package包/類
@Override
@NotNull
public FindUsagesOptions getFindUsagesOptions(@Nullable final DataContext dataContext)
{
	PsiElement element = getPsiElement();
	if(element instanceof PsiPackage)
	{
		return myFactory.getFindPackageOptions();
	}
	if(element instanceof PsiClass)
	{
		return myFactory.getFindClassOptions();
	}
	if(element instanceof PsiMethod)
	{
		return myFactory.getFindMethodOptions();
	}
	if(element instanceof PsiVariable)
	{
		return myFactory.getFindVariableOptions();
	}
	if(ThrowSearchUtil.isSearchable(element))
	{
		return myFactory.getFindThrowOptions();
	}
	return super.getFindUsagesOptions(dataContext);
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:28,代碼來源:JavaFindUsagesHandler.java

示例10: getType

import com.intellij.psi.impl.search.ThrowSearchUtil; //導入方法依賴的package包/類
@Override
@NotNull
public String getType(@NotNull PsiElement element) {
  if (element instanceof PsiDirectory) {
    return LangBundle.message("terms.directory");
  }
  if (element instanceof PsiFile) {
    return LangBundle.message("terms.file");
  }
  if (ThrowSearchUtil.isSearchable(element)) {
    return LangBundle.message("java.terms.exception");
  }
  if (element instanceof PsiPackage) {
    return LangBundle.message("java.terms.package");
  }
  if (element instanceof PsiLabeledStatement) {
    return LangBundle.message("java.terms.label");
  }
  if (element instanceof PsiClass) {
    if (((PsiClass)element).isAnnotationType()) {
      return LangBundle.message("java.terms.annotation.interface");
    }
    if (((PsiClass)element).isEnum()) {
      return LangBundle.message("java.terms.enum");
    }
    if (((PsiClass)element).isInterface()) {
      return LangBundle.message("java.terms.interface");
    }
    if (element instanceof PsiTypeParameter) {
      return LangBundle.message("java.terms.type.parameter");
    }
    return LangBundle.message("java.terms.class");
  }
  if (element instanceof PsiField) {
    return LangBundle.message("java.terms.field");
  }
  if (element instanceof PsiParameter) {
    return LangBundle.message("java.terms.parameter");
  }
  if (element instanceof PsiLocalVariable) {
    return LangBundle.message("java.terms.variable");
  }
  if (element instanceof PsiMethod) {
    final PsiMethod psiMethod = (PsiMethod)element;
    final boolean isConstructor = psiMethod.isConstructor();
    if (isConstructor) {
      return LangBundle.message("java.terms.constructor");
    }
    return LangBundle.message("java.terms.method");
  }
  if (element instanceof PsiExpression) {
    return LangBundle.message("java.terms.expression");
  }

  final String name = TypePresentationService.getService().getTypePresentableName(element.getClass());
  if (name != null) {
    return name;
  }
  return "";
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:61,代碼來源:JavaFindUsagesProvider.java

示例11: getType

import com.intellij.psi.impl.search.ThrowSearchUtil; //導入方法依賴的package包/類
@Override
@NotNull
public String getType(@NotNull PsiElement element)
{
	if(element instanceof PsiDirectory)
	{
		return LangBundle.message("terms.directory");
	}
	if(element instanceof PsiFile)
	{
		return LangBundle.message("terms.file");
	}
	if(ThrowSearchUtil.isSearchable(element))
	{
		return LangBundle.message("java.terms.exception");
	}
	if(element instanceof PsiPackage)
	{
		return LangBundle.message("java.terms.package");
	}
	if(element instanceof PsiLabeledStatement)
	{
		return LangBundle.message("java.terms.label");
	}
	if(element instanceof PsiClass)
	{
		if(((PsiClass) element).isAnnotationType())
		{
			return LangBundle.message("java.terms.annotation.interface");
		}
		if(((PsiClass) element).isEnum())
		{
			return LangBundle.message("java.terms.enum");
		}
		if(((PsiClass) element).isInterface())
		{
			return LangBundle.message("java.terms.interface");
		}
		if(element instanceof PsiTypeParameter)
		{
			return LangBundle.message("java.terms.type.parameter");
		}
		return LangBundle.message("java.terms.class");
	}
	if(element instanceof PsiField)
	{
		return LangBundle.message("java.terms.field");
	}
	if(element instanceof PsiParameter)
	{
		return LangBundle.message("java.terms.parameter");
	}
	if(element instanceof PsiLocalVariable)
	{
		return LangBundle.message("java.terms.variable");
	}
	if(element instanceof PsiMethod)
	{
		final PsiMethod psiMethod = (PsiMethod) element;
		final boolean isConstructor = psiMethod.isConstructor();
		if(isConstructor)
		{
			return LangBundle.message("java.terms.constructor");
		}
		return LangBundle.message("java.terms.method");
	}
	if(element instanceof PsiExpression)
	{
		return LangBundle.message("java.terms.expression");
	}

	final String name = TypePresentationService.getInstance().getTypePresentableName(element.getClass());
	if(name != null)
	{
		return name;
	}
	return "";
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:79,代碼來源:JavaFindUsagesProvider.java


注:本文中的com.intellij.psi.impl.search.ThrowSearchUtil.isSearchable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。