idea-plugin / arrow.meta.ide.dsl.editor.action / AnActionSyntax

AnActionSyntax

interface AnActionSyntax : AnActionUtilitySyntax

AnActionExtensionProvider is in charge of the lifecycle of AnAction. AnAction can be placed, executed and composed into any workflow, throughout the whole application lifecycle. Whether on-demand by the user or as a standalone workflow. They’re able to access almost every part of the ide. In other words, AnAction contains a computation which can be evaluated multiple times at any time. When a user triggers AnAction the AnAction.actionPerformed function is executed. AnAction may have starkly different purposes, from changing CompilerConfigurations in the editor to opening UI element’s with media content. Here are a few Links to the Action System from IntelliJ’s Development Guide:

Functions

addAnAction Registers the action with actionId as its identifier. The actionId is solely used internally.open fun MetaIde.addAnAction(actionId: String, action: AnAction): ExtensionPhase
addBaseFoldingHandler registers a BaseFoldingHandleropen fun MetaIde.addBaseFoldingHandler(actionId: String, execute: (editor: Editor, caret: Caret?, ctx: DataContext?) -> Unit): ExtensionPhase
addTimerListener registers a TimerListeneropen fun MetaIde.addTimerListener(delay: Int, modalityState: ModalityState, run: () -> Unit): ExtensionPhase
addTransparentTimerListener registers a transparent TimerListeneropen fun MetaIde.addTransparentTimerListener(delay: Int, modalityState: ModalityState, run: () -> Unit): ExtensionPhase
anAction open fun AnActionSyntax.anAction(actionPerformed: (e: AnActionEvent) -> Unit, beforeActionPerformedUpdate: (e: AnActionEvent) -> Unit = Noop.effect1, update: (e: AnActionEvent) -> Unit = Noop.effect1, displayTextInToolbar: Boolean = false, setInjectedContext: (worksInInjected: Boolean) -> Boolean = { it }, useSmallerFontForTextInToolbar: Boolean = false, startInTransaction: Boolean = false, getTemplateText: String? = null): AnAction
open fun AnActionSyntax.anAction(icon: Icon, actionPerformed: (e: AnActionEvent) -> Unit, beforeActionPerformedUpdate: (e: AnActionEvent) -> Unit = Noop.effect1, update: (e: AnActionEvent) -> Unit = Noop.effect1, displayTextInToolbar: Boolean = false, setInjectedContext: (worksInInjected: Boolean) -> Boolean = { it }, useSmallerFontForTextInToolbar: Boolean = false, startInTransaction: Boolean = false, getTemplateText: String? = null): AnAction
open fun AnActionSyntax.anAction(title: String, actionPerformed: (e: AnActionEvent) -> Unit, beforeActionPerformedUpdate: (e: AnActionEvent) -> Unit = Noop.effect1, update: (e: AnActionEvent) -> Unit = Noop.effect1, displayTextInToolbar: Boolean = false, setInjectedContext: (worksInInjected: Boolean) -> Boolean = { it }, useSmallerFontForTextInToolbar: Boolean = false, startInTransaction: Boolean = false, getTemplateText: String? = null): AnAction
open fun AnActionSyntax.anAction(title: String, description: String, icon: Icon, actionPerformed: (e: AnActionEvent) -> Unit, beforeActionPerformedUpdate: (e: AnActionEvent) -> Unit = Noop.effect1, update: (e: AnActionEvent) -> Unit = Noop.effect1, displayTextInToolbar: Boolean = false, setInjectedContext: (worksInInjected: Boolean) -> Boolean = { it }, useSmallerFontForTextInToolbar: Boolean = false, startInTransaction: Boolean = false, getTemplateText: String? = null): AnAction
baseFoldingHandler open fun AnActionSyntax.baseFoldingHandler(execute: (editor: Editor, caret: Caret?, ctx: DataContext?) -> Unit): BaseFoldingHandler
editorAction open fun AnActionSyntax.editorAction(handler: EditorActionHandler): EditorAction
removeTimerListener removes a TimerListeneropen fun MetaIde.removeTimerListener(listener: TimerListener): ExtensionPhase
removeTransparentTimerListener removes a transparent TimerListeneropen fun MetaIde.removeTransparentTimerListener(listener: TimerListener): ExtensionPhase
replaceAnAction replaces AnAction with actionId to a newActionopen fun MetaIde.replaceAnAction(actionId: String, newAction: AnAction): ExtensionPhase
timerListener open fun AnActionSyntax.timerListener(modalityState: ModalityState, run: () -> Unit): TimerListener
unregisterAnAction unregisters AnActionopen fun MetaIde.unregisterAnAction(actionId: String): ExtensionPhase

Inheritors

IdeSyntax interface IdeSyntax : IconProviderSyntax, SyntaxHighlighterSyntax, InspectionSyntax, AnActionSyntax, ColorSettingsSyntax, HintingSyntax, LanguageSyntax, LineMarkerSyntax, LiveTemplateSyntax, NavigationSyntax, SearchSyntax, StructureViewSyntax, UsageSyntax, ExtensionProviderSyntax, DocumentationSyntax, DialogSyntax, PopupSyntax, NotificationSyntax, ToolWindowSyntax, GotoRelatedSyntax, AnnotatorSyntax, ParserSyntax, ApplicationSyntax, FoldingSyntax, EditorSyntax, ResolveScopeSyntax, ResolveProviderSyntax, IntegrationSyntax

Do you like Arrow?

Arrow Org
<