diff --git a/src/main/java/io/yapix/action/AbstractAction.java b/src/main/java/io/yapix/action/AbstractAction.java index 3329bb2..65bf65a 100644 --- a/src/main/java/io/yapix/action/AbstractAction.java +++ b/src/main/java/io/yapix/action/AbstractAction.java @@ -46,13 +46,6 @@ public boolean before(AnActionEvent event, YapixConfig config) { */ public abstract void handle(AnActionEvent event, YapixConfig config, List apis); - /** - * 获取动作文本 - */ - protected String getActionText(AnActionEvent event) { - return null; - } - @Override public void actionPerformed(AnActionEvent event) { Project project = event.getData(CommonDataKeys.PROJECT); @@ -116,16 +109,6 @@ public void actionPerformed(AnActionEvent event) { handle(event, config, apis); } - @Override - public void applyTextOverride(AnActionEvent e) { - String text = this.getActionText(e); - if (text == null) { - super.applyTextOverride(e); - } else { - e.getPresentation().setText(text); - } - } - /** * 解析文档模型数据 */ diff --git a/src/main/java/io/yapix/process/curl/CopyAsCurlAction.java b/src/main/java/io/yapix/process/curl/CopyAsCurlAction.java index 6a69c44..026e2f3 100644 --- a/src/main/java/io/yapix/process/curl/CopyAsCurlAction.java +++ b/src/main/java/io/yapix/process/curl/CopyAsCurlAction.java @@ -13,12 +13,7 @@ */ public class CopyAsCurlAction extends AbstractAction { - public static final String ACTION_TEXT = "Copy as cRUL"; - - @Override - protected String getActionText(AnActionEvent event) { - return ACTION_TEXT; - } + public static final String ACTION_TEXT = "Copy as cURL"; @Override public void handle(AnActionEvent event, YapixConfig config, List apis) { @@ -30,4 +25,9 @@ public void handle(AnActionEvent event, YapixConfig config, List apis) { NotificationUtils.notifyInfo("Copy as cURL", "Copied"); } + @Override + public void applyTextOverride(AnActionEvent e) { + e.getPresentation().setText(ACTION_TEXT); + } + } diff --git a/src/main/java/io/yapix/process/eolinker/EolinkerUploadAction.java b/src/main/java/io/yapix/process/eolinker/EolinkerUploadAction.java index 23c56f6..e6d501a 100644 --- a/src/main/java/io/yapix/process/eolinker/EolinkerUploadAction.java +++ b/src/main/java/io/yapix/process/eolinker/EolinkerUploadAction.java @@ -40,11 +40,6 @@ public class EolinkerUploadAction extends AbstractAction { public static final String ACTION_TEXT = "Upload To Eolinker"; - @Override - protected String getActionText(AnActionEvent event) { - return ACTION_TEXT; - } - @Override public boolean before(AnActionEvent event, YapixConfig config) { Project project = event.getData(CommonDataKeys.PROJECT); @@ -122,4 +117,10 @@ public void run(@NotNull ProgressIndicator indicator) { }); } + + @Override + public void applyTextOverride(AnActionEvent e) { + e.getPresentation().setText(ACTION_TEXT); + } + } diff --git a/src/main/java/io/yapix/process/rap2/Rap2UploadAction.java b/src/main/java/io/yapix/process/rap2/Rap2UploadAction.java index 0574e2b..3ab68dc 100644 --- a/src/main/java/io/yapix/process/rap2/Rap2UploadAction.java +++ b/src/main/java/io/yapix/process/rap2/Rap2UploadAction.java @@ -40,11 +40,6 @@ public class Rap2UploadAction extends AbstractAction { public static final String ACTION_TEXT = "Upload To Rap2"; - @Override - protected String getActionText(AnActionEvent event) { - return ACTION_TEXT; - } - @Override public boolean before(AnActionEvent event, YapixConfig config) { Project project = event.getData(CommonDataKeys.PROJECT); @@ -120,4 +115,9 @@ public void run(@NotNull ProgressIndicator indicator) { }); } + @Override + public void applyTextOverride(AnActionEvent e) { + e.getPresentation().setText(ACTION_TEXT); + } + } diff --git a/src/main/java/io/yapix/process/yapi/YapiUploadAction.java b/src/main/java/io/yapix/process/yapi/YapiUploadAction.java index cf806fb..6bf3df5 100644 --- a/src/main/java/io/yapix/process/yapi/YapiUploadAction.java +++ b/src/main/java/io/yapix/process/yapi/YapiUploadAction.java @@ -39,11 +39,6 @@ public class YapiUploadAction extends AbstractAction { public static final String ACTION_TEXT = "Upload To YApi"; - @Override - protected String getActionText(AnActionEvent event) { - return ACTION_TEXT; - } - @Override public boolean before(AnActionEvent event, YapixConfig config) { Project project = event.getData(CommonDataKeys.PROJECT); @@ -118,4 +113,9 @@ public void run(@NotNull ProgressIndicator indicator) { } }); } + + @Override + public void applyTextOverride(AnActionEvent e) { + e.getPresentation().setText(ACTION_TEXT); + } } diff --git a/yapix.jar b/yapix.jar index 34c3505..a1c49d1 100644 Binary files a/yapix.jar and b/yapix.jar differ