Eager creation of action presentation
Reports any actions that are registered in the
plugin.xml file and instantiate the
com.intellij.openapi.actionSystem.Presentation object in their constructors.
Any of the constructors of
AnAction with parameters instantiate the
Presentation object. However, instantiating the
Presentation object in constructor results in allocating resources, which may not be necessary. Instead of creating an instance of
Presentation that stores text, description, or icon, it is more efficient to utilize no-argument constructors of
AnAction and other base classes and follow the convention for setting the text, description, and icon in
plugin.xml. The IDE will load text, description, and icon only when the action is actually displayed in the UI.
The convention for setting the text, description, and icon is as follows:
idattribute for the action in the
Optionally, set the
iconattribute if an icon is needed.
Set the text and description in the associated message bundle (it could be overridden in
action.<action-id>.text=Translated Action Text
action.<action-id>.description=Translated Action Description
New in 2023.2
IntelliJ IDEA 2023.3, Qodana for JVM 2023.3
Plugin DevKit, 233.SNAPSHOT