summaryrefslogtreecommitdiff
path: root/platform/lang-impl/src/com/intellij/find/editorHeaderActions/EditorHeaderAction.java
blob: 6cdba4b1e6eb5fa095a8fd5fca93f7bc1bba0c13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.intellij.find.editorHeaderActions;


import com.intellij.find.EditorSearchComponent;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.CustomShortcutSet;
import com.intellij.openapi.actionSystem.KeyboardShortcut;
import com.intellij.openapi.actionSystem.Shortcut;

import javax.swing.*;
import java.util.ArrayList;
import java.util.List;

public abstract class EditorHeaderAction extends AnAction {
  private final EditorSearchComponent myEditorSearchComponent;

  protected static void registerShortcutsForComponent(List<Shortcut> shortcuts, JComponent component, AnAction a) {
    a.registerCustomShortcutSet(
      new CustomShortcutSet(shortcuts.toArray(new Shortcut[shortcuts.size()])),
      component);
  }

  public EditorSearchComponent getEditorSearchComponent() {
    return myEditorSearchComponent;
  }

  protected EditorHeaderAction(EditorSearchComponent editorSearchComponent) {

    myEditorSearchComponent = editorSearchComponent;
  }
}