當前位置: 首頁>>代碼示例>>Java>>正文


Java Disposable.dispose方法代碼示例

本文整理匯總了Java中com.intellij.openapi.Disposable.dispose方法的典型用法代碼示例。如果您正苦於以下問題:Java Disposable.dispose方法的具體用法?Java Disposable.dispose怎麽用?Java Disposable.dispose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.Disposable的用法示例。


在下文中一共展示了Disposable.dispose方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: flushCaches

import com.intellij.openapi.Disposable; //導入方法依賴的package包/類
public synchronized void flushCaches() {
  for (Disposable disposable : myCacheDisposables) {
    try {
      disposable.dispose();
    }
    catch (Throwable e) {
      LOG.info(e);
    }
  }
  myCacheDisposables.clear();
  myGenericCachesMap.clear();
  myCompilerToCacheMap.clear();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:CompilerCacheManager.java

示例2: execute

import com.intellij.openapi.Disposable; //導入方法依賴的package包/類
@Override
public void execute(@NotNull final Disposable each) {
  each.dispose();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:Disposer.java

示例3: doPostponedFormattingInner

import com.intellij.openapi.Disposable; //導入方法依賴的package包/類
private void doPostponedFormattingInner(@NotNull FileViewProvider key) {
  final List<ASTNode> astNodes = getContext().myReformatElements.remove(key);
  final Document document = key.getDocument();
  // Sort ranges by end offsets so that we won't need any offset adjustment after reformat or reindent
  if (document == null) return;

  final VirtualFile virtualFile = key.getVirtualFile();
  if (!virtualFile.isValid()) return;

  PsiManager manager = key.getManager();
  if (manager instanceof PsiManagerEx) {
    FileManager fileManager = ((PsiManagerEx)manager).getFileManager();
    FileViewProvider viewProvider = fileManager.findCachedViewProvider(virtualFile);
    if (viewProvider != key) { // viewProvider was invalidated e.g. due to language level change
      if (viewProvider == null) viewProvider = fileManager.findViewProvider(virtualFile);
      if (viewProvider != null) {
        key = viewProvider;
      }
    }
  }

  final TreeSet<PostprocessFormattingTask> postProcessTasks = new TreeSet<PostprocessFormattingTask>();
  Collection<Disposable> toDispose = ContainerUtilRt.newArrayList();
  try {
    // process all roots in viewProvider to find marked for reformat before elements and create appropriate range markers
    handleReformatMarkers(key, postProcessTasks);
    toDispose.addAll(postProcessTasks);

    // then we create ranges by changed nodes. One per node. There ranges can intersect. Ranges are sorted by end offset.
    if (astNodes != null) createActionsMap(astNodes, key, postProcessTasks);

    if (Boolean.getBoolean("check.psi.is.valid") && ApplicationManager.getApplication().isUnitTestMode()) {
      checkPsiIsCorrect(key);
    }

    while (!postProcessTasks.isEmpty()) {
      // now we have to normalize actions so that they not intersect and ordered in most appropriate way
      // (free reformatting -> reindent -> formatting under reindent)
      final List<PostponedAction> normalizedActions = normalizeAndReorderPostponedActions(postProcessTasks, document);
      toDispose.addAll(normalizedActions);

      // only in following loop real changes in document are made
      for (final PostponedAction normalizedAction : normalizedActions) {
        CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(myPsiManager.getProject());
        boolean old = settings.ENABLE_JAVADOC_FORMATTING;
        settings.ENABLE_JAVADOC_FORMATTING = false;
        try {
          normalizedAction.execute(key);
        }
        finally {
          settings.ENABLE_JAVADOC_FORMATTING = old;
        }
      }
    }
  }
  finally {
    for (Disposable disposable : toDispose) {
      //noinspection SSBasedInspection
      disposable.dispose();
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:63,代碼來源:PostprocessReformattingAspect.java


注:本文中的com.intellij.openapi.Disposable.dispose方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。