[R-1567] move BorderlessDialogWrapper to R plugin

GitOrigin-RevId: 8c759bf092a86d30d40fa2327e1c3581db07d94d
This commit is contained in:
Igor Slobodskov
2024-08-19 18:34:43 +02:00
committed by intellij-monorepo-bot
parent d9ebc32f7f
commit a79bd3b507

View File

@@ -1,35 +0,0 @@
/*
* Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package org.jetbrains.plugins.notebooks.visualization.r.inlays.components
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.DialogWrapper
import com.intellij.openapi.util.SystemInfo
import org.jetbrains.annotations.Nls
import javax.swing.Action
import javax.swing.JComponent
import javax.swing.border.Border
abstract class BorderlessDialogWrapper(project: Project, @Nls private val dialogTitle: String, ideModalityType: IdeModalityType) :
DialogWrapper(project, null, true, ideModalityType, false)
{
override fun init() {
super.init()
title = dialogTitle
}
override fun createActions(): Array<Action> {
return if (SystemInfo.isMac) arrayOf(cancelAction, okAction) else arrayOf(okAction, cancelAction)
}
override fun createContentPaneBorder(): Border? {
return null
}
protected fun createOkCancelPanel(): JComponent {
val buttons = createActions().map { createJButtonForAction(it) }
return createButtonsPanel(buttons)
}
}