package mobi.hsz.idea.gitignore.treeviewfilter.actions;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import mobi.hsz.idea.gitignore.IgnoreBundle;
import mobi.hsz.idea.gitignore.IgnoreManager;
import mobi.hsz.idea.gitignore.util.CommonDataKeys;

/**
 * Created by maxi on 03/01/17.
 */
public class ShowHideIgnoredFilesAction extends AnAction {


    public ShowHideIgnoredFilesAction() {
        super(IgnoreBundle.message("action.toggleIgnoredVisibility"), IgnoreBundle.message("action.toggleIgnoredVisibility"), null);
    }

    @Override
    public void actionPerformed(AnActionEvent e) {
        IgnoreManager ignoreManager = IgnoreManager.getInstance(e.getProject());

        final VirtualFile[] files = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY);
        for (VirtualFile f : files) {
            System.out.println(f.getName());
            System.out.println("ignored: " + ignoreManager.isFileIgnored(f));
        }
    }

    @Override
    public void update(AnActionEvent e) {
        final VirtualFile[] files = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY);
        final Project project = e.getProject();

        if (project == null || files == null || (files.length == 1 && files[0].equals(project.getBaseDir()))) {
            e.getPresentation().setVisible(false);
        }
    }
}

@@ -1085,372 +1085,6 @@
  %7D%0A%0A
-    @Override%0A    public void update(AnActionEvent e) %7B%0A        final VirtualFile%5B%5D files = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY);%0A        final Project project = e.getProject();%0A%0A        if (project == null %7C%7C files == null %7C%7C (files.length == 1 && files%5B0%5D.equals(project.getBaseDir()))) %7B%0A            e.getPresentation().setVisible(false);%0A        %7D%0A    %7D%0A
 %7D%0A

Remove unnecessary method