1818
1919package org .objectweb .asm .idea ;
2020
21- import com .intellij .openapi .actionSystem .*;
21+ import com .intellij .openapi .actionSystem .AnAction ;
22+ import com .intellij .openapi .actionSystem .AnActionEvent ;
23+ import com .intellij .openapi .actionSystem .PlatformDataKeys ;
24+ import com .intellij .openapi .actionSystem .Presentation ;
2225import com .intellij .openapi .application .Application ;
2326import com .intellij .openapi .application .ApplicationManager ;
2427import com .intellij .openapi .compiler .CompileContext ;
2528import com .intellij .openapi .compiler .CompileScope ;
2629import com .intellij .openapi .compiler .CompileStatusNotification ;
2730import com .intellij .openapi .compiler .CompilerManager ;
28- import com .intellij .openapi .editor .Editor ;
2931import com .intellij .openapi .fileEditor .FileDocumentManager ;
3032import com .intellij .openapi .module .Module ;
3133import com .intellij .openapi .module .ModuleUtil ;
@@ -59,15 +61,10 @@ public class ShowBytecodeOutlineAction extends AnAction {
5961
6062 @ Override
6163 public void update (final AnActionEvent e ) {
62- final Editor editor = e .getData (PlatformDataKeys .EDITOR );
6364 final VirtualFile virtualFile = e .getData (PlatformDataKeys .VIRTUAL_FILE );
65+ final Project project = e .getData (PlatformDataKeys .PROJECT );
6466 final Presentation presentation = e .getPresentation ();
65- if (editor == null || virtualFile == null ) {
66- presentation .setEnabled (false );
67- return ;
68- }
69- final Project project = editor .getProject ();
70- if (project == null ) {
67+ if (project == null || virtualFile == null ) {
7168 presentation .setEnabled (false );
7269 return ;
7370 }
@@ -76,10 +73,8 @@ public void update(final AnActionEvent e) {
7673 }
7774
7875 public void actionPerformed (AnActionEvent e ) {
79- final Editor editor = e .getData (PlatformDataKeys .EDITOR );
8076 final VirtualFile virtualFile = e .getData (PlatformDataKeys .VIRTUAL_FILE );
81- if (editor == null ) return ;
82- final Project project = editor .getProject ();
77+ final Project project = e .getData (PlatformDataKeys .PROJECT );
8378 if (project == null || virtualFile == null ) return ;
8479 final PsiFile psiFile = PsiManager .getInstance (project ).findFile (virtualFile );
8580 if (psiFile instanceof PsiClassOwner ) {
@@ -99,7 +94,7 @@ public void actionPerformed(AnActionEvent e) {
9994 final Application application = ApplicationManager .getApplication ();
10095 application .runWriteAction (new Runnable () {
10196 public void run () {
102- FileDocumentManager .getInstance ().saveDocument ( editor . getDocument () );
97+ FileDocumentManager .getInstance ().saveAllDocuments ( );
10398 }
10499 });
105100 application .executeOnPooledThread (new Runnable () {
0 commit comments