Fork channel

Create a new channel as a copy of main.

Rename channel

Rename main to:

Delete channel

Delete main? This cannot be undone.

PijulExpertRecordDialogV2.kt
/**
 * Dracon - An IntelliJ-Pijul integration.
 * Copyright 2021 JonathanxD <jhrldev@gmail.com>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
package com.github.jonathanxd.dracon.dialog

import com.github.jonathanxd.dracon.i18n.DraconBundle
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.fileTypes.FileTypeRegistry
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.DialogPanel
import com.intellij.openapi.ui.DialogWrapper
import com.intellij.openapi.ui.DialogWrapper.IdeModalityType
import com.intellij.openapi.wm.WindowManager
import com.intellij.ui.EditorTextField
import com.intellij.ui.layout.panel
import org.jetbrains.annotations.Nullable
import java.awt.Component
import java.awt.Window
import java.awt.event.ComponentAdapter
import java.awt.event.ComponentEvent
import javax.swing.JComponent
import java.awt.BorderLayout
import java.awt.Dimension

import javax.swing.JLabel

import javax.swing.JPanel


fun createPijulRecordDialog(project: Project, text: String): DialogPanel {
    val panel = panel {

    }
    val toml = FileTypeRegistry.getInstance().getFileTypeByExtension("toml")
    val editor = EditorTextField(text, project, toml)
    editor.preferredSize = Dimension(340, 460)
    panel.add(editor)

    return panel
}

class PijulExpertRecordDialogV2(val project: Project, val text: String) : DialogWrapper(project, true) {
    /*constructor(project: Project?, canBeParent: Boolean): super(project, canBeParent)
    constructor(project: Project?, canBeParent: Boolean, ideModalityType: IdeModalityType): super(project, canBeParent, ideModalityType)

    constructor(
        project: Project?,
        parentComponent: Component?,
        canBeParent: Boolean,
        ideModalityType: IdeModalityType
    ): super (project, parentComponent, canBeParent, ideModalityType, true)

    constructor(
        project: Project?,
        parentComponent: Component?,
        canBeParent: Boolean,
        ideModalityType: IdeModalityType,
        createSouth: Boolean
    ) : super(project, parentComponent, canBeParent, ideModalityType, createSouth)

    constructor(project: Project?): super(project)
    constructor(canBeParent: Boolean): super(canBeParent)
    constructor(canBeParent: Boolean, applicationModalIfPossible: Boolean): super(null, canBeParent, applicationModalIfPossible)
    constructor(project: Project?, canBeParent: Boolean, applicationModalIfPossible: Boolean): super(project, canBeParent, applicationModalIfPossible)
    constructor(parent: Component, canBeParent: Boolean): super(parent, canBeParent)*/

    init {
        init()
        title = DraconBundle.message("action.Pijul.ExpertRecord.text")
    }

    override fun createCenterPanel(): JComponent {
        val dialogPanel = JPanel(BorderLayout())

        val toml = FileTypeRegistry.getInstance().getFileTypeByExtension("toml")
        val editor = EditorTextField(this.text, this.project, toml)
        editor.preferredSize = Dimension(340, 460)
        dialogPanel.add(editor, BorderLayout.CENTER)

        return dialogPanel
    }


}