/**
 * class ViewerAction
 * created Aug 27, 2001
 * @author Jeka
 */
package com.intellij.internal.psiView;

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.openapi.project.DumbAware;

public class ViewerAction extends AnAction implements DumbAware {
  public void actionPerformed(AnActionEvent e) {
    Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
    PsiViewerDialog dialog = new PsiViewerDialog(project,false);
    dialog.show();
  }
}

@@ -305,23 +305,25 @@
 project.
-Project
+DumbAware
 ;%0Aimport
@@ -352,25 +352,23 @@
 project.
-DumbAware
+Project
 ;%0A%0Apubli
@@ -640,11 +640,197 @@
 w();%0A  %7D
+%0A%0A  @Override%0A  public void update(AnActionEvent e) %7B%0A    Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());%0A    e.getPresentation().setEnabled(project != null);%0A  %7D
 %0A%7D%0A

disable action when no open project