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


Java ProgressManager.getProgressIndicator方法代码示例

本文整理汇总了Java中com.intellij.openapi.progress.ProgressManager.getProgressIndicator方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressManager.getProgressIndicator方法的具体用法?Java ProgressManager.getProgressIndicator怎么用?Java ProgressManager.getProgressIndicator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.progress.ProgressManager的用法示例。


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

示例1: getProgressIndicator

import com.intellij.openapi.progress.ProgressManager; //导入方法依赖的package包/类
@Override
@Nullable
protected ProgressIndicator getProgressIndicator() {
  // could be called before full initialization
  ProgressManager progressManager = (ProgressManager)getPicoContainer().getComponentInstance(ProgressManager.class.getName());
  return progressManager == null ? null : progressManager.getProgressIndicator();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ApplicationImpl.java

示例2: isOnlyAccessedFromInnerClass

import com.intellij.openapi.progress.ProgressManager; //导入方法依赖的package包/类
public boolean isOnlyAccessedFromInnerClass() {
  final PsiSearchHelper searchHelper = PsiSearchHelper.SERVICE.getInstance(method.getProject());
  final ProgressManager progressManager = ProgressManager.getInstance();
  final ProgressIndicator progressIndicator = progressManager.getProgressIndicator();
  final PsiSearchHelper.SearchCostResult searchCost =
    searchHelper.isCheapEnoughToSearch(method.getName(), method.getResolveScope(), null, progressIndicator);
  if (searchCost == PsiSearchHelper.SearchCostResult.TOO_MANY_OCCURRENCES ||
      searchCost == PsiSearchHelper.SearchCostResult.ZERO_OCCURRENCES) {
    return onlyAccessedFromInnerClass;
  }
  final Query<PsiReference> query = ReferencesSearch.search(method);
  query.forEach(this);
  return onlyAccessedFromInnerClass;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:MethodOnlyUsedFromInnerClassInspection.java

示例3: checkCancelled

import com.intellij.openapi.progress.ProgressManager; //导入方法依赖的package包/类
@Override
public void checkCancelled() throws SVNCancelException {
  final ProgressManager pm = ProgressManager.getInstance();
  final ProgressIndicator pi = pm.getProgressIndicator();
  if (pi != null) {
    if (pi.isCanceled()) throw new SVNCancelException();
  }
  ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
  if (indicator != null && indicator.isCanceled()) {
    throw new SVNCancelException();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:PrimitivePool.java

示例4: rollbackModifiedWithoutEditing

import com.intellij.openapi.progress.ProgressManager; //导入方法依赖的package包/类
private static void rollbackModifiedWithoutEditing(final Project project, final LinkedHashSet<VirtualFile> modifiedWithoutEditing) {
  final String operationName = StringUtil.decapitalize(UIUtil.removeMnemonic(RollbackUtil.getRollbackOperationName(project)));
  String message = (modifiedWithoutEditing.size() == 1)
                   ? VcsBundle.message("rollback.modified.without.editing.confirm.single",
                                       operationName, modifiedWithoutEditing.iterator().next().getPresentableUrl())
                   : VcsBundle.message("rollback.modified.without.editing.confirm.multiple",
                                       operationName, modifiedWithoutEditing.size());
  int rc = showYesNoDialog(project, message, VcsBundle.message("changes.action.rollback.title", operationName), getQuestionIcon());
  if (rc != Messages.YES) {
    return;
  }
  final List<VcsException> exceptions = new ArrayList<VcsException>();

  final ProgressManager progressManager = ProgressManager.getInstance();
  final Runnable action = new Runnable() {
    public void run() {
      final ProgressIndicator indicator = progressManager.getProgressIndicator();
      try {
        ChangesUtil.processVirtualFilesByVcs(project, modifiedWithoutEditing, new ChangesUtil.PerVcsProcessor<VirtualFile>() {
          public void process(final AbstractVcs vcs, final List<VirtualFile> items) {
            final RollbackEnvironment rollbackEnvironment = vcs.getRollbackEnvironment();
            if (rollbackEnvironment != null) {
              if (indicator != null) {
                indicator.setText(vcs.getDisplayName() +
                                  ": performing " + UIUtil.removeMnemonic(rollbackEnvironment.getRollbackOperationName()).toLowerCase() + "...");
                indicator.setIndeterminate(false);
              }
              rollbackEnvironment
                .rollbackModifiedWithoutCheckout(items, exceptions, new RollbackProgressModifier(items.size(), indicator));
              if (indicator != null) {
                indicator.setText2("");
              }
            }
          }
        });
      }
      catch (ProcessCanceledException e) {
        // for files refresh  
      }
      if (!exceptions.isEmpty()) {
        AbstractVcsHelper.getInstance(project).showErrors(exceptions, VcsBundle.message("rollback.modified.without.checkout.error.tab",
                                                                                        operationName));
      }

      VfsUtil.markDirty(true, false, VfsUtilCore.toVirtualFileArray(modifiedWithoutEditing));

      VirtualFileManager.getInstance().asyncRefresh(new Runnable() {
        public void run() {
          for (VirtualFile virtualFile : modifiedWithoutEditing) {
            VcsDirtyScopeManager.getInstance(project).fileDirty(virtualFile);
          }
        }
      });
    }
  };
  progressManager.runProcessWithProgressSynchronously(action, operationName, true, project);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:58,代码来源:RollbackAction.java

示例5: fillCompletionVariants

import com.intellij.openapi.progress.ProgressManager; //导入方法依赖的package包/类
@Override
public void fillCompletionVariants(@NotNull final CompletionParameters parameters, @NotNull CompletionResultSet result) {
  PsiFile file = parameters.getOriginalFile();
  final TextFieldWithAutoCompletionListProvider<T> provider = file.getUserData(KEY);

  if (provider == null || (DumbService.isDumb(file.getProject()) && !DumbService.isDumbAware(provider))) {
    return;
  }
  String adv = provider.getAdvertisement();
  if (adv == null) {
    final String shortcut = getActionShortcut(IdeActions.ACTION_QUICK_JAVADOC);
    if (shortcut != null) {
      adv = provider.getQuickDocHotKeyAdvertisement(shortcut);
    }
  }
  if (adv != null) {
    result.addLookupAdvertisement(adv);
  }

  final String prefix = provider.getPrefix(parameters);
  if (prefix == null) {
    return;
  }
  if (parameters.getInvocationCount() == 0 && !file.getUserData(AUTO_POPUP_KEY)) {   // is autopopup
    return;
  }
  final PrefixMatcher prefixMatcher = provider.createPrefixMatcher(prefix);
  if (prefixMatcher != null) {
    result = result.withPrefixMatcher(prefixMatcher);
  }

  Collection<T> items = provider.getItems(prefix, true, parameters);
  addCompletionElements(result, provider, items, -10000);

  final ProgressManager progressManager = ProgressManager.getInstance();
  ProgressIndicator mainIndicator = progressManager.getProgressIndicator();
  final ProgressIndicator indicator = mainIndicator != null ? new SensitiveProgressWrapper(mainIndicator) : new EmptyProgressIndicator();
  Future<Collection<T>>
    future =
    ApplicationManager.getApplication().executeOnPooledThread(new Callable<Collection<T>>() {
      @Override
      public Collection<T> call() {
        return progressManager.runProcess(new Computable<Collection<T>>() {
          @Override
          public Collection<T> compute() {
            return provider.getItems(prefix, false, parameters);
          }
        }, indicator);
      }
    });

  while (true) {
    try {
      Collection<T> tasks = future.get(100, TimeUnit.MILLISECONDS);
      if (tasks != null) {
        addCompletionElements(result, provider, tasks, 0);
        return;
      }
    }
    catch (ProcessCanceledException e) {
      throw e;
    }
    catch (Exception ignore) {

    }
    ProgressManager.checkCanceled();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:69,代码来源:TextFieldWithAutoCompletionContributor.java


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