• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java UpdatePsiFileCopyright类的典型用法和代码示例

java 1次浏览

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

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

示例1: createInstance

点赞 2

import com.maddyhome.idea.copyright.psi.UpdatePsiFileCopyright; //导入依赖的package包/类
@NotNull
@Override
public UpdatePsiFileCopyright<CopyrightFileConfig> createInstance(@NotNull final PsiFile file, @NotNull CopyrightProfile copyrightProfile)
{
	return new UpdatePsiFileCopyright<CopyrightFileConfig>(file, copyrightProfile)
	{
		@Override
		protected void scanFile()
		{
			checkComments(file.getFirstChild(), null, true);
		}
	};
}
 

开发者ID:consulo,
项目名称:consulo-csharp,
代码行数:14,
代码来源:CSharpUpdateCopyrightsProvider.java

示例2: preprocessFile

点赞 2

import com.maddyhome.idea.copyright.psi.UpdatePsiFileCopyright; //导入依赖的package包/类
protected Runnable preprocessFile(final PsiFile file, final boolean allowReplacement) throws IncorrectOperationException
{
    VirtualFile vfile = file.getVirtualFile();
    if (vfile == null) return EmptyRunnable.getInstance();
    final ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
    if (progressIndicator != null) {
        progressIndicator.setText2(vfile.getPresentableUrl());
    }
    Module mod = module;
    if (module == null)
    {
        mod = ProjectRootManager.getInstance(project).getFileIndex().getModuleForFile(vfile);
    }

    if (mod == null) return EmptyRunnable.getInstance();

    CopyrightProfile opts = CopyrightManager.getInstance(project).getCopyrightOptions(file);

    if (opts != null && FileTypeUtil.isSupportedFile(file))
    {
        logger.debug("process " + file);
        final UpdateCopyright update = UpdateCopyrightFactory.createUpdateCopyright(project, mod, file, opts);
        if (update == null) return EmptyRunnable.getInstance();
        update.prepare();

        if (update instanceof UpdatePsiFileCopyright && !((UpdatePsiFileCopyright)update).hasUpdates()) return EmptyRunnable.getInstance();

        return new Runnable() {
            public void run()
            {
                try
                {
                  if (update instanceof UpdatePsiFileCopyright) {
                    ((UpdatePsiFileCopyright)update).complete(allowReplacement);
                  } else {
                    update.complete();
                  }
                }
                catch (Exception e)
                {
                    logger.error(e);
                }
            }
        };
    }
    else
    {
        return EmptyRunnable.getInstance();
    }
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:51,
代码来源:UpdateCopyrightProcessor.java

示例3: createInstance

点赞 2

import com.maddyhome.idea.copyright.psi.UpdatePsiFileCopyright; //导入依赖的package包/类
@NotNull
@Override
public UpdatePsiFileCopyright<CopyrightFileConfig> createInstance(@NotNull PsiFile file, @NotNull CopyrightProfile copyrightProfile)
{
	return new UpdateLuaFileCopyright(file, copyrightProfile);
}
 

开发者ID:consulo,
项目名称:consulo-lua,
代码行数:7,
代码来源:UpdateLuaCopyrightsProvider.java

示例4: preprocessFile

点赞 2

import com.maddyhome.idea.copyright.psi.UpdatePsiFileCopyright; //导入依赖的package包/类
@Override
protected Runnable preprocessFile(final PsiFile file) throws IncorrectOperationException {
  VirtualFile vfile = file.getVirtualFile();
  if (vfile == null) {
    return EmptyRunnable.getInstance();
  }
  final ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
  if (progressIndicator != null) {
    progressIndicator.setText2(vfile.getPresentableUrl());
  }
  Module mod = module;
  if (module == null) {
    mod = ProjectRootManager.getInstance(project).getFileIndex().getModuleForFile(vfile);
  }

  if (mod == null) {
    return EmptyRunnable.getInstance();
  }

  UpdateCopyrightsProvider updateCopyrightsProvider = CopyrightUpdaters.INSTANCE.forFileType(file.getFileType());
  if(updateCopyrightsProvider == null) {
    return EmptyRunnable.getInstance();
  }

  CopyrightProfile copyrightProfile = CopyrightManager.getInstance(project).getCopyrightOptions(file);
  if (copyrightProfile != null && CopyrightUpdaters.hasExtension(file)) {
    logger.debug("process " + file);
    final UpdatePsiFileCopyright<?> updateCopyright = updateCopyrightsProvider.createInstance(file, copyrightProfile);

    return new Runnable() {
      @Override
      public void run() {
        try {
          updateCopyright.process();

        }
        catch (Exception e) {
          logger.error(e);
        }
      }
    };
  }
  else {
    return EmptyRunnable.getInstance();
  }
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:47,
代码来源:UpdateCopyrightProcessor.java

示例5: createInstance

点赞 2

import com.maddyhome.idea.copyright.psi.UpdatePsiFileCopyright; //导入依赖的package包/类
@NotNull
@Override
public UpdatePsiFileCopyright<CopyrightFileConfig> createInstance(@NotNull PsiFile file, @NotNull CopyrightProfile copyrightProfile)
{
	return new UpdateJavaScriptFileCopyright(file, copyrightProfile);
}
 

开发者ID:consulo,
项目名称:consulo-javascript,
代码行数:7,
代码来源:UpdateJavaScriptFileCopyrightProvider.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)