IntelliJ Action System ========== Action system provides an option to handle certain events in a desired way. Action can either be simply a responce to some state, or be bound to UI element and could be invoked on demand. These UI elements include main menu, context menus and toolbars. An action is technically a class, derived from the [AnAction] (https://github.com/JetBrains/intellij-community/blob/master/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnAction.java) class. To update the state of the action, the method AnAction.update() is periodically called by IDEA. The object of type [AnActionEvent] (https://github.com/JetBrains/intellij-community/blob/ff16ce78a1e0ddb6e67fd1dbc6e6a597e20d483a/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnActionEvent.java) passed to this method carries the information about the current context for the action, and in particular, the specific presentation which needs to be updated. #How create a new menu item and bidn an action to it? To register an action as a menu item, an attribute should be added to the section of the plugin configuration file [plugin.xml] (https://github.com/JetBrains/intellij-sdk/blob/master/code_samples/plugin_sample/META-INF/plugin.xml) [Link to source code] (https://github.com/JetBrains/intellij-sdk/blob/master/code_samples/plugin_sample/META-INF/plugin.xml)