Hidden "Delete" action and renamed "Edit" to "View" when external annotation is read-only.
This commit is contained in:
@@ -38,6 +38,9 @@ public class DeleteSignatureAction extends AnAction {
|
||||
public DeleteSignatureAction(@NotNull PsiMethod elementInEditor) {
|
||||
super("Delete");
|
||||
this.annotationOwner = getAnnotationOwner(elementInEditor);
|
||||
boolean editable = ExternalAnnotationsManager.getInstance(annotationOwner.getProject())
|
||||
.isExternalAnnotationWritable(annotationOwner, KOTLIN_SIGNATURE_ANNOTATION);
|
||||
getTemplatePresentation().setVisible(editable);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -41,8 +41,10 @@ public class EditSignatureAction extends AnAction {
|
||||
private final PsiMethod elementInEditor;
|
||||
|
||||
public EditSignatureAction(@NotNull PsiMethod elementInEditor) {
|
||||
super("Edit");
|
||||
this.elementInEditor = elementInEditor;
|
||||
boolean editable = ExternalAnnotationsManager.getInstance(elementInEditor.getProject())
|
||||
.isExternalAnnotationWritable(getAnnotationOwner(elementInEditor), KOTLIN_SIGNATURE_ANNOTATION);
|
||||
getTemplatePresentation().setText(editable ? "Edit" : "View");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user