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