mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't show "update copyright" action in context menu if there are no copyright profiles configured (IDEA-81700)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 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.
|
||||
@@ -228,6 +228,10 @@ public class CopyrightManager extends AbstractProjectComponent implements JDOMEx
|
||||
return myCopyrights.values();
|
||||
}
|
||||
|
||||
public boolean hasAnyCopyrights() {
|
||||
return myDefaultCopyright != null || !myModule2Copyrights.isEmpty();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public CopyrightProfile getCopyrightOptions(@NotNull PsiFile file) {
|
||||
final VirtualFile virtualFile = file.getVirtualFile();
|
||||
|
||||
+5
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 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.
|
||||
@@ -23,6 +23,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.PsiUtilCore;
|
||||
import com.maddyhome.idea.copyright.CopyrightManager;
|
||||
import com.maddyhome.idea.copyright.pattern.FileUtil;
|
||||
import com.maddyhome.idea.copyright.util.FileTypeUtil;
|
||||
|
||||
@@ -45,6 +46,9 @@ public class UpdateCopyrightAction extends AnAction {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!CopyrightManager.getInstance(project).hasAnyCopyrights()) {
|
||||
return false;
|
||||
}
|
||||
final VirtualFile[] files = PlatformDataKeys.VIRTUAL_FILE_ARRAY.getData(context);
|
||||
final Editor editor = PlatformDataKeys.EDITOR.getData(context);
|
||||
if (editor != null) {
|
||||
|
||||
Reference in New Issue
Block a user