IDEA-188241 Hide AS icons for not Android projects

This commit is contained in:
Dmitry Avdeev
2018-03-20 18:31:53 +03:00
parent 6e3c1f5adb
commit 911a6d8643
2 changed files with 9 additions and 1 deletions
@@ -17,6 +17,7 @@
package com.intellij.execution;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.annotations.NonNls;
@@ -92,6 +93,13 @@ public abstract class Executor {
return getStartActionText() + (StringUtil.isEmpty(configurationName) ? "" : " '" + shortenNameIfNeed(configurationName) + "'");
}
/**
* Return false to suppress action visibility for given project.
*/
public boolean isApplicable(@NotNull Project project) {
return true;
}
/**
* Too long names don't fit into UI controls and have to be trimmed
*/
@@ -249,7 +249,7 @@ public class ExecutorRegistryImpl extends ExecutorRegistry implements Disposable
presentation.setEnabledAndVisible(enabled);
}
else {
presentation.setVisible(true);
presentation.setVisible(myExecutor.isApplicable(project));
presentation.setEnabled(enabled);
}
presentation.setText(text);