当前位置: 首页>>代码示例>>Java>>正文


Java SearchInBackgroundOption类代码示例

本文整理汇总了Java中com.intellij.find.SearchInBackgroundOption的典型用法代码示例。如果您正苦于以下问题:Java SearchInBackgroundOption类的具体用法?Java SearchInBackgroundOption怎么用?Java SearchInBackgroundOption使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SearchInBackgroundOption类属于com.intellij.find包,在下文中一共展示了SearchInBackgroundOption类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doSearchAndShow

import com.intellij.find.SearchInBackgroundOption; //导入依赖的package包/类
private UsageView doSearchAndShow(@NotNull final UsageTarget[] searchFor,
                                  @NotNull final Factory<UsageSearcher> searcherFactory,
                                  @NotNull final UsageViewPresentation presentation,
                                  @NotNull final FindUsagesProcessPresentation processPresentation,
                                  @Nullable final UsageViewStateListener listener) {
  final SearchScope searchScopeToWarnOfFallingOutOf = getMaxSearchScopeToWarnOfFallingOutOf(searchFor);
  final AtomicReference<UsageViewImpl> usageViewRef = new AtomicReference<UsageViewImpl>();

  Task.Backgroundable task = new Task.Backgroundable(myProject, getProgressTitle(presentation), true, new SearchInBackgroundOption()) {
    @Override
    public void run(@NotNull final ProgressIndicator indicator) {
      new SearchForUsagesRunnable(UsageViewManagerImpl.this, UsageViewManagerImpl.this.myProject, usageViewRef, presentation, searchFor, searcherFactory,
                                  processPresentation, searchScopeToWarnOfFallingOutOf, listener).run();
    }

    @Override
    @Nullable
    public NotificationInfo getNotificationInfo() {
      String notification = usageViewRef.get() != null ? usageViewRef.get().getUsagesCount() + " Usage(s) Found" : "No Usages Found";
      return new NotificationInfo("Find Usages", "Find Usages Finished", notification);
    }
  };
  ProgressManager.getInstance().run(task);
  return usageViewRef.get();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:UsageViewManagerImpl.java

示例2: searchAndShowUsages

import com.intellij.find.SearchInBackgroundOption; //导入依赖的package包/类
@Override
public UsageView searchAndShowUsages(@NotNull final UsageTarget[] searchFor,
                                     @NotNull final Factory<UsageSearcher> searcherFactory,
                                     final boolean showPanelIfOnlyOneUsage,
                                     final boolean showNotFoundMessage,
                                     @NotNull final UsageViewPresentation presentation,
                                     @Nullable final UsageViewStateListener listener) {
  final AtomicReference<UsageViewImpl> usageView = new AtomicReference<UsageViewImpl>();

  final FindUsagesProcessPresentation processPresentation = new FindUsagesProcessPresentation();
  processPresentation.setShowNotFoundMessage(showNotFoundMessage);
  processPresentation.setShowPanelIfOnlyOneUsage(showPanelIfOnlyOneUsage);

  Task.Backgroundable task = new Task.Backgroundable(myProject, getProgressTitle(presentation), true, new SearchInBackgroundOption()) {
    @Override
    public void run(@NotNull final ProgressIndicator indicator) {
      new SearchForUsagesRunnable(UsageViewManagerImpl.this.myProject, usageView, presentation, searchFor, searcherFactory,
                                  processPresentation, listener).run();
    }

    @Override
    public DumbModeAction getDumbModeAction() {
      return DumbModeAction.CANCEL;
    }

    @Override
    @Nullable
    public NotificationInfo getNotificationInfo() {
      String notification = usageView.get() != null ? usageView.get().getUsagesCount() + " Usage(s) Found" : "No Usages Found";
      return new NotificationInfo("Find Usages", "Find Usages Finished", notification);
    }
  };
  ProgressManager.getInstance().run(task);
  return usageView.get();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:36,代码来源:UsageViewManagerImpl.java

示例3: doSearchAndShow

import com.intellij.find.SearchInBackgroundOption; //导入依赖的package包/类
private UsageView doSearchAndShow(@Nonnull final UsageTarget[] searchFor,
                                  @Nonnull final Factory<UsageSearcher> searcherFactory,
                                  @Nonnull final UsageViewPresentation presentation,
                                  @Nonnull final FindUsagesProcessPresentation processPresentation,
                                  @javax.annotation.Nullable final UsageViewStateListener listener) {
  final SearchScope searchScopeToWarnOfFallingOutOf = getMaxSearchScopeToWarnOfFallingOutOf(searchFor);
  final AtomicReference<UsageViewImpl> usageViewRef = new AtomicReference<>();
  long start = System.currentTimeMillis();
  Task.Backgroundable task = new Task.Backgroundable(myProject, getProgressTitle(presentation), true, new SearchInBackgroundOption()) {
    @Override
    public void run(@Nonnull final ProgressIndicator indicator) {
      new SearchForUsagesRunnable(UsageViewManagerImpl.this, UsageViewManagerImpl.this.myProject, usageViewRef, presentation, searchFor, searcherFactory, processPresentation,
                                  searchScopeToWarnOfFallingOutOf, listener).run();
    }

    @Nonnull
    @Override
    public NotificationInfo getNotificationInfo() {
      UsageViewImpl usageView = usageViewRef.get();
      int count = usageView == null ? 0 : usageView.getUsagesCount();
      String notification = StringUtil.capitalizeWords(UsageViewBundle.message("usages.n", count), true);
      LOG.debug(notification + " in " + (System.currentTimeMillis() - start) + "ms.");
      return new NotificationInfo("Find Usages", "Find Usages Finished", notification);
    }
  };
  ProgressManager.getInstance().run(task);
  return usageViewRef.get();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:29,代码来源:UsageViewManagerImpl.java


注:本文中的com.intellij.find.SearchInBackgroundOption类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。