Skip to content

Commit

Permalink
Merge branch 'private-release/v1.1.0-231' into public-release/v1.1.0-231
Browse files Browse the repository at this point in the history
  • Loading branch information
KUGDev committed Jun 28, 2023
2 parents c1a6e42 + 66de2f7 commit 3aab3cb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ package eu.ibagroup.formainframe.config

import com.intellij.openapi.components.service
import com.intellij.openapi.project.Project
import com.intellij.openapi.vcs.changes.shelf.ShelveChangesManager.PostStartupActivity
import com.intellij.openapi.startup.ProjectActivity

/**
* Activity to prepare configs.
* @author Valiantsin Krus.
*/
class ConfigStartupActivity: PostStartupActivity() {
class ConfigStartupActivity: ProjectActivity {

/** Registers all config classes and migrate configs to state v2. */
override fun runActivity(project: Project) {
override suspend fun execute(project: Project) {
service<ConfigService>().apply {
registerAllConfigClasses()
service<OldConfigService>().state?.let { oldState ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
package eu.ibagroup.formainframe.editor

import com.intellij.openapi.project.Project
import com.intellij.openapi.startup.StartupActivity
import com.intellij.openapi.startup.ProjectActivity
import com.intellij.openapi.wm.StatusBar
import com.intellij.openapi.wm.StatusBarWidgetFactory

/**
* Project post startup activity.
*/
class ProjectStartupActivity: StartupActivity.DumbAware {
class ProjectStartupActivity: ProjectActivity {

/**
* Implementation of [StartupActivity.runActivity].
* Implementation of [ProjectActivity.execute].
* Unregisters widget factories that provide status bar widgets that are overridden in the plugin.
*/
override fun runActivity(project: Project) {
override suspend fun execute(project: Project) {
val extensionPoint = StatusBarWidgetFactory.EP_NAME.point
extensionPoint.extensionList.filter {
it.id == StatusBar.StandardWidgets.ENCODING_PANEL || it.id == StatusBar.StandardWidgets.LINE_SEPARATOR_PANEL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package eu.ibagroup.formainframe.explorer.ui

import com.intellij.collaboration.ui.util.getName
import com.intellij.icons.AllIcons
import com.intellij.ide.IdeBundle
import com.intellij.openapi.application.ApplicationManager
Expand Down Expand Up @@ -204,8 +205,7 @@ class ChangeEncodingDialogTestSpec : ShouldSpec({
every { reloadIn(any(), virtualFileMock, charsetMock) } returns Unit

val actions = createActionsRef.invoke(changeEncodingDialog).castOrNull<Array<Action>>()
// TODO: change it.getValue(Action.NAME) to it.getName() in v1.*.*-231 and greater
val reloadAction = actions?.first { it.getValue(Action.NAME) == IdeBundle.message("button.reload") }
val reloadAction = actions?.first { it.getName() == IdeBundle.message("button.reload") }
reloadAction?.actionPerformed(actionEventMock)

assertSoftly { expectedExitCode shouldBe ChangeEncodingDialog.RELOAD_EXIT_CODE }
Expand All @@ -215,8 +215,7 @@ class ChangeEncodingDialogTestSpec : ShouldSpec({
every { reloadIn(any(), virtualFileMock, charsetMock) } returns Unit

val actions = createActionsRef.invoke(changeEncodingDialog).castOrNull<Array<Action>>()
// TODO: change it.getValue(Action.NAME) to it.getName() in v1.*.*-231 and greater
val reloadAction = actions?.first { it.getValue(Action.NAME) == IdeBundle.message("button.reload") }
val reloadAction = actions?.first { it.getName() == IdeBundle.message("button.reload") }
reloadAction?.actionPerformed(actionEventMock)

assertSoftly { expectedExitCode shouldBe ChangeEncodingDialog.RELOAD_EXIT_CODE }
Expand Down Expand Up @@ -247,8 +246,7 @@ class ChangeEncodingDialogTestSpec : ShouldSpec({
}

val actions = createActionsRef.invoke(changeEncodingDialog).castOrNull<Array<Action>>()
// TODO: change it.getValue(Action.NAME) to it.getName() in v1.*.*-231 and greater
val reloadAction = actions?.first { it.getValue(Action.NAME) == IdeBundle.message("button.reload") }
val reloadAction = actions?.first { it.getName() == IdeBundle.message("button.reload") }
reloadAction?.actionPerformed(actionEventMock)

assertSoftly { expectedExitCode shouldBe ChangeEncodingDialog.RELOAD_EXIT_CODE }
Expand Down Expand Up @@ -279,8 +277,7 @@ class ChangeEncodingDialogTestSpec : ShouldSpec({
}

val actions = createActionsRef.invoke(changeEncodingDialog).castOrNull<Array<Action>>()
// TODO: change it.getValue(Action.NAME) to it.getName() in v1.*.*-231 and greater
val reloadAction = actions?.first { it.getValue(Action.NAME) == IdeBundle.message("button.reload") }
val reloadAction = actions?.first { it.getName() == IdeBundle.message("button.reload") }
reloadAction?.actionPerformed(actionEventMock)

assertSoftly { expectedExitCode shouldBe ChangeEncodingDialog.RELOAD_EXIT_CODE }
Expand All @@ -304,8 +301,7 @@ class ChangeEncodingDialogTestSpec : ShouldSpec({
}

val actions = createActionsRef.invoke(changeEncodingDialog).castOrNull<Array<Action>>()
// TODO: change it.getValue(Action.NAME) to it.getName() in v1.*.*-231 and greater
val reloadAction = actions?.first { it.getValue(Action.NAME) == IdeBundle.message("button.reload") }
val reloadAction = actions?.first { it.getName() == IdeBundle.message("button.reload") }
reloadAction?.actionPerformed(actionEventMock)

assertSoftly { expectedExitCode shouldBe DialogWrapper.CANCEL_EXIT_CODE }
Expand All @@ -316,8 +312,7 @@ class ChangeEncodingDialogTestSpec : ShouldSpec({
every { saveIn(any(), virtualFileMock, charsetMock) } returns Unit

val actions = createActionsRef.invoke(changeEncodingDialog).castOrNull<Array<Action>>()
// TODO: change it.getValue(Action.NAME) to it.getName() in v1.*.*-231 and greater
val convertAction = actions?.first { it.getValue(Action.NAME) == IdeBundle.message("button.convert") }
val convertAction = actions?.first { it.getName() == IdeBundle.message("button.convert") }
convertAction?.actionPerformed(actionEventMock)

assertSoftly { expectedExitCode shouldBe ChangeEncodingDialog.CONVERT_EXIT_CODE }
Expand Down Expand Up @@ -348,8 +343,7 @@ class ChangeEncodingDialogTestSpec : ShouldSpec({
}

val actions = createActionsRef.invoke(changeEncodingDialog).castOrNull<Array<Action>>()
// TODO: change it.getValue(Action.NAME) to it.getName() in v1.*.*-231 and greater
val convertAction = actions?.first { it.getValue(Action.NAME) == IdeBundle.message("button.convert") }
val convertAction = actions?.first { it.getName() == IdeBundle.message("button.convert") }
convertAction?.actionPerformed(actionEventMock)

assertSoftly { expectedExitCode shouldBe ChangeEncodingDialog.CONVERT_EXIT_CODE }
Expand All @@ -373,8 +367,7 @@ class ChangeEncodingDialogTestSpec : ShouldSpec({
}

val actions = createActionsRef.invoke(changeEncodingDialog).castOrNull<Array<Action>>()
// TODO: change it.getValue(Action.NAME) to it.getName() in v1.*.*-231 and greater
val convertAction = actions?.first { it.getValue(Action.NAME) == IdeBundle.message("button.convert") }
val convertAction = actions?.first { it.getName() == IdeBundle.message("button.convert") }
convertAction?.actionPerformed(actionEventMock)

assertSoftly { expectedExitCode shouldBe DialogWrapper.CANCEL_EXIT_CODE }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ open class TestFileEditorManager : FileEditorManager() {
TODO("Not yet implemented")
}

override fun openFile(file: VirtualFile): MutableList<FileEditor> {
TODO("Not yet implemented")
}

override fun closeFile(file: VirtualFile) {
TODO("Not yet implemented")
}
Expand All @@ -58,6 +62,10 @@ open class TestFileEditorManager : FileEditorManager() {
TODO("Not yet implemented")
}

override fun getOpenFilesWithRemotes(): MutableList<VirtualFile> {
TODO("Not yet implemented")
}

override fun getSelectedFiles(): Array<VirtualFile> {
TODO("Not yet implemented")
}
Expand Down

0 comments on commit 3aab3cb

Please sign in to comment.