public void update(AnActionEvent e) {
   final Presentation presentation = e.getPresentation();
   presentation.setEnabled(false);
   if (myElement != null) {
     final PsiElement element = myElement.getElement();
     final DocumentationProvider provider = DocumentationManager.getProviderFromElement(element);
     final PsiElement originalElement = DocumentationManager.getOriginalElement(element);
     if (provider instanceof ExternalDocumentationProvider) {
       presentation.setEnabled(
           element != null
               && ((ExternalDocumentationProvider) provider)
                   .hasDocumentationFor(element, originalElement));
     } else {
       final List<String> urls = provider.getUrlFor(element, originalElement);
       presentation.setEnabled(element != null && urls != null && !urls.isEmpty());
     }
   }
 }
 @Override
 public void update(AnActionEvent e) {
   Presentation presentation = e.getPresentation();
   presentation.setEnabled(!myForwardStack.isEmpty());
 }
 public void update(AnActionEvent e) {
   Presentation presentation = e.getPresentation();
   presentation.setEnabled(!myBackStack.isEmpty());
 }