本文整理汇总了Java中com.maddyhome.idea.copyright.psi.UpdateCopyrightsProvider类的典型用法代码示例。如果您正苦于以下问题:Java UpdateCopyrightsProvider类的具体用法?Java UpdateCopyrightsProvider怎么用?Java UpdateCopyrightsProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UpdateCopyrightsProvider类属于com.maddyhome.idea.copyright.psi包,在下文中一共展示了UpdateCopyrightsProvider类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getOptions
import com.maddyhome.idea.copyright.psi.UpdateCopyrightsProvider; //导入依赖的package包/类
public LanguageOptions getOptions(String name)
{
String lang = FileTypeUtil.getInstance().getFileTypeNameByName(name);
LanguageOptions res = options.get(lang);
if (res == null)
{
// NOTE: If any change is made here you need to update ConfigTabFactory and UpdateCopyrightFactory too.
final FileType fileType = FileTypeUtil.getInstance().getFileTypeByName(name);
if (fileType != null) {
final UpdateCopyrightsProvider provider = CopyrightUpdaters.INSTANCE.forFileType(fileType);
if (provider != null) return provider.getDefaultOptions();
}
res = new LanguageOptions();
}
return res;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:Options.java
示例2: buildConfigurables
import com.maddyhome.idea.copyright.psi.UpdateCopyrightsProvider; //导入依赖的package包/类
@Override
protected Configurable[] buildConfigurables() {
getOrCreateMainPanel();
FileType[] registeredFileTypes = FileTypeManager.getInstance().getRegisteredFileTypes();
List<Configurable> list = new ArrayList<>();
for (FileType fileType : registeredFileTypes) {
UpdateCopyrightsProvider updateCopyrightsProvider = CopyrightUpdaters.INSTANCE.forFileType(fileType);
if (updateCopyrightsProvider == null) {
continue;
}
list.add(updateCopyrightsProvider.createConfigurable(myProject, myPanel, fileType));
}
Collections.sort(list, (o1, o2) -> o1.getDisplayName().compareToIgnoreCase(o2.getDisplayName()));
return ContainerUtil.toArray(list, Configurable.ARRAY_FACTORY);
}
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:CopyrightFormattingConfigurable.java
示例3: getOptions
import com.maddyhome.idea.copyright.psi.UpdateCopyrightsProvider; //导入依赖的package包/类
public LanguageOptions getOptions(String name) {
String lang = FileTypeUtil.getInstance().getFileTypeNameByName(name);
LanguageOptions res = options.get(lang);
if (res == null) {
// NOTE: If any change is made here you need to update ConfigTabFactory and UpdateCopyrightFactory too.
final FileType fileType = FileTypeUtil.getInstance().getFileTypeByName(name);
if (fileType != null) {
final UpdateCopyrightsProvider provider = CopyrightUpdaters.INSTANCE.forFileType(fileType);
if (provider != null) return provider.getDefaultOptions();
}
res = new LanguageOptions();
}
return res;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:Options.java
示例4: getOptions
import com.maddyhome.idea.copyright.psi.UpdateCopyrightsProvider; //导入依赖的package包/类
@Nonnull
public CopyrightFileConfig getOptions(@Nonnull FileType type) {
LoadedOption copyrightFileConfig = myConfigs.get(type.getName());
if (copyrightFileConfig == null) {
UpdateCopyrightsProvider updateCopyrightsProvider = CopyrightUpdaters.INSTANCE.forFileType(type);
if (updateCopyrightsProvider == null) {
return CopyrightFileConfig.DEFAULT_SETTINGS_HOLDER;
}
return updateCopyrightsProvider.createDefaultOptions();
}
return copyrightFileConfig.getConfig();
}
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:CopyrightFileConfigManager.java
示例5: readExternal
import com.maddyhome.idea.copyright.psi.UpdateCopyrightsProvider; //导入依赖的package包/类
@Override
public void readExternal(Element element) throws InvalidDataException {
List<Element> langs = element.getChildren("LanguageOptions");
for (Element configElement : langs) {
String name = configElement.getAttributeValue("name");
final LoadedOption option;
if(LANG_TEMPLATE.equals(name)) {
option = new TemplateLoadedOption();
}
else {
FileType fileTypeByName = FileTypeRegistry.getInstance().findFileTypeByName(name);
if (fileTypeByName == null) {
option = new UnknownLoadedOption();
}
else {
UpdateCopyrightsProvider updateCopyrightsProvider = CopyrightUpdaters.INSTANCE.forFileType(fileTypeByName);
if(updateCopyrightsProvider == null) {
option = new UnknownLoadedOption();
}
else {
option = new ValidLoadedOption(updateCopyrightsProvider.createDefaultOptions());
}
}
}
option.read(configElement);
myConfigs.put(name, option);
}
}
开发者ID:consulo,项目名称:consulo,代码行数:33,代码来源:CopyrightFileConfigManager.java
示例6: preprocessFile
import com.maddyhome.idea.copyright.psi.UpdateCopyrightsProvider; //导入依赖的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
示例7: buildComment
import com.maddyhome.idea.copyright.psi.UpdateCopyrightsProvider; //导入依赖的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
注:本文中的com.maddyhome.idea.copyright.psi.UpdateCopyrightsProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论