Package com.intellij.openapi.actionSystem

Examples of com.intellij.openapi.actionSystem.DataContext


  protected Jumper(AnActionEvent e, OpenType openType) throws Exception {
    VirtualFile currentFile = PlatformDataKeys.VIRTUAL_FILE.getData(e.getDataContext());
    this.psiFile = LangDataKeys.PSI_FILE.getData(e.getDataContext());
    this.project = e.getProject();
    this.editor = PlatformDataKeys.EDITOR.getData(e.getDataContext());
    DataContext dataContext = e.getDataContext();

    IdeView view = LangDataKeys.IDE_VIEW.getData(dataContext);
    if (view != null) {
      this.directory = view.getOrChooseDirectory();
    }
View Full Code Here


    private static void showSettingsFor(Project project) {
        ShowSettingsUtil.getInstance().showSettingsDialog(project, "Mongo servers");
    }

    private static Project getProject(AnActionEvent event) {
        DataContext dataContext = event.getDataContext();
        return PlatformDataKeys.PROJECT.getData(dataContext);
    }
View Full Code Here

  private ApplicationModel() {
  }

  public static Project getProject() {
    DataContext dataContext = DataManager.getInstance().getDataContext();
    return DataKeys.PROJECT.getData(dataContext);
  }
View Full Code Here

  public static void install(final JTree tree){
    tree.addKeyListener(
      new KeyAdapter() {
        public void keyPressed(KeyEvent e) {
          if (KeyEvent.VK_ENTER == e.getKeyCode()) {
            DataContext dataContext = DataManager.getInstance().getDataContext(tree);

            Project project = DataKeys.PROJECT.getData(dataContext);
            if (project == null) return;

            OpenSourceUtil.openSourcesFrom(dataContext, false);
View Full Code Here

  public static void install(final JComponent component,
                           @Nullable final Runnable whenPerformed) {
    component.registerKeyboardAction(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        DataContext dataContext = DataManager.getInstance().getDataContext(component);
        OpenSourceUtil.openSourcesFrom(dataContext, true);
        if (whenPerformed != null) whenPerformed.run();
      }
    }, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), JComponent.WHEN_FOCUSED);
  }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.actionSystem.DataContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.