package jetbrains.mps.ide.actions; /*Generated by MPS */ import jetbrains.mps.workbench.action.BaseAction; import javax.swing.Icon; import com.intellij.icons.AllIcons; import com.intellij.openapi.actionSystem.AnActionEvent; import java.util.Map; import org.jetbrains.mps.openapi.module.SModule; import jetbrains.mps.internal.collections.runtime.MapSequence; import com.intellij.openapi.project.Project; import com.intellij.openapi.actionSystem.CommonDataKeys; import org.jetbrains.annotations.NotNull; import jetbrains.mps.plugins.projectplugins.ProjectPluginManager; public class AnalyzeModuleDependencies_Action extends BaseAction { private static final Icon ICON = AllIcons.Toolwindows.ToolWindowModuleDependencies; public AnalyzeModuleDependencies_Action() { super("Analyze Module Dependencies", "", ICON); this.setIsAlwaysVisible(false); this.setExecuteOutsideCommand(true); } @Override public boolean isDumbAware() { return true; } @Override protected boolean collectActionData(AnActionEvent event, final Map<String, Object> _params) { if (!(super.collectActionData(event, _params))) { return false; } { SModule p = event.getData(MPSCommonDataKeys.MODULE); MapSequence.fromMap(_params).put("module", p); if (p == null) { return false; } } { Project p = event.getData(CommonDataKeys.PROJECT); MapSequence.fromMap(_params).put("project", p); if (p == null) { return false; } } return true; } @Override public void doExecute(@NotNull final AnActionEvent event, final Map<String, Object> _params) { ModuleDependenies_Tool tool = ((Project) MapSequence.fromMap(_params).get("project")).getComponent(ProjectPluginManager.class).getTool(ModuleDependenies_Tool.class); tool.setModules(((SModule) MapSequence.fromMap(_params).get("module"))); tool.openToolLater(true); } }