mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
copyright: provide per type default options (IDEA-58899)
This commit is contained in:
@@ -23,6 +23,13 @@
|
||||
</component>
|
||||
</project-components>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij.copyright">
|
||||
<updater filetype="XML" implementationClass="com.maddyhome.idea.copyright.psi.UpdateXmlCopyrightsProvider"/>
|
||||
<updater filetype="HTML" implementationClass="com.maddyhome.idea.copyright.psi.UpdateXmlCopyrightsProvider"/>
|
||||
<updater filetype="JSPX" implementationClass="com.maddyhome.idea.copyright.psi.UpdateJspxFileCopyright$UpdateJspxCopyrightsProvider"/>
|
||||
<updater filetype="JSP" implementationClass="com.maddyhome.idea.copyright.psi.UpdateJspFileCopyright$UpdateJspCopyrightsProvider"/>
|
||||
<updater filetype="JAVA" implementationClass="com.maddyhome.idea.copyright.psi.UpdateJavaFileCopyright$UpdateJavaCopyrightsProvider"/>
|
||||
</extensions>
|
||||
<extensionPoints>
|
||||
<extensionPoint name="updater" beanClass="com.intellij.openapi.fileTypes.FileTypeExtensionPoint"/>
|
||||
</extensionPoints>
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
package com.maddyhome.idea.copyright;
|
||||
|
||||
import com.intellij.openapi.fileTypes.FileTypeExtension;
|
||||
import com.maddyhome.idea.copyright.psi.UpdateCopyrightInstanceFactory;
|
||||
import com.maddyhome.idea.copyright.psi.UpdateCopyrightsProvider;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class CopyrightUpdaters extends FileTypeExtension<UpdateCopyrightInstanceFactory> {
|
||||
public class CopyrightUpdaters extends FileTypeExtension<UpdateCopyrightsProvider> {
|
||||
public static CopyrightUpdaters INSTANCE = new CopyrightUpdaters();
|
||||
|
||||
private CopyrightUpdaters() {
|
||||
|
||||
@@ -17,10 +17,13 @@
|
||||
package com.maddyhome.idea.copyright.options;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.JDOMExternalizable;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.maddyhome.idea.copyright.CopyrightUpdaters;
|
||||
import com.maddyhome.idea.copyright.psi.UpdateCopyrightsProvider;
|
||||
import com.maddyhome.idea.copyright.util.FileTypeUtil;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -40,6 +43,11 @@ public class Options implements JDOMExternalizable, Cloneable
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -51,27 +51,7 @@ public class UpdateCopyrightFactory
|
||||
logger.debug("file=" + file);
|
||||
logger.debug("type=" + type.getName());
|
||||
|
||||
if (type.equals(StdFileTypes.JAVA))
|
||||
{
|
||||
return new UpdateJavaFileCopyright(project, module, file, options);
|
||||
}
|
||||
else if (type.equals(StdFileTypes.XML))
|
||||
{
|
||||
return new UpdateXmlFileCopyright(project, module, file, options);
|
||||
}
|
||||
else if (type.equals(StdFileTypes.HTML))
|
||||
{
|
||||
return new UpdateXmlFileCopyright(project, module, file, options);
|
||||
}
|
||||
else if (type.equals(StdFileTypes.JSP))
|
||||
{
|
||||
return new UpdateJspFileCopyright(project, module, file, options);
|
||||
}
|
||||
else if (type.equals(StdFileTypes.JSPX))
|
||||
{
|
||||
return new UpdateJspxFileCopyright(project, module, file, options);
|
||||
}
|
||||
else if (type.equals(StdFileTypes.PROPERTIES))
|
||||
if (type.equals(StdFileTypes.PROPERTIES))
|
||||
{
|
||||
return new UpdatePropertiesFileCopyright(project, module, file, options);
|
||||
}
|
||||
|
||||
+14
-3
@@ -20,11 +20,22 @@ import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.maddyhome.idea.copyright.CopyrightProfile;
|
||||
import com.maddyhome.idea.copyright.options.LanguageOptions;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public interface UpdateCopyrightInstanceFactory {
|
||||
UpdateCopyright createInstance(Project project, Module module, VirtualFile file,
|
||||
FileType base, CopyrightProfile options);
|
||||
public abstract class UpdateCopyrightsProvider {
|
||||
public abstract UpdateCopyright createInstance(Project project, Module module, VirtualFile file,
|
||||
FileType base, CopyrightProfile options);
|
||||
|
||||
public LanguageOptions getDefaultOptions() {
|
||||
return new LanguageOptions();
|
||||
}
|
||||
|
||||
protected static LanguageOptions createDefaultOptions(boolean prefix) {
|
||||
final LanguageOptions languageOptions = new LanguageOptions();
|
||||
languageOptions.setPrefixLines(prefix);
|
||||
return languageOptions;
|
||||
}
|
||||
}
|
||||
@@ -17,12 +17,14 @@
|
||||
package com.maddyhome.idea.copyright.psi;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.maddyhome.idea.copyright.CopyrightProfile;
|
||||
import com.maddyhome.idea.copyright.options.JavaOptions;
|
||||
import com.maddyhome.idea.copyright.options.LanguageOptions;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -106,4 +108,12 @@ public class UpdateJavaFileCopyright extends UpdatePsiFileCopyright
|
||||
}
|
||||
|
||||
private static final Logger logger = Logger.getInstance(UpdateJavaFileCopyright.class.getName());
|
||||
|
||||
public static class UpdateJavaCopyrightsProvider extends UpdateCopyrightsProvider {
|
||||
|
||||
@Override
|
||||
public UpdateCopyright createInstance(Project project, Module module, VirtualFile file, FileType base, CopyrightProfile options) {
|
||||
return new UpdateJavaFileCopyright(project, module, file, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.maddyhome.idea.copyright.psi;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -26,6 +27,7 @@ import com.intellij.psi.impl.source.jsp.jspXml.JspDirective;
|
||||
import com.intellij.psi.jsp.JspFile;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.maddyhome.idea.copyright.CopyrightProfile;
|
||||
import com.maddyhome.idea.copyright.options.LanguageOptions;
|
||||
import com.maddyhome.idea.copyright.options.XmlOptions;
|
||||
|
||||
public class UpdateJspFileCopyright extends UpdatePsiFileCopyright
|
||||
@@ -182,4 +184,16 @@ public class UpdateJspFileCopyright extends UpdatePsiFileCopyright
|
||||
}
|
||||
|
||||
private static final Logger logger = Logger.getInstance(UpdateJspFileCopyright.class.getName());
|
||||
public static class UpdateJspCopyrightsProvider extends UpdateCopyrightsProvider {
|
||||
|
||||
@Override
|
||||
public UpdateCopyright createInstance(Project project, Module module, VirtualFile file, FileType base, CopyrightProfile options) {
|
||||
return new UpdateJspFileCopyright(project, module, file, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LanguageOptions getDefaultOptions() {
|
||||
return createDefaultOptions(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.maddyhome.idea.copyright.psi;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -27,6 +28,7 @@ import com.intellij.psi.xml.XmlDocument;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
import com.intellij.psi.xml.XmlProlog;
|
||||
import com.maddyhome.idea.copyright.CopyrightProfile;
|
||||
import com.maddyhome.idea.copyright.options.LanguageOptions;
|
||||
import com.maddyhome.idea.copyright.options.XmlOptions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -77,4 +79,17 @@ public class UpdateJspxFileCopyright extends UpdateJspFileCopyright {
|
||||
}
|
||||
|
||||
private static final Logger logger = Logger.getInstance(UpdateJspxFileCopyright.class.getName());
|
||||
|
||||
public static class UpdateJspxCopyrightsProvider extends UpdateCopyrightsProvider {
|
||||
|
||||
@Override
|
||||
public UpdateCopyright createInstance(Project project, Module module, VirtualFile file, FileType base, CopyrightProfile options) {
|
||||
return new UpdateJspxFileCopyright(project, module, file, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LanguageOptions getDefaultOptions() {
|
||||
return createDefaultOptions(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+182
@@ -0,0 +1,182 @@
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.maddyhome.idea.copyright.psi;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.maddyhome.idea.copyright.CopyrightProfile;
|
||||
import com.maddyhome.idea.copyright.options.LanguageOptions;
|
||||
import com.maddyhome.idea.copyright.options.XmlOptions;
|
||||
|
||||
/**
|
||||
* User: anna
|
||||
* Date: 10/27/10
|
||||
*/
|
||||
public class UpdateXmlCopyrightsProvider extends UpdateCopyrightsProvider {
|
||||
@Override
|
||||
public UpdateCopyright createInstance(Project project, Module module, VirtualFile file, FileType base, CopyrightProfile options) {
|
||||
return new UpdateXmlFileCopyright(project, module, file, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LanguageOptions getDefaultOptions() {
|
||||
return createDefaultOptions(false);
|
||||
}
|
||||
|
||||
private static class UpdateXmlFileCopyright extends UpdatePsiFileCopyright
|
||||
{
|
||||
public UpdateXmlFileCopyright(Project project, Module module, VirtualFile root, CopyrightProfile options)
|
||||
{
|
||||
super(project, module, root, options);
|
||||
}
|
||||
|
||||
protected boolean accept()
|
||||
{
|
||||
return getFile() instanceof XmlFile;
|
||||
}
|
||||
|
||||
protected void scanFile()
|
||||
{
|
||||
logger.debug("updating " + getFile().getVirtualFile());
|
||||
|
||||
|
||||
XmlDoctype doctype = null;
|
||||
PsiElement root = null;
|
||||
|
||||
XmlDocument doc = ((XmlFile)getFile()).getDocument();
|
||||
PsiElement elem = doc.getFirstChild();
|
||||
while (elem != null)
|
||||
{
|
||||
if (elem instanceof XmlProlog)
|
||||
{
|
||||
PsiElement prolog = elem.getFirstChild();
|
||||
while (prolog != null)
|
||||
{
|
||||
if (prolog instanceof XmlDoctype)
|
||||
{
|
||||
doctype = (XmlDoctype)prolog;
|
||||
}
|
||||
|
||||
prolog = prolog.getNextSibling();
|
||||
}
|
||||
}
|
||||
else if (elem instanceof XmlTag || elem instanceof XmlElementDecl || elem instanceof XmlAttributeDecl)
|
||||
{
|
||||
root = elem;
|
||||
break;
|
||||
}
|
||||
|
||||
elem = elem.getNextSibling();
|
||||
}
|
||||
|
||||
PsiElement first = doc.getFirstChild();
|
||||
if (root == null)
|
||||
{
|
||||
root = doc.getLastChild();
|
||||
}
|
||||
|
||||
int location = getLanguageOptions().getFileLocation();
|
||||
if (doctype != null)
|
||||
{
|
||||
checkComments(first, doctype, location == XmlOptions.LOCATION_BEFORE_DOCTYPE);
|
||||
first = doctype;
|
||||
}
|
||||
else if (location == XmlOptions.LOCATION_BEFORE_DOCTYPE)
|
||||
{
|
||||
location = XmlOptions.LOCATION_BEFORE_ROOTTAG;
|
||||
}
|
||||
|
||||
if (root != null)
|
||||
{
|
||||
checkComments(first, root, location == XmlOptions.LOCATION_BEFORE_ROOTTAG);
|
||||
}
|
||||
else if (location == XmlOptions.LOCATION_BEFORE_ROOTTAG)
|
||||
{
|
||||
// If we get here we have an empty file
|
||||
checkComments(first, first, true);
|
||||
}
|
||||
}
|
||||
|
||||
protected PsiElement getPreviousSibling(PsiElement element)
|
||||
{
|
||||
if (element == null) return null;
|
||||
|
||||
PsiElement res = element.getPrevSibling();
|
||||
if (res != null)
|
||||
{
|
||||
if (res instanceof XmlProlog)
|
||||
{
|
||||
XmlProlog prolog = (XmlProlog)res;
|
||||
if (prolog.getChildren().length > 0)
|
||||
{
|
||||
res = prolog.getLastChild();
|
||||
}
|
||||
else
|
||||
{
|
||||
res = prolog.getPrevSibling();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (element.getParent() instanceof XmlProlog)
|
||||
{
|
||||
res = element.getParent().getPrevSibling();
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
protected PsiElement getNextSibling(PsiElement element)
|
||||
{
|
||||
if (element == null) return null;
|
||||
|
||||
PsiElement res = element instanceof XmlProlog ? element : element.getNextSibling();
|
||||
if (res != null)
|
||||
{
|
||||
if (res instanceof XmlProlog)
|
||||
{
|
||||
XmlProlog prolog = (XmlProlog)res;
|
||||
if (prolog.getChildren().length > 0)
|
||||
{
|
||||
res = prolog.getFirstChild();
|
||||
}
|
||||
else
|
||||
{
|
||||
res = prolog.getNextSibling();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (element.getParent() instanceof XmlProlog)
|
||||
{
|
||||
res = element.getParent().getNextSibling();
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
private static final Logger logger = Logger.getInstance(UpdateXmlFileCopyright.class.getName());
|
||||
}
|
||||
}
|
||||
@@ -1,165 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.copyright.psi;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.maddyhome.idea.copyright.CopyrightProfile;
|
||||
import com.maddyhome.idea.copyright.options.XmlOptions;
|
||||
|
||||
public class UpdateXmlFileCopyright extends UpdatePsiFileCopyright
|
||||
{
|
||||
public UpdateXmlFileCopyright(Project project, Module module, VirtualFile root, CopyrightProfile options)
|
||||
{
|
||||
super(project, module, root, options);
|
||||
}
|
||||
|
||||
protected boolean accept()
|
||||
{
|
||||
return getFile() instanceof XmlFile;
|
||||
}
|
||||
|
||||
protected void scanFile()
|
||||
{
|
||||
logger.debug("updating " + getFile().getVirtualFile());
|
||||
|
||||
|
||||
XmlDoctype doctype = null;
|
||||
PsiElement root = null;
|
||||
|
||||
XmlDocument doc = ((XmlFile)getFile()).getDocument();
|
||||
PsiElement elem = doc.getFirstChild();
|
||||
while (elem != null)
|
||||
{
|
||||
if (elem instanceof XmlProlog)
|
||||
{
|
||||
PsiElement prolog = elem.getFirstChild();
|
||||
while (prolog != null)
|
||||
{
|
||||
if (prolog instanceof XmlDoctype)
|
||||
{
|
||||
doctype = (XmlDoctype)prolog;
|
||||
}
|
||||
|
||||
prolog = prolog.getNextSibling();
|
||||
}
|
||||
}
|
||||
else if (elem instanceof XmlTag || elem instanceof XmlElementDecl || elem instanceof XmlAttributeDecl)
|
||||
{
|
||||
root = elem;
|
||||
break;
|
||||
}
|
||||
|
||||
elem = elem.getNextSibling();
|
||||
}
|
||||
|
||||
PsiElement first = doc.getFirstChild();
|
||||
if (root == null)
|
||||
{
|
||||
root = doc.getLastChild();
|
||||
}
|
||||
|
||||
int location = getLanguageOptions().getFileLocation();
|
||||
if (doctype != null)
|
||||
{
|
||||
checkComments(first, doctype, location == XmlOptions.LOCATION_BEFORE_DOCTYPE);
|
||||
first = doctype;
|
||||
}
|
||||
else if (location == XmlOptions.LOCATION_BEFORE_DOCTYPE)
|
||||
{
|
||||
location = XmlOptions.LOCATION_BEFORE_ROOTTAG;
|
||||
}
|
||||
|
||||
if (root != null)
|
||||
{
|
||||
checkComments(first, root, location == XmlOptions.LOCATION_BEFORE_ROOTTAG);
|
||||
}
|
||||
else if (location == XmlOptions.LOCATION_BEFORE_ROOTTAG)
|
||||
{
|
||||
// If we get here we have an empty file
|
||||
checkComments(first, first, true);
|
||||
}
|
||||
}
|
||||
|
||||
protected PsiElement getPreviousSibling(PsiElement element)
|
||||
{
|
||||
if (element == null) return null;
|
||||
|
||||
PsiElement res = element.getPrevSibling();
|
||||
if (res != null)
|
||||
{
|
||||
if (res instanceof XmlProlog)
|
||||
{
|
||||
XmlProlog prolog = (XmlProlog)res;
|
||||
if (prolog.getChildren().length > 0)
|
||||
{
|
||||
res = prolog.getLastChild();
|
||||
}
|
||||
else
|
||||
{
|
||||
res = prolog.getPrevSibling();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (element.getParent() instanceof XmlProlog)
|
||||
{
|
||||
res = element.getParent().getPrevSibling();
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
protected PsiElement getNextSibling(PsiElement element)
|
||||
{
|
||||
if (element == null) return null;
|
||||
|
||||
PsiElement res = element instanceof XmlProlog ? element : element.getNextSibling();
|
||||
if (res != null)
|
||||
{
|
||||
if (res instanceof XmlProlog)
|
||||
{
|
||||
XmlProlog prolog = (XmlProlog)res;
|
||||
if (prolog.getChildren().length > 0)
|
||||
{
|
||||
res = prolog.getFirstChild();
|
||||
}
|
||||
else
|
||||
{
|
||||
res = prolog.getNextSibling();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (element.getParent() instanceof XmlProlog)
|
||||
{
|
||||
res = element.getParent().getNextSibling();
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
private static final Logger logger = Logger.getInstance(UpdateXmlFileCopyright.class.getName());
|
||||
}
|
||||
@@ -428,7 +428,11 @@ public class FileTypeUtil
|
||||
}
|
||||
}
|
||||
|
||||
public static class SortByName implements Comparator<FileType>
|
||||
public FileType getFileTypeByName(String name) {
|
||||
return types.get(name);
|
||||
}
|
||||
|
||||
public static class SortByName implements Comparator<FileType>
|
||||
{
|
||||
public int compare(FileType a, FileType b)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<idea-plugin>
|
||||
<extensions defaultExtensionNs="com.intellij.copyright">
|
||||
<updater filetype="Groovy" implementationClass="org.jetbrains.plugins.groovy.copyright.UpdateGroovyCopyrightInstanceFactory"/>
|
||||
<updater filetype="Groovy" implementationClass="org.jetbrains.plugins.groovy.copyright.UpdateGroovyCopyrightsProvider"/>
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
+2
-2
@@ -27,11 +27,11 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.maddyhome.idea.copyright.CopyrightProfile;
|
||||
import com.maddyhome.idea.copyright.psi.UpdateCopyright;
|
||||
import com.maddyhome.idea.copyright.psi.UpdateCopyrightInstanceFactory;
|
||||
import com.maddyhome.idea.copyright.psi.UpdateCopyrightsProvider;
|
||||
import com.maddyhome.idea.copyright.psi.UpdateJavaFileCopyright;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyFile;
|
||||
|
||||
public class UpdateGroovyCopyrightInstanceFactory implements UpdateCopyrightInstanceFactory {
|
||||
public class UpdateGroovyCopyrightsProvider extends UpdateCopyrightsProvider {
|
||||
public UpdateCopyright createInstance(Project project, Module module, VirtualFile file, FileType base, CopyrightProfile options) {
|
||||
return new UpdateJavaFileCopyright(project, module, file, options) {
|
||||
protected boolean accept() {
|
||||
Reference in New Issue
Block a user