Action create before Application componnet?
已回答
Hi, Can anybody tell me why action lifecycle is changed in current Intellij CE?
After Intellij community 2016.1 version, I found my plugin crash due to NPE.
I debug source code, found that action registered in configuration xml is created before my application component.
current process: action create -> application component create
While in previous version, action is created after application component construction
previous process: application component create -> action create
请先登录再写评论。
Actions are preloaded now as early as possible, for the popup menus to open faster the first time.
In general, I'd suggest to not have any logic in the action constructor, and retrieve the component when it's needed, presumably in update/actionPerformed.