-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93f2765
commit c27eca9
Showing
8 changed files
with
97 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
<ul> | ||
<li>Compatible with latest IDE</li> | ||
<li>Fixed multiple Github accounts issue</li> | ||
<li>Supported deleting gists</li> | ||
<li>Fixed minor issues</li> | ||
</ul> |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version = 1.0.1 | ||
version = 1.0.2 | ||
ideaVersion = IC-2019.1 | ||
customUtilBuild = 299.* | ||
isEAP = false | ||
|
43 changes: 43 additions & 0 deletions
43
src/main/java/com/chuntung/plugin/gistsnippet/action/ReloadAction.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 @@ | ||
/* | ||
* Copyright (c) 2020 Tony Ho. Some rights reserved. | ||
*/ | ||
|
||
package com.chuntung.plugin.gistsnippet.action; | ||
|
||
import com.chuntung.plugin.gistsnippet.dto.api.GistFileDTO; | ||
import com.intellij.openapi.actionSystem.AnAction; | ||
import com.intellij.openapi.actionSystem.AnActionEvent; | ||
import com.intellij.openapi.project.DumbAware; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import javax.swing.*; | ||
import javax.swing.tree.DefaultMutableTreeNode; | ||
import java.util.function.Consumer; | ||
|
||
/** | ||
* Reload selected gist. | ||
*/ | ||
public class ReloadAction extends AnAction implements DumbAware { | ||
private JTree tree; | ||
private Consumer consumer; | ||
|
||
public ReloadAction(JTree tree, Consumer consumer) { | ||
super("Reload", "Reload first selected gist file", null); | ||
this.tree = tree; | ||
this.consumer = consumer; | ||
} | ||
|
||
@Override | ||
public void actionPerformed(@NotNull AnActionEvent e) { | ||
consumer.accept(e); | ||
} | ||
|
||
@Override | ||
public void update(@NotNull AnActionEvent e) { | ||
// check if gist file selected | ||
DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); | ||
if (!(node.getUserObject() instanceof GistFileDTO)) { | ||
e.getPresentation().setVisible(false); | ||
} | ||
} | ||
} |
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