package jetbrains.mps.ide.editor.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 jetbrains.mps.nodeEditor.EditorComponent; import jetbrains.mps.ide.editor.MPSEditorDataKeys; import jetbrains.mps.internal.collections.runtime.MapSequence; import org.jetbrains.annotations.NotNull; public class Find_Action extends BaseAction { private static final Icon ICON = null; public Find_Action() { super("Find...", "Find a string in active editor", ICON); this.setIsAlwaysVisible(true); this.setExecuteOutsideCommand(true); this.setMnemonic("F".charAt(0)); } @Override public boolean isDumbAware() { return true; } @Override protected boolean collectActionData(AnActionEvent event, final Map<String, Object> _params) { if (!(super.collectActionData(event, _params))) { return false; } { EditorComponent editorComponent = event.getData(MPSEditorDataKeys.EDITOR_COMPONENT); if (editorComponent != null && editorComponent.isInvalid()) { editorComponent = null; } MapSequence.fromMap(_params).put("editorComponent", editorComponent); if (editorComponent == null) { return false; } } return true; } @Override public void doExecute(@NotNull final AnActionEvent event, final Map<String, Object> _params) { ((EditorComponent) MapSequence.fromMap(_params).get("editorComponent")).getSearchPanel().activate(); } }