Java 类com.intellij.psi.PsiDocCommentBase 实例源码

项目:intellij-ce-playground    文件:CollapseExpandDocCommentsHandler.java   
@Override
public void invoke(@NotNull Project project, @NotNull final Editor editor, @NotNull PsiFile file){
  PsiDocumentManager.getInstance(project).commitAllDocuments();

  CodeFoldingManager foldingManager = CodeFoldingManager.getInstance(project);
  foldingManager.updateFoldRegions(editor);
  final FoldRegion[] allFoldRegions = editor.getFoldingModel().getAllFoldRegions();
  Runnable processor = new Runnable() {
    @Override
    public void run() {
      for (FoldRegion region : allFoldRegions) {
        PsiElement element = EditorFoldingInfo.get(editor).getPsiElement(region);
        if (element instanceof PsiDocCommentBase) {
          region.setExpanded(myExpand);
        }
      }
    }
  };
  editor.getFoldingModel().runBatchFoldingOperation(processor);
}
项目:tools-idea    文件:CollapseExpandDocCommentsHandler.java   
@Override
public void invoke(@NotNull Project project, @NotNull final Editor editor, @NotNull PsiFile file){
  PsiDocumentManager.getInstance(project).commitAllDocuments();

  CodeFoldingManager foldingManager = CodeFoldingManager.getInstance(project);
  foldingManager.updateFoldRegions(editor);
  final FoldRegion[] allFoldRegions = editor.getFoldingModel().getAllFoldRegions();
  Runnable processor = new Runnable() {
    @Override
    public void run() {
      for (FoldRegion region : allFoldRegions) {
        PsiElement element = EditorFoldingInfo.get(editor).getPsiElement(region);
        if (element instanceof PsiDocCommentBase) {
          region.setExpanded(myExpand);
        }
      }
    }
  };
  editor.getFoldingModel().runBatchFoldingOperation(processor);
}
项目:consulo    文件:CollapseExpandDocCommentsHandler.java   
@RequiredWriteAction
@Override
public void invokeInWriteAction(@Nonnull Project project, @Nonnull final Editor editor, @Nonnull PsiFile file){
  PsiDocumentManager.getInstance(project).commitAllDocuments();

  CodeFoldingManager foldingManager = CodeFoldingManager.getInstance(project);
  foldingManager.updateFoldRegions(editor);
  final FoldRegion[] allFoldRegions = editor.getFoldingModel().getAllFoldRegions();
  Runnable processor = new Runnable() {
    @Override
    public void run() {
      for (FoldRegion region : allFoldRegions) {
        PsiElement element = EditorFoldingInfo.get(editor).getPsiElement(region);
        if (element instanceof PsiDocCommentBase) {
          region.setExpanded(myExpand);
        }
      }
    }
  };
  editor.getFoldingModel().runBatchFoldingOperation(processor);
}