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