Accessing objects in AnAction class

已回答

Hi Team!

I'm developing a plugin that uses JBCefBrowser for displaying web components. I've some classes implemented to deal with JBCefBrowser.

Based on a keystroke in the active editor, I need to add some information to the editor and update the browser contents

I've implemented an EditorAction class (AnAction) to deal with the Active Editor and am able to add the required information to the editor. Now, I need to interact with other classes from the active editor to update the browser and perform other operations as well

The AnAction class doesn't permit me to use any existing class. The documentation says that fields cannot be used in AnAction classes.

Is there any way that can enable an anAction class interact with other classes of the application?

0

Reusable business logic can be extracted from AnAction to utility classes or to services ( https://plugins.jetbrains.com/docs/intellij/plugin-services.html ).

0

请先登录再写评论。