package jetbrains.mps.ide.java.workbench.actions;
/*Generated by MPS */
import jetbrains.mps.workbench.action.BaseAction;
import javax.swing.Icon;
import com.intellij.openapi.actionSystem.AnActionEvent;
import java.util.Map;
import org.jetbrains.mps.openapi.module.SModule;
import jetbrains.mps.ide.actions.MPSCommonDataKeys;
import jetbrains.mps.internal.collections.runtime.MapSequence;
import jetbrains.mps.project.MPSProject;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.ide.classpath.ClassPathViewerTool;
public class AnalyzeClasspath_Action extends BaseAction {
private static final Icon ICON = null;
public AnalyzeClasspath_Action() {
super("Analyze Classpath", "", ICON);
this.setIsAlwaysVisible(true);
this.setExecuteOutsideCommand(false);
}
@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;
}
}
{
MPSProject p = event.getData(MPSCommonDataKeys.MPS_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) {
ClassPathViewerTool tool = ((MPSProject) MapSequence.fromMap(_params).get("project")).getComponent(ClassPathViewerTool.class);
tool.openToolLater(true);
tool.analyzeModule(((SModule) MapSequence.fromMap(_params).get("module")));
}
}