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


Java UpdateCopyrightProcessor类代码示例

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


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

示例1: CopyrightManager

import com.maddyhome.idea.copyright.actions.UpdateCopyrightProcessor; //导入依赖的package包/类
public CopyrightManager(@NotNull Project project,
                        @NotNull final EditorFactory editorFactory,
                        @NotNull final Application application,
                        @NotNull final FileDocumentManager fileDocumentManager,
                        @NotNull final FileTypeUtil fileTypeUtil,
                        @NotNull final ProjectRootManager projectRootManager,
                        @NotNull final PsiManager psiManager,
                        @NotNull StartupManager startupManager) {
  super(project);
  if (!myProject.isDefault()) {
    final NewFileTracker newFileTracker = NewFileTracker.getInstance();
    Disposer.register(myProject, new Disposable() {
      @Override
      public void dispose() {
        newFileTracker.clear();
      }
    });
    startupManager.runWhenProjectIsInitialized(new Runnable() {
      @Override
      public void run() {
        DocumentListener listener = new DocumentAdapter() {
          @Override
          public void documentChanged(DocumentEvent e) {
            final Document document = e.getDocument();
            final VirtualFile virtualFile = fileDocumentManager.getFile(document);
            if (virtualFile == null) return;
            final Module module = projectRootManager.getFileIndex().getModuleForFile(virtualFile);
            if (module == null) return;
            if (!newFileTracker.poll(virtualFile)) return;
            if (!fileTypeUtil.isSupportedFile(virtualFile)) return;
            if (psiManager.findFile(virtualFile) == null) return;
            application.invokeLater(new Runnable() {
              @Override
              public void run() {
                if (!virtualFile.isValid()) return;
                final PsiFile file = psiManager.findFile(virtualFile);
                if (file != null && file.isWritable()) {
                  final CopyrightProfile opts = getCopyrightOptions(file);
                  if (opts != null) {
                    new UpdateCopyrightProcessor(myProject, module, file).run();
                  }
                }
              }
            }, ModalityState.NON_MODAL, myProject.getDisposed());
          }
        };
        editorFactory.getEventMulticaster().addDocumentListener(listener, myProject);
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:52,代码来源:CopyrightManager.java

示例2: CopyrightManager

import com.maddyhome.idea.copyright.actions.UpdateCopyrightProcessor; //导入依赖的package包/类
public CopyrightManager(@NotNull Project project,
                        @NotNull final EditorFactory editorFactory,
                        @NotNull final Application application,
                        @NotNull final FileDocumentManager fileDocumentManager,
                        @NotNull final FileTypeUtil fileTypeUtil,
                        @NotNull final ProjectRootManager projectRootManager,
                        @NotNull final PsiManager psiManager,
                        @NotNull StartupManager startupManager) {
  super(project);
  if (!myProject.isDefault()) {
    final NewFileTracker newFileTracker = NewFileTracker.getInstance();
    Disposer.register(myProject, newFileTracker);
    startupManager.runWhenProjectIsInitialized(new Runnable() {
      @Override
      public void run() {
        DocumentListener listener = new DocumentAdapter() {
          @Override
          public void documentChanged(DocumentEvent e) {
            final Document document = e.getDocument();
            final VirtualFile virtualFile = fileDocumentManager.getFile(document);
            if (virtualFile == null) return;
            if (!newFileTracker.poll(virtualFile)) return;
            if (!fileTypeUtil.isSupportedFile(virtualFile)) return;
            final Module module = projectRootManager.getFileIndex().getModuleForFile(virtualFile);
            if (module == null) return;
            final PsiFile file = psiManager.findFile(virtualFile);
            if (file == null) return;
            application.invokeLater(new Runnable() {
              @Override
              public void run() {
                if (myProject.isDisposed()) return;
                if (file.isValid() && file.isWritable()) {
                  final CopyrightProfile opts = getCopyrightOptions(file);
                  if (opts != null) {
                    new UpdateCopyrightProcessor(myProject, module, file).run();
                  }
                }
              }
            }, ModalityState.NON_MODAL, myProject.getDisposed());
          }
        };
        editorFactory.getEventMulticaster().addDocumentListener(listener, myProject);
      }
    });
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:47,代码来源:CopyrightManager.java

示例3: CopyrightManager

import com.maddyhome.idea.copyright.actions.UpdateCopyrightProcessor; //导入依赖的package包/类
public CopyrightManager(@Nonnull Project project,
                        @Nonnull final EditorFactory editorFactory,
                        @Nonnull final Application application,
                        @Nonnull final FileDocumentManager fileDocumentManager,
                        @Nonnull final ProjectRootManager projectRootManager,
                        @Nonnull final PsiManager psiManager,
                        @Nonnull StartupManager startupManager) {
  super(project);
  if (!myProject.isDefault()) {
    final NewFileTracker newFileTracker = NewFileTracker.getInstance();
    Disposer.register(myProject, newFileTracker::clear);
    startupManager.runWhenProjectIsInitialized(new Runnable() {
      @Override
      public void run() {
        DocumentListener listener = new DocumentAdapter() {
          @Override
          public void documentChanged(DocumentEvent e) {
            final Document document = e.getDocument();
            final VirtualFile virtualFile = fileDocumentManager.getFile(document);
            if (virtualFile == null) return;
            if (!newFileTracker.poll(virtualFile)) return;
            if (!CopyrightUpdaters.hasExtension(virtualFile)) return;
            final Module module = projectRootManager.getFileIndex().getModuleForFile(virtualFile);
            if (module == null) return;
            final PsiFile file = psiManager.findFile(virtualFile);
            if (file == null) return;
            application.invokeLater(new Runnable() {
              @Override
              public void run() {
                if (myProject.isDisposed()) return;
                if (file.isValid() && file.isWritable()) {
                  final CopyrightProfile opts = getCopyrightOptions(file);
                  if (opts != null) {
                    new UpdateCopyrightProcessor(myProject, module, file).run();
                  }
                }
              }
            }, ModalityState.NON_MODAL, myProject.getDisposed());
          }
        };
        editorFactory.getEventMulticaster().addDocumentListener(listener, myProject);
      }
    });
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:46,代码来源:CopyrightManager.java


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