void () { AnAction action = ActionManager.getInstance().getAction("ShowReformatFileDialog"); DataManager manager = DataManager.getInstance(); if (manager != null) { DataContext context = manager.getDataContext(myEditor.getContentComponent()); action.actionPerformed(AnActionEvent.createFromAnAction(action, null, "", context)); } }