Execute code after all plugins are loaded

Hey,

I want to access actions registered by other plugins. Which event should I look for?

Thanks

2 comments

Actions of all plugins are loaded during ActionManager initialization. If your ApplicationComponent takes ActionManager as a constructor parameter, it will be able to access actions registered by all plugins.

Note that trying to enumerate all actions registered by all plugins will cause a significant impact on the IDE startup performance.

0

It seems that ActionManager can list all registered action ids, but I can't access actual action object for all of them.
The only way I was able to access all actions is by using StartupManager:

ProjectManager.getInstance().addProjectManagerListener(new ProjectManagerAdapter() {
      @Override
      public void projectOpened(Project project) {
        StartupManager.getInstance(project).registerPostStartupActivity(new Runnable() {
          @Override
          public void run() {
            ActionManager actionManager = ActionManager.getInstance();
            //can access actions at this point
            }
          }
        });
      }
    });

0

Please sign in to leave a comment.