package jetbrains.mps.ide.devkit.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.model.SNode; import jetbrains.mps.ide.actions.MPSCommonDataKeys; 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 ShowNodeInExplorer_Action extends BaseAction { private static final Icon ICON = null; public ShowNodeInExplorer_Action() { super("Show Node in Explorer", "", 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; } { SNode p = event.getData(MPSCommonDataKeys.NODE); if (p == null) { return false; } } { Project p = event.getData(CommonDataKeys.PROJECT); if (p == null) { return false; } } return true; } @Override public void doExecute(@NotNull final AnActionEvent event, final Map<String, Object> _params) { NodeExplorer_Tool tool = event.getData(CommonDataKeys.PROJECT).getComponent(ProjectPluginManager.class).getTool(NodeExplorer_Tool.class); tool.showNode(event.getData(MPSCommonDataKeys.NODE)); tool.openToolLater(true); } }