Skip to content

Commit

Permalink
Merge pull request #46
Browse files Browse the repository at this point in the history
dev
  • Loading branch information
bobi committed Aug 28, 2022
2 parents 84cbb20 + 37e6e89 commit 1313064
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
# aem-groovyconsole-plugin Changelog

## [Unreleased]

## [0.4.15]
### Added
### Added
- Added ability to test connection during server configuration

## [0.4.13]
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 @@
pluginGroup = com.github.bobi.aemgroovyconsoleplugin
pluginName = aem-groovyconsole-plugin
# SemVer format -> https://semver.org
pluginVersion = 0.4.15
pluginVersion = 0.4.16

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.intellij.openapi.progress.runModalTask
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.DialogWrapper
import com.intellij.openapi.ui.ValidationInfo
import com.intellij.openapi.wm.IdeFocusManager
import com.intellij.ui.components.JBLabel
import com.intellij.ui.components.JBTextField
import com.intellij.ui.layout.PropertyBinding
Expand Down Expand Up @@ -99,7 +100,13 @@ class AemServerEditDialog(private val project: Project, private val tableItem: A

testServerAction = object : DialogWrapperAction("Test") {
override fun doAction(e: ActionEvent) {
testServer()
testConnectionToServer()
}
}

okAction.addPropertyChangeListener {
if ("enabled" == it.propertyName) {
testServerAction.isEnabled = it.newValue as Boolean
}
}
}
Expand All @@ -108,7 +115,7 @@ class AemServerEditDialog(private val project: Project, private val tableItem: A
return arrayOf(testServerAction, *super.createActions())
}

private fun testServer() {
private fun testConnectionToServer() {
val validationInfos = doValidateAll()

updateErrorInfo(validationInfos)
Expand Down Expand Up @@ -143,6 +150,12 @@ class AemServerEditDialog(private val project: Project, private val tableItem: A
promise.setError(th)
}
}
} else {
val firstError = validationInfos.first()

if (firstError.component?.isVisible == true) {
IdeFocusManager.getInstance(null).requestFocus(firstError.component!!, true)
}
}
}

Expand Down

0 comments on commit 1313064

Please sign in to comment.