Java 类com.intellij.lang.LanguageExtension 实例源码

项目:intellij-ce-playground    文件:BrowseHierarchyActionBase.java   
@Nullable
public static HierarchyProvider findBestHierarchyProvider(final LanguageExtension<HierarchyProvider> extension,
                                                          @Nullable PsiElement element,
                                                          DataContext dataContext) {
  if (element == null) return null;
  List<HierarchyProvider> providers = extension.allForLanguage(element.getLanguage());
  for (HierarchyProvider provider : providers) {
    PsiElement target = provider.getTarget(dataContext);
    if (target != null) {
      return provider;
    }
  }
  return ContainerUtil.getFirstItem(providers);
}
项目:tools-idea    文件:BrowseHierarchyActionBase.java   
@Nullable
public static HierarchyProvider findBestHierarchyProvider(final LanguageExtension<HierarchyProvider> extension,
                                                          @Nullable PsiElement element,
                                                          DataContext dataContext) {
  if (element == null) return null;
  List<HierarchyProvider> providers = extension.allForLanguage(element.getLanguage());
  for (HierarchyProvider provider : providers) {
    PsiElement target = provider.getTarget(dataContext);
    if (target != null) {
      return provider;
    }
  }
  return ContainerUtil.getFirstItem(providers);
}
项目:consulo    文件:BrowseHierarchyActionBase.java   
@Nullable
@RequiredReadAction
public static HierarchyProvider findProvider(@Nonnull LanguageExtension<HierarchyProvider> extension,
                                             @Nullable PsiElement psiElement,
                                             @Nullable PsiFile psiFile,
                                             @Nonnull DataContext dataContext) {
  final HierarchyProvider provider = findBestHierarchyProvider(extension, psiElement, dataContext);
  if (provider == null) {
    return findBestHierarchyProvider(extension, psiFile, dataContext);
  }
  return provider;
}
项目:consulo    文件:BrowseHierarchyActionBase.java   
@Nullable
@RequiredReadAction
public static HierarchyProvider findBestHierarchyProvider(final LanguageExtension<HierarchyProvider> extension,
                                                          @Nullable PsiElement element,
                                                          DataContext dataContext) {
  if (element == null) return null;
  List<HierarchyProvider> providers = extension.allForLanguage(element.getLanguage());
  for (HierarchyProvider provider : providers) {
    PsiElement target = provider.getTarget(dataContext);
    if (target != null) {
      return provider;
    }
  }
  return ContainerUtil.getFirstItem(providers);
}
项目:consulo    文件:HierarchyBrowserBaseEx.java   
BaseOnThisElementAction(@Nonnull String text,
                        @Nonnull String actionId,
                        @Nonnull Key<?> browserDataKey,
                        @Nonnull LanguageExtension<HierarchyProvider> providerLanguageExtension) {
  super(text);
  myActionId = actionId;
  myBrowserDataKey = browserDataKey;
  myProviderLanguageExtension = providerLanguageExtension;
}
项目:intellij-ce-playground    文件:GotoSuperAction.java   
@NotNull
@Override
protected LanguageExtension<CodeInsightActionHandler> getLanguageExtension() {
  return CodeInsightActions.GOTO_SUPER;
}
项目:intellij-ce-playground    文件:ImplementMethodsAction.java   
@NotNull
@Override
protected LanguageExtension<LanguageCodeInsightActionHandler> getLanguageExtension() {
  return CodeInsightActions.IMPLEMENT_METHOD;
}
项目:intellij-ce-playground    文件:OverrideMethodsAction.java   
@NotNull
@Override
protected LanguageExtension<LanguageCodeInsightActionHandler> getLanguageExtension() {
  return CodeInsightActions.OVERRIDE_METHOD;
}
项目:intellij-ce-playground    文件:PresentableActionHandlerBasedAction.java   
@NotNull
protected abstract LanguageExtension<? extends CodeInsightActionHandler> getLanguageExtension();
项目:intellij-ce-playground    文件:BrowseHierarchyActionBase.java   
protected BrowseHierarchyActionBase(final LanguageExtension<HierarchyProvider> extension) {
  myExtension = extension;
}
项目:tools-idea    文件:BrowseHierarchyActionBase.java   
protected BrowseHierarchyActionBase(final LanguageExtension<HierarchyProvider> extension) {
  myExtension = extension;
}
项目:consulo    文件:CoreApplicationEnvironment.java   
public <T> void addExplicitExtension(@Nonnull LanguageExtension<T> instance, @Nonnull Language language, @Nonnull T object) {
  doAddExplicitExtension(instance, language, object);
}
项目:consulo    文件:BrowseHierarchyActionBase.java   
protected BrowseHierarchyActionBase(@Nonnull LanguageExtension<HierarchyProvider> extension) {
  myExtension = extension;
}