-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from liuzhihang/develop
Develop
- Loading branch information
Showing
48 changed files
with
745 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...n/java/com/liuzhihang/doc/view/action/toolbar/window/catalog/CatalogHttpClientAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.liuzhihang.doc.view.action.toolbar.window.catalog; | ||
|
||
import com.intellij.openapi.actionSystem.AnAction; | ||
import com.intellij.openapi.actionSystem.AnActionEvent; | ||
import com.intellij.openapi.actionSystem.PlatformDataKeys; | ||
import com.intellij.openapi.project.Project; | ||
import com.intellij.ui.TreeExpandCollapse; | ||
import com.intellij.ui.treeStructure.SimpleNode; | ||
import com.intellij.ui.treeStructure.SimpleTree; | ||
import com.liuzhihang.doc.view.data.DocViewDataKeys; | ||
import com.liuzhihang.doc.view.ui.window.MethodNode; | ||
import com.liuzhihang.doc.view.utils.CustomFileUtils; | ||
|
||
/** | ||
* window 窗口目录树, 右键生成 HttpClient 功能 | ||
* | ||
* @author liuzhihang | ||
* @version CatalogHttpClientAction.java, v 0.1 2022/6/16 17:53 liuzhihang | ||
*/ | ||
public class CatalogHttpClientAction extends AnAction { | ||
|
||
@Override | ||
public void actionPerformed(AnActionEvent e) { | ||
|
||
// 获取当前project对象 | ||
Project project = e.getData(PlatformDataKeys.PROJECT); | ||
SimpleTree simpleTree = e.getData(DocViewDataKeys.WINDOW_CATALOG_TREE); | ||
|
||
if (simpleTree == null || project == null) { | ||
return; | ||
} | ||
|
||
SimpleNode selectedNode = simpleTree.getSelectedNode(); | ||
|
||
if (selectedNode instanceof MethodNode) { | ||
MethodNode methodNode = (MethodNode) selectedNode; | ||
CustomFileUtils.openHttp(project, methodNode); | ||
} else { | ||
TreeExpandCollapse.expandAll(simpleTree); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/com/liuzhihang/doc/view/constant/MethodConstant.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Ant Group | ||
* Copyright (c) 2004-2022 All Rights Reserved. | ||
*/ | ||
package com.liuzhihang.doc.view.constant; | ||
|
||
/** | ||
* 方法常量 | ||
* | ||
* @author liuzhihang | ||
* @version MethodConstant.java, v 0.1 2022年06月17日 11:55 AM zijun.lzh | ||
*/ | ||
public final class MethodConstant { | ||
|
||
public static final String GET = "GET"; | ||
public static final String POST = "POST"; | ||
public static final String PUT = "PUT"; | ||
public static final String DELETE = "DELETE"; | ||
public static final String HEAD = "HEAD"; | ||
public static final String OPTIONS = "OPTIONS"; | ||
public static final String PATCH = "PATCH"; | ||
public static final String DUBBO = "DUBBO"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.