From 4b18f42d0c4a3dc677815204a8bcc7810c876a7e Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 20 Sep 2016 17:24:01 +0200 Subject: [PATCH] rename "copy reference" to "copy relative path" on file nodes (IDEA-160391) --- .../src/com/intellij/ide/actions/CopyReferenceAction.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/ide/actions/CopyReferenceAction.java b/platform/lang-impl/src/com/intellij/ide/actions/CopyReferenceAction.java index 87087c424e49..bb61d30878b9 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/CopyReferenceAction.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/CopyReferenceAction.java @@ -76,6 +76,7 @@ public class CopyReferenceAction extends DumbAwareAction { public void update(AnActionEvent e) { boolean plural = false; boolean enabled; + boolean paths = false; DataContext dataContext = e.getDataContext(); Editor editor = CommonDataKeys.EDITOR.getData(dataContext); @@ -86,6 +87,7 @@ public class CopyReferenceAction extends DumbAwareAction { List elements = getElementsToCopy(editor, dataContext); enabled = !elements.isEmpty(); plural = elements.size() > 1; + paths = elements.stream().allMatch(el -> el instanceof PsiFileSystemItem && getQualifiedNameFromProviders(el) == null); } e.getPresentation().setEnabled(enabled); @@ -95,7 +97,9 @@ public class CopyReferenceAction extends DumbAwareAction { else { e.getPresentation().setVisible(true); } - e.getPresentation().setText(plural ? "Cop&y References" : "Cop&y Reference"); + e.getPresentation().setText( + paths ? plural ? "Cop&y Relative Paths" : "Cop&y Relative Path" + : plural ? "Cop&y References" : "Cop&y Reference"); } @Override