Skip to content

Commit

Permalink
Fix idea compatibility problem
Browse files Browse the repository at this point in the history
  • Loading branch information
lkqm committed Sep 6, 2021
1 parent 6d6d5f4 commit 19b00b5
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 38 deletions.
17 changes: 0 additions & 17 deletions src/main/java/io/yapix/action/AbstractAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ public boolean before(AnActionEvent event, YapixConfig config) {
*/
public abstract void handle(AnActionEvent event, YapixConfig config, List<Api> apis);

/**
* 获取动作文本
*/
protected String getActionText(AnActionEvent event) {
return null;
}

@Override
public void actionPerformed(AnActionEvent event) {
Project project = event.getData(CommonDataKeys.PROJECT);
Expand Down Expand Up @@ -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);
}
}

/**
* 解析文档模型数据
*/
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/io/yapix/process/curl/CopyAsCurlAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Api> apis) {
Expand All @@ -30,4 +25,9 @@ public void handle(AnActionEvent event, YapixConfig config, List<Api> apis) {
NotificationUtils.notifyInfo("Copy as cURL", "Copied");
}

@Override
public void applyTextOverride(AnActionEvent e) {
e.getPresentation().setText(ACTION_TEXT);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -122,4 +117,10 @@ public void run(@NotNull ProgressIndicator indicator) {
});
}


@Override
public void applyTextOverride(AnActionEvent e) {
e.getPresentation().setText(ACTION_TEXT);
}

}
10 changes: 5 additions & 5 deletions src/main/java/io/yapix/process/rap2/Rap2UploadAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -120,4 +115,9 @@ public void run(@NotNull ProgressIndicator indicator) {
});
}

@Override
public void applyTextOverride(AnActionEvent e) {
e.getPresentation().setText(ACTION_TEXT);
}

}
10 changes: 5 additions & 5 deletions src/main/java/io/yapix/process/yapi/YapiUploadAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -118,4 +113,9 @@ public void run(@NotNull ProgressIndicator indicator) {
}
});
}

@Override
public void applyTextOverride(AnActionEvent e) {
e.getPresentation().setText(ACTION_TEXT);
}
}
Binary file modified yapix.jar
Binary file not shown.

0 comments on commit 19b00b5

Please sign in to comment.