• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CopyrightFileConfig类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getCopyrightOptions

import consulo.copyright.config.CopyrightFileConfig; //导入依赖的package包/类
@Nullable
public CopyrightProfile getCopyrightOptions(@Nonnull PsiFile file) {
  final VirtualFile virtualFile = file.getVirtualFile();
  if (virtualFile == null || myCopyrightFileConfigManager.getOptions(virtualFile.getFileType()).getFileTypeOverride() == CopyrightFileConfig.NO_COPYRIGHT) {
    return null;
  }
  final DependencyValidationManager validationManager = DependencyValidationManager.getInstance(myProject);
  for (String scopeName : myModule2Copyrights.keySet()) {
    final NamedScope namedScope = validationManager.getScope(scopeName);
    if (namedScope != null) {
      final PackageSet packageSet = namedScope.getValue();
      if (packageSet != null) {
        if (packageSet.contains(file, validationManager)) {
          final CopyrightProfile profile = myCopyrights.get(myModule2Copyrights.get(scopeName));
          if (profile != null) {
            return profile;
          }
        }
      }
    }
  }
  return myDefaultCopyright != null ? myDefaultCopyright : null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:CopyrightManager.java


示例2: showPreview

import consulo.copyright.config.CopyrightFileConfig; //导入依赖的package包/类
private void showPreview(CopyrightFileConfig options) {
  final String defaultCopyrightText;

  if (myNoCopyright.isSelected()) {
    defaultCopyrightText = "";
  }
  else {
    String evaluate;
    try {
      evaluate = VelocityHelper.evaluate(null, null, null, EntityUtil.decode(CopyrightProfile.DEFAULT_COPYRIGHT_NOTICE));
    }
    catch (Exception e) {
      evaluate = "";
    }
    defaultCopyrightText = FileTypeUtil.buildComment(myCommenter, myAllowSeparator, evaluate, options);
  }

  initEditor();
  WriteAction.run(() -> myDocument.setText(defaultCopyrightText));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:TemplateCommentPanel.java


示例3: createInstance

import consulo.copyright.config.CopyrightFileConfig; //导入依赖的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


示例4: createDefaultOptions

import consulo.copyright.config.CopyrightFileConfig; //导入依赖的package包/类
@NotNull
@Override
public CopyrightFileConfig createDefaultOptions()
{
	CopyrightFileConfig options = new CopyrightFileConfig();

	options.setFiller("=");
	options.setBlock(false);
	options.setPrefixLines(false);
	options.setFileTypeOverride(CopyrightFileConfig.USE_TEXT);

	return options;
}
 
开发者ID:consulo,项目名称:consulo-lua,代码行数:14,代码来源:UpdateLuaCopyrightsProvider.java


示例5: createDefaultOptions

import consulo.copyright.config.CopyrightFileConfig; //导入依赖的package包/类
@NotNull
@Override
public CopyrightFileConfig createDefaultOptions()
{
	CopyrightFileConfig copyrightFileConfig = new CopyrightFileConfig();
	copyrightFileConfig.setPrefixLines(false);
	return copyrightFileConfig;
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:9,代码来源:UpdateXmlCopyrightsProvider.java


示例6: createDefaultOptions

import consulo.copyright.config.CopyrightFileConfig; //导入依赖的package包/类
@NotNull
@Override
public CopyrightFileConfig createDefaultOptions()
{
	return new CopyrightFileConfig();
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:7,代码来源:CSharpUpdateCopyrightsProvider.java


示例7: createInstance

import consulo.copyright.config.CopyrightFileConfig; //导入依赖的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


示例8: createDefaultOptions

import consulo.copyright.config.CopyrightFileConfig; //导入依赖的package包/类
@Nonnull
@Override
public CopyrightFileConfig createDefaultOptions() {
  return new CopyrightFileConfig();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:BaseUpdateCopyrightsProvider.java


示例9: getOptions

import consulo.copyright.config.CopyrightFileConfig; //导入依赖的package包/类
public CopyrightFileConfig getOptions() {
  // If this is a fully custom comment we should really ensure there are no blank lines in the comments outside
  // of a block comment. If there are any blank lines the replacement logic will fall apart.
  final CopyrightFileConfig res = myFileType == null ? new CopyrightFileConfig() : CopyrightUpdaters.INSTANCE.forFileType(myFileType).createDefaultOptions();
  res.setBlock(rbBlockComment.isSelected());
  res.setPrefixLines(!myAllowBlock || cbPrefixLines.isSelected());
  res.setSeparateAfter(cbSeparatorAfter.isSelected());
  res.setSeparateBefore(cbSeparatorBefore.isSelected());
  try {
    Object val = Integer.parseInt(txtLengthBefore.getText());
    if (val instanceof Number) {
      res.setLenBefore(((Number)val).intValue());
    }
    val = Integer.parseInt(txtLengthAfter.getText());
    if (val instanceof Number) {
      res.setLenAfter(((Number)val).intValue());
    }
  }
  catch (NumberFormatException e) {
    //leave blank
  }
  res.setBox(cbBox.isSelected());

  String filler = txtFiller.getText();
  if (filler.length() > 0) {
    res.setFiller(filler);
  }
  else {
    res.setFiller(CopyrightFileConfig.DEFAULT_FILLER);
  }

  res.setFileTypeOverride(getOverrideChoice());
  res.setRelativeBefore(rbBefore.isSelected());
  res.setAddBlankAfter(cbAddBlank.isSelected());
  if (fileLocations != null) {
    for (int i = 0; i < fileLocations.length; i++) {
      if (fileLocations[i].isSelected()) {
        res.setFileLocation(i + 1);
      }
    }
  }

  return res;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:45,代码来源:TemplateCommentPanel.java


示例10: getOverrideChoice

import consulo.copyright.config.CopyrightFileConfig; //导入依赖的package包/类
private int getOverrideChoice() {
  return myUseDefaultSettingsRadioButton.isSelected()
         ? CopyrightFileConfig.USE_TEMPLATE
         : myNoCopyright.isSelected() ? CopyrightFileConfig.NO_COPYRIGHT : CopyrightFileConfig.USE_TEXT;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:TemplateCommentPanel.java


示例11: reset

import consulo.copyright.config.CopyrightFileConfig; //导入依赖的package包/类
@RequiredDispatchThread
@Override
public void reset() {
  final CopyrightFileConfig options = myFileType == null
                                      ? myManager.getCopyrightFileConfigManager().getTemplateOptions()
                                      : myManager.getCopyrightFileConfigManager().getOptions(myFileType);
  boolean isBlock = options.isBlock();
  if (isBlock) {
    rbBlockComment.setSelected(true);
  }
  else {
    rbLineComment.setSelected(true);
  }

  cbPrefixLines.setSelected(!myAllowBlock || options.isPrefixLines());
  cbSeparatorAfter.setSelected(options.isSeparateAfter());
  cbSeparatorBefore.setSelected(options.isSeparateBefore());
  txtLengthBefore.setText(String.valueOf(options.getLenBefore()));
  txtLengthAfter.setText(String.valueOf(options.getLenAfter()));
  txtFiller.setText(options.getFiller() == CopyrightFileConfig.DEFAULT_FILLER ? "" : options.getFiller());
  cbBox.setSelected(options.isBox());

  final int fileTypeOverride = options.getFileTypeOverride();
  myUseDefaultSettingsRadioButton.setSelected(fileTypeOverride == CopyrightFileConfig.USE_TEMPLATE);
  myUseCustomFormattingOptionsRadioButton.setSelected(fileTypeOverride == CopyrightFileConfig.USE_TEXT);
  myNoCopyright.setSelected(fileTypeOverride == CopyrightFileConfig.NO_COPYRIGHT);
  if (options.isRelativeBefore()) {
    rbBefore.setSelected(true);
  }
  else {
    rbAfter.setSelected(true);
  }
  cbAddBlank.setSelected(options.isAddBlankAfter());

  if (fileLocations != null) {
    int choice = options.getFileLocation() - 1;
    choice = Math.max(0, Math.min(choice, fileLocations.length - 1));
    fileLocations[choice].setSelected(true);
  }

  updateOverride();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:43,代码来源:TemplateCommentPanel.java


示例12: getFileConfig

import consulo.copyright.config.CopyrightFileConfig; //导入依赖的package包/类
@Nonnull
public CopyrightFileConfig getFileConfig() {
  return myFileConfig;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:UpdatePsiFileCopyright.java


示例13: getLanguageOptions

import consulo.copyright.config.CopyrightFileConfig; //导入依赖的package包/类
protected CopyrightFileConfig getLanguageOptions() {
  return myFileConfig;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:UpdatePsiFileCopyright.java


示例14: buildComment

import consulo.copyright.config.CopyrightFileConfig; //导入依赖的package包/类
@Nonnull
public static String buildComment(@Nonnull FileType type, @Nonnull String template, @Nonnull CopyrightFileConfig options) {
  Commenter commenter = getCommenter(type);
  UpdateCopyrightsProvider updateCopyrightsProvider = CopyrightUpdaters.INSTANCE.forFileType(type);
  return buildComment(commenter, updateCopyrightsProvider.isAllowSeparator(), template, options);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:7,代码来源:FileTypeUtil.java


示例15: createInstance

import consulo.copyright.config.CopyrightFileConfig; //导入依赖的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


示例16: createInstance

import consulo.copyright.config.CopyrightFileConfig; //导入依赖的package包/类
@NotNull
@Override
public UpdatePsiFileCopyright<CopyrightFileConfig> createInstance(@NotNull PsiFile file, @NotNull CopyrightProfile copyrightProfile)
{
	return new UpdateJavaFileCopyright(file, copyrightProfile);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:7,代码来源:UpdateJavaFileCopyright.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Preconditions类代码示例发布时间:2022-05-22
下一篇:
Java Edm类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap