void (ActionEvent e) { InputEvent inputEvent = e.getSource() instanceof InputEvent ? (InputEvent)e.getSource() : null; DataContext dataContext = DataManager.getInstance().getDataContext(this); myAction.actionPerformed(AnActionEvent.createFromAnAction(myAction, inputEvent, ActionPlaces.TOOLWINDOW_TITLE, dataContext)); }