Skip to content

Instantly share code, notes, and snippets.

@matthiaswenz
Created June 18, 2015 13:33
Show Gist options
  • Save matthiaswenz/1215a63780212a4df328 to your computer and use it in GitHub Desktop.
Save matthiaswenz/1215a63780212a4df328 to your computer and use it in GitHub Desktop.
Base Action subclass for IntelliJ plugin
public class SignInAction extends AnAction {
@Override
public void actionPerformed(AnActionEvent event) {
Project project = event.getProject();
// do your sign in work...
}
@Override
public void update(AnActionEvent e) {
e.getPresentation().setEnabledAndVisible(!isAuthenticated());
}
private boolean isAuthenticated() {
// something to determine whether the user is authenticated...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment