Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Befound 1645 2024.3 intellij plugin upgrade #58

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ pluginVersion = 1.0.1

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
pluginSinceBuild = 233
pluginUntilBuild = 242.*
pluginSinceBuild = 241
pluginUntilBuild = 243.*

# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
#platformVersion is RC version of 2024.3
platformType = IC
platformVersion = 2024.2.3
platformVersion = 243.21565.129

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ class ConsumeEventFunctionalStyleAction : DumbAwareAction() {

val template = TemplateSettings.getInstance().getTemplate("consumer", "backbase")

val editor = e.getRequiredData(CommonDataKeys.EDITOR)
val editor = e.getData(CommonDataKeys.EDITOR)

TemplateManager.getInstance(project).startTemplate(editor, template!!)
if (editor != null) {
TemplateManager.getInstance(project).startTemplate(editor, template!!)
}

}

override fun update(e: AnActionEvent) {
val psiFile = e.getRequiredData(CommonDataKeys.PSI_FILE)
val psiFile = e.getData(CommonDataKeys.PSI_FILE)

if (psiFile !is PsiJavaFile) e.presentation.isVisible = false
}
Expand Down
8 changes: 5 additions & 3 deletions src/main/kotlin/com/backbase/bst/actions/EmitEventAction.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ class EmitEventAction : DumbAwareAction() {

val template = TemplateSettings.getInstance().getTemplate("emitevent", "backbase")

val editor = e.getRequiredData(CommonDataKeys.EDITOR)
val editor = e.getData(CommonDataKeys.EDITOR)

TemplateManager.getInstance(project).startTemplate(editor, template!!)
if (editor != null) {
TemplateManager.getInstance(project).startTemplate(editor, template!!)
}

}

override fun update(e: AnActionEvent) {
val psiFile = e.getRequiredData(CommonDataKeys.PSI_FILE)
val psiFile = e.getData(CommonDataKeys.PSI_FILE)

if (psiFile is PsiJavaFile) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import com.intellij.util.io.URLUtil
class SearchGoldenSamplesAction : DumbAwareAction() {

override fun actionPerformed(e: AnActionEvent) {
val ediTorRequiredData = e.getRequiredData(CommonDataKeys.EDITOR)
val caretModel = ediTorRequiredData.caretModel
val selectedText = caretModel.currentCaret.selectedText
val ediTorRequiredData = e.getData(CommonDataKeys.EDITOR)
val caretModel = ediTorRequiredData?.caretModel
val selectedText = caretModel?.currentCaret?.selectedText

val gitHubQuery = "https://github.com/Backbase/golden-sample-services/search?q=%s&type=code"
val searchBy = String.format(
Expand All @@ -24,9 +24,9 @@ class SearchGoldenSamplesAction : DumbAwareAction() {
}

override fun update(e: AnActionEvent) {
val editor = e.getRequiredData(CommonDataKeys.EDITOR)
val caretModel = editor.caretModel
val selectedText = caretModel.currentCaret.selectedText
val editor = e.getData(CommonDataKeys.EDITOR)
val caretModel = editor?.caretModel
val selectedText = caretModel?.currentCaret?.selectedText
if (selectedText == null || selectedText.isEmpty()) {
e.presentation.isVisible = false
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/backbase/bst/common/JavaTools.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object JavaTools {
val psiJavaFile = psiClass!!.containingFile as PsiJavaFile
val classModifierList = psiClass.modifierList
val annotations = qualifiedNameAnnotations.filter { !classModifierList!!.hasAnnotation(it) }
ReadonlyStatusHandler.getInstance(project).ensureFilesWritable()
ReadonlyStatusHandler.ensureFilesWritable(project)
val javaCodeStyleManager = JavaCodeStyleManager.getInstance(project)
val codeStyleManager = CodeStyleManager.getInstance(project)
if(annotations.isNotEmpty()) {
Expand Down