本文整理汇总了Java中com.intellij.codeInsight.daemon.ImplicitUsageProvider类的典型用法代码示例。如果您正苦于以下问题:Java ImplicitUsageProvider类的具体用法?Java ImplicitUsageProvider怎么用?Java ImplicitUsageProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ImplicitUsageProvider类属于com.intellij.codeInsight.daemon包,在下文中一共展示了ImplicitUsageProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAllOriginalMembers
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入依赖的package包/类
@Override
protected ClassMember[] getAllOriginalMembers(PsiClass aClass) {
PsiField[] fields = aClass.getFields();
ArrayList<ClassMember> array = new ArrayList<ClassMember>();
ImplicitUsageProvider[] implicitUsageProviders = Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
fieldLoop: for (PsiField field : fields) {
if (field.hasModifierProperty(PsiModifier.STATIC)) continue;
if (field.hasModifierProperty(PsiModifier.FINAL) && field.getInitializer() != null) continue;
for(ImplicitUsageProvider provider: implicitUsageProviders) {
if (provider.isImplicitWrite(field)) continue fieldLoop;
}
array.add(new PsiFieldMember(field));
}
return array.toArray(new ClassMember[array.size()]);
}
示例2: getAllOriginalMembers
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入依赖的package包/类
@Override
protected ClassMember[] getAllOriginalMembers(PsiClass aClass) {
PsiField[] fields = aClass.getFields();
ArrayList<ClassMember> array = new ArrayList<ClassMember>();
ImplicitUsageProvider[] implicitUsageProviders = Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
fieldLoop:
for (PsiField field : fields) {
if (field.hasModifierProperty(PsiModifier.STATIC)) {
continue;
}
if (field.hasModifierProperty(PsiModifier.FINAL) && field.getInitializer() != null) {
continue;
}
for (ImplicitUsageProvider provider : implicitUsageProviders) {
if (!(provider instanceof LombokImplicitUsageProvider) && provider.isImplicitWrite(field)) {
continue fieldLoop;
}
}
array.add(new PsiFieldMember(field));
}
return array.toArray(new ClassMember[array.size()]);
}
示例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: isUnusedImportEnabled
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入依赖的package包/类
private boolean isUnusedImportEnabled(HighlightDisplayKey unusedImportKey)
{
InspectionProfile profile = InspectionProjectProfileManager.getInstance(myProject).getInspectionProfile();
if(profile.isToolEnabled(unusedImportKey, myFile) && myFile instanceof PsiJavaFile && HighlightingLevelManager.getInstance(myProject).shouldInspect(myFile))
{
return true;
}
final ImplicitUsageProvider[] implicitUsageProviders = Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
for(ImplicitUsageProvider provider : implicitUsageProviders)
{
if(provider instanceof UnusedImportProvider && ((UnusedImportProvider) provider).isUnusedImportEnabled(myFile))
{
return true;
}
}
return false;
}
示例5: 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;
}
示例6: hasImplicitReadOrWriteUsage
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入依赖的package包/类
private static boolean hasImplicitReadOrWriteUsage(final PsiField field, ImplicitUsageProvider[] implicitUsageProviders) {
for (ImplicitUsageProvider provider : implicitUsageProviders) {
if (provider.isImplicitRead(field) || provider.isImplicitWrite(field)) {
return true;
}
}
return false;
}
示例7: 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;
}
示例8: isImplicitRead
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入依赖的package包/类
public static boolean isImplicitRead(@NotNull Project project, @NotNull PsiVariable element, @NotNull ProgressIndicator progress) {
for(ImplicitUsageProvider provider: ourImplicitUsageProviders) {
progress.checkCanceled();
if (provider.isImplicitRead(element)) {
return true;
}
}
return isInjected(project, element);
}
示例9: isImplicitWrite
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入依赖的package包/类
public static boolean isImplicitWrite(@NotNull Project project,
@NotNull PsiVariable element,
@NotNull ProgressIndicator progress) {
for(ImplicitUsageProvider provider: ourImplicitUsageProviders) {
progress.checkCanceled();
if (provider.isImplicitWrite(element)) {
return true;
}
}
return isInjected(project, element);
}
示例10: isUnusedImportEnabled
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入依赖的package包/类
private boolean isUnusedImportEnabled(HighlightDisplayKey unusedImportKey) {
InspectionProfile profile = InspectionProjectProfileManager.getInstance(myProject).getInspectionProfile();
if (profile.isToolEnabled(unusedImportKey, myFile) &&
myFile instanceof PsiJavaFile &&
HighlightingLevelManager.getInstance(myProject).shouldHighlight(myFile)) {
return true;
}
final ImplicitUsageProvider[] implicitUsageProviders = Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
for (ImplicitUsageProvider provider : implicitUsageProviders) {
if (provider instanceof UnusedImportProvider && ((UnusedImportProvider)provider).isUnusedImportEnabled(myFile)) return true;
}
return false;
}
示例11: isInitializedImplicitly
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入依赖的package包/类
private static boolean isInitializedImplicitly(PsiField field) {
field = CompletionUtil.getOriginalOrSelf(field);
for(ImplicitUsageProvider provider: ImplicitUsageProvider.EP_NAME.getExtensions()) {
if (provider.isImplicitWrite(field)) {
return true;
}
}
return false;
}
示例12: 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;
}
示例13: 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;
}
示例14: isImplicitRead
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入依赖的package包/类
private static boolean isImplicitRead(final PsiVariable element, ProgressIndicator progress) {
for(ImplicitUsageProvider provider: ourImplicitUsageProviders) {
progress.checkCanceled();
if (provider.isImplicitRead(element)) {
return true;
}
}
return UnusedSymbolLocalInspection.isInjected(element);
}
示例15: isImplicitWrite
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入依赖的package包/类
private static boolean isImplicitWrite(final PsiVariable element, ProgressIndicator progress) {
for(ImplicitUsageProvider provider: ourImplicitUsageProviders) {
progress.checkCanceled();
if (provider.isImplicitWrite(element)) {
return true;
}
}
return UnusedSymbolLocalInspection.isInjected(element);
}