Skip to content

Commit

Permalink
Provide version upgrade fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
numq committed Apr 19, 2024
1 parent 38cfe94 commit bab1217
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repositories {
}

kotlin {
jvmToolchain(11)
jvmToolchain(17)
}

intellij {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginRepositoryUrl = https://github.com/numq/protobuf-blueprint-plugin
pluginVersion = 1.2.0

pluginSinceBuild = 222
pluginUntilBuild = 241
pluginUntilBuild = 241.*

platformType = IC
platformVersion = 2024.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,33 @@ import com.intellij.openapi.diagnostic.thisLogger
import com.intellij.openapi.project.Project
import com.intellij.openapi.wm.ToolWindow
import com.intellij.openapi.wm.ToolWindowFactory
import com.intellij.ui.JBColor
import com.intellij.ui.content.ContentFactory
import com.intellij.util.ui.JBUI
import com.numq.protobufblueprint.AppBundle
import com.numq.protobufblueprint.forms.RootForm
import com.numq.protobufblueprint.services.GeneratorService
import com.numq.protobufblueprint.standard.ProtobufStandard
import java.awt.Color
import java.awt.Toolkit
import java.awt.datatransfer.StringSelection
import java.awt.event.ActionListener
import java.awt.event.MouseAdapter
import java.awt.event.MouseEvent
import javax.swing.border.EmptyBorder
import javax.swing.event.DocumentEvent
import javax.swing.event.DocumentListener
import javax.swing.text.DefaultHighlighter


class GeneratorToolWindowFactory : ToolWindowFactory {

private val contentFactory = ContentFactory.SERVICE.getInstance()
private val contentFactory = ContentFactory.getInstance()

override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
val content = contentFactory
.createContent(GeneratorToolWindow(toolWindow)
.getContent(), null, false)
.createContent(
GeneratorToolWindow(toolWindow)
.getContent(), null, false
)
toolWindow.contentManager.addContent(content)
}

Expand All @@ -39,7 +41,7 @@ class GeneratorToolWindowFactory : ToolWindowFactory {
class GeneratorToolWindow(toolWindow: ToolWindow) {

private val generator = toolWindow.project.service<GeneratorService>()
private val errorHighlighter = DefaultHighlighter.DefaultHighlightPainter(Color.YELLOW)
private val errorHighlighter = DefaultHighlighter.DefaultHighlightPainter(JBColor.YELLOW)

private var inputTextAreaDocumentListener: DocumentListener? = null
private var highlightTooltipTextListener: MouseAdapter? = null
Expand All @@ -64,7 +66,7 @@ class GeneratorToolWindowFactory : ToolWindowFactory {
""".trimIndent()
}
inputTextArea.apply {
border = EmptyBorder(8, 8, 8, 8)
border = JBUI.Borders.empty(8)
inputTextAreaDocumentListener?.let(document::removeDocumentListener)
document.addDocumentListener(object : DocumentListener {
override fun changedUpdate(e: DocumentEvent?) {
Expand Down Expand Up @@ -122,7 +124,7 @@ class GeneratorToolWindowFactory : ToolWindowFactory {
}
generatedTextArea.apply {
val generatedTextPlaceholder = AppBundle.message("generatedTextPlaceholder")
border = EmptyBorder(8, 8, 8, 8)
border = JBUI.Borders.empty(8)
text = generatedTextPlaceholder
generatedTextAreaDocumentListener?.let(document::removeDocumentListener)
document.addDocumentListener(object : DocumentListener {
Expand Down

0 comments on commit bab1217

Please sign in to comment.