Make switch code style action dumb aware

This commit is contained in:
Alexander Zolotov
2015-09-18 21:13:03 -03:00
parent e0591ad640
commit 95620fd89a
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@ package com.intellij.ide.actions;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.editor.EditorFactory;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.project.Project;
import com.intellij.psi.codeStyle.CodeStyleScheme;
import com.intellij.psi.codeStyle.CodeStyleSchemes;
@@ -52,8 +53,8 @@ public class QuickChangeCodeStyleSchemeAction extends QuickSwitchSchemeAction {
final CodeStyleScheme currentScheme,
final CodeStyleScheme scheme,
final boolean addScheme) {
group.add(new AnAction(scheme.getName(), "",
scheme == currentScheme && !manager.USE_PER_PROJECT_SETTINGS ? ourCurrentAction : ourNotCurrentAction) {
group.add(new DumbAwareAction(scheme.getName(), "",
scheme == currentScheme && !manager.USE_PER_PROJECT_SETTINGS ? ourCurrentAction : ourNotCurrentAction) {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
if (addScheme) {