本文整理汇总了Java中com.intellij.codeInsight.daemon.ImplicitUsageProvider.isImplicitUsage方法的典型用法代码示例。如果您正苦于以下问题:Java ImplicitUsageProvider.isImplicitUsage方法的具体用法?Java ImplicitUsageProvider.isImplicitUsage怎么用?Java ImplicitUsageProvider.isImplicitUsage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.codeInsight.daemon.ImplicitUsageProvider
的用法示例。
在下文中一共展示了ImplicitUsageProvider.isImplicitUsage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isImplicitUsage
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
public static boolean isImplicitUsage(@NotNull Project project,
@NotNull PsiModifierListOwner element,
@NotNull ProgressIndicator progress)
{
if(isInjected(project, element))
{
return true;
}
for(ImplicitUsageProvider provider : ourImplicitUsageProviders)
{
progress.checkCanceled();
if(provider.isImplicitUsage(element))
{
return true;
}
}
return false;
}
示例2: isEntryPoint
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
public boolean isEntryPoint(@NotNull PsiElement element) {
final Project project = element.getProject();
final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);
if (element instanceof PsiMethod && isAddMainsEnabled() && PsiClassImplUtil.isMainOrPremainMethod((PsiMethod)element)) {
return true;
}
if (element instanceof PsiClass) {
PsiClass aClass = (PsiClass)element;
final PsiClass applet = psiFacade.findClass("java.applet.Applet", GlobalSearchScope.allScope(project));
if (isAddAppletEnabled() && applet != null && aClass.isInheritor(applet, true)) {
return true;
}
final PsiClass servlet = psiFacade.findClass("javax.servlet.Servlet", GlobalSearchScope.allScope(project));
if (isAddServletEnabled() && servlet != null && aClass.isInheritor(servlet, true)) {
return true;
}
if (isAddMainsEnabled() && PsiMethodUtil.hasMainMethod(aClass)) return true;
}
if (element instanceof PsiModifierListOwner) {
final EntryPointsManager entryPointsManager = EntryPointsManager.getInstance(project);
if (entryPointsManager.isEntryPoint(element)) return true;
}
for (EntryPoint extension : myExtensions) {
if (extension.isEntryPoint(element)) {
return true;
}
}
final ImplicitUsageProvider[] implicitUsageProviders = Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
for (ImplicitUsageProvider provider : implicitUsageProviders) {
if (provider.isImplicitUsage(element)) return true;
}
return false;
}
示例3: isImplicitUsage
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
public static boolean isImplicitUsage(@NotNull Project project,
@NotNull PsiModifierListOwner element,
@NotNull ProgressIndicator progress) {
if (isInjected(project, element)) return true;
for (ImplicitUsageProvider provider : ourImplicitUsageProviders) {
progress.checkCanceled();
if (provider.isImplicitUsage(element)) {
return true;
}
}
return false;
}
示例4: isImplicitUsage
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
public static boolean isImplicitUsage(PsiElement element) {
final ImplicitUsageProvider[] implicitUsageProviders = Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
for (ImplicitUsageProvider provider : implicitUsageProviders) {
if (provider.isImplicitUsage(element)) return true;
}
return false;
}
示例5: isImplicitUsage
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
public static boolean isImplicitUsage(final PsiModifierListOwner element, ProgressIndicator progress) {
if (UnusedSymbolLocalInspection.isInjected(element)) return true;
for (ImplicitUsageProvider provider : ourImplicitUsageProviders) {
progress.checkCanceled();
if (provider.isImplicitUsage(element)) {
return true;
}
}
return false;
}
示例6: isEntryPoint
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
public boolean isEntryPoint(@NotNull PsiElement element) {
final Project project = element.getProject();
final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);
if (element instanceof PsiMethod && isAddMainsEnabled() && PsiClassImplUtil.isMainOrPremainMethod((PsiMethod)element)) {
return true;
}
if (element instanceof PsiClass) {
PsiClass aClass = (PsiClass)element;
/*
if (aClass.isAnnotationType()) {
return true;
}
if (aClass.isEnum()) {
return true;
}
*/
final PsiClass applet = psiFacade.findClass("java.applet.Applet", GlobalSearchScope.allScope(project));
if (isAddAppletEnabled() && applet != null && aClass.isInheritor(applet, true)) {
return true;
}
final PsiClass servlet = psiFacade.findClass("javax.servlet.Servlet", GlobalSearchScope.allScope(project));
if (isAddServletEnabled() && servlet != null && aClass.isInheritor(servlet, true)) {
return true;
}
if (isAddMainsEnabled() && PsiMethodUtil.hasMainMethod(aClass)) return true;
}
if (element instanceof PsiModifierListOwner) {
final EntryPointsManager entryPointsManager = EntryPointsManager.getInstance(project);
if (entryPointsManager.isEntryPoint((PsiModifierListOwner)element)) return true;
//if (AnnotationUtil
// .checkAnnotatedUsingPatterns((PsiModifierListOwner)element, entryPointsManager.ADDITIONAL_ANNOTATIONS) ||
// AnnotationUtil
// .checkAnnotatedUsingPatterns((PsiModifierListOwner)element, entryPointsManager.getAdditionalAnnotations())) {
// return true;
//}
}
for (EntryPoint extension : myExtensions) {
if (extension.isEntryPoint(element)) {
return true;
}
}
final ImplicitUsageProvider[] implicitUsageProviders = Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
for (ImplicitUsageProvider provider : implicitUsageProviders) {
if (provider.isImplicitUsage(element)) return true;
}
return false;
}
示例7: isEntryPoint
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
public boolean isEntryPoint(@NotNull PsiElement element)
{
final Project project = element.getProject();
final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);
if(element instanceof PsiMethod && isAddMainsEnabled() && PsiClassImplUtil.isMainOrPremainMethod((PsiMethod)
element))
{
return true;
}
if(element instanceof PsiClass)
{
PsiClass aClass = (PsiClass) element;
final PsiClass applet = psiFacade.findClass("java.applet.Applet", GlobalSearchScope.allScope(project));
if(isAddAppletEnabled() && applet != null && aClass.isInheritor(applet, true))
{
return true;
}
final PsiClass servlet = psiFacade.findClass("javax.servlet.Servlet", GlobalSearchScope.allScope(project));
if(isAddServletEnabled() && servlet != null && aClass.isInheritor(servlet, true))
{
return true;
}
if(isAddMainsEnabled() && PsiMethodUtil.hasMainMethod(aClass))
{
return true;
}
}
if(element instanceof PsiModifierListOwner)
{
final EntryPointsManager entryPointsManager = EntryPointsManager.getInstance(project);
if(entryPointsManager.isEntryPoint(element))
{
return true;
}
}
for(EntryPoint extension : myExtensions)
{
if(extension.isEntryPoint(element))
{
return true;
}
}
final ImplicitUsageProvider[] implicitUsageProviders = Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
for(ImplicitUsageProvider provider : implicitUsageProviders)
{
if(provider.isImplicitUsage(element))
{
return true;
}
}
return false;
}