idea-plugin / arrow.meta.ide.dsl.ui.dialogs / DialogSyntax

DialogSyntax

interface DialogSyntax

Dialogs are isomorphic to a function (UserInput) -> (AnAction). Therefore Dialogs have the ability to manipulate the editor environment as extensive as AnAction. Consequently, we can treat Dialogs as AnAction with a display.

Functions

addFileAction

``` kotlin:ank:playground import arrow.meta.ide.IdePlugin import arrow.meta.ide.IdeMetaPlugin import arrow.meta.ide.invoke import org.jetbrains.kotlin.idea.KotlinFileType

val IdeMetaPlugin.createFilePlugin: IdePlugin get() = “Create File Dialog” { meta( addFileAction(“ExampleAction”, “New File”, “Creates a new File”, buildDialog = { project, directory -> setTitle(“MyTitle”) addKind(“File”, KotlinFileType.INSTANCE.icon, “Kotlin File”) } ) ) }
```
open fun IdeMetaPlugin.addFileAction(actionId: String, createText: String, actionDescription: String, buildDialog: Builder.(project: Project, directory: PsiDirectory) -> Unit = Noop.effect3, postProcess: (createdElement: PsiFile, templateName: String, customProperties: MutableMap<String, String>) -> Unit = Noop.effect3, fileIcon: Icon? = KotlinFileType.INSTANCE.icon, actionName: (directory: PsiDirectory, newName: String, templateName: String) -> String = { _, _, _ -> createText }, createFileFromTemplate: (name: String, template: FileTemplate, dir: PsiDirectory) -> PsiFile? = { name, template, dir -> NewKotlinFileAction.createFileFromTemplateWithStat(name, template, dir) }, startInWriteAction: Boolean = false): ExtensionPhase | | newFileAction | open fun DialogSyntax.newFileAction(createText: String, actionDescription: String, buildDialog: Builder.(project: Project, directory: PsiDirectory) -> Unit = Noop.effect3, postProcess: (createdElement: PsiFile, templateName: String, customProperties: MutableMap<String, String>) -> Unit = Noop.effect3, fileIcon: Icon? = KotlinFileType.INSTANCE.icon, actionName: (directory: PsiDirectory, newName: String, templateName: String) -> String = { _, _, _ -> createText }, createFileFromTemplate: (name: String, template: FileTemplate, dir: PsiDirectory) -> PsiFile? = { name, template, dir -> NewKotlinFileAction.createFileFromTemplate(name, template, dir) }, startInWriteAction: Boolean = false): CreateFileFromTemplateAction |

Inheritors

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

Do you like Arrow?

Arrow Org
<