diff --git a/src/main/kotlin/com/mituuz/fuzzier/Fuzzier.kt b/src/main/kotlin/com/mituuz/fuzzier/Fuzzier.kt index 3f12d72..2987973 100644 --- a/src/main/kotlin/com/mituuz/fuzzier/Fuzzier.kt +++ b/src/main/kotlin/com/mituuz/fuzzier/Fuzzier.kt @@ -29,8 +29,8 @@ open class Fuzzier : FuzzyAction() { private val fuzzyDimensionKey: String = "FuzzySearchPopup" override fun actionPerformed(actionEvent: AnActionEvent) { - setCustomHandlers() - SwingUtilities.invokeLater { + setCustomHandlers() + ApplicationManager.getApplication().invokeLater { defaultDoc = EditorFactory.getInstance().createDocument("") actionEvent.project?.let { project -> component = FuzzyFinderComponent(project) @@ -78,7 +78,7 @@ open class Fuzzier : FuzzyAction() { override fun updateListContents(project: Project, searchString: String) { if (StringUtils.isBlank(searchString)) { - SwingUtilities.invokeLater { + ApplicationManager.getApplication().invokeLater { component.fileList.model = DefaultListModel() defaultDoc?.let { (component as FuzzyFinderComponent).previewPane.updateFile(it) } } @@ -104,7 +104,7 @@ open class Fuzzier : FuzzyAction() { listModel = fuzzierUtil.sortAndLimit(listModel) - SwingUtilities.invokeLater { + ApplicationManager.getApplication().invokeLater { component.fileList.model = listModel component.fileList.cellRenderer = getCellRenderer() component.fileList.setPaintBusy(false) diff --git a/src/main/kotlin/com/mituuz/fuzzier/FuzzierVCS.kt b/src/main/kotlin/com/mituuz/fuzzier/FuzzierVCS.kt index 434eede..4a6ec4d 100644 --- a/src/main/kotlin/com/mituuz/fuzzier/FuzzierVCS.kt +++ b/src/main/kotlin/com/mituuz/fuzzier/FuzzierVCS.kt @@ -8,14 +8,12 @@ import com.mituuz.fuzzier.components.FuzzyFinderComponent import com.mituuz.fuzzier.entities.FuzzyMatchContainer import org.apache.commons.lang3.StringUtils import javax.swing.DefaultListModel -import javax.swing.SwingUtilities - class FuzzierVCS : Fuzzier() { override var title: String = "Fuzzy Search (Only VCS Tracked Files)" override fun updateListContents(project: Project, searchString: String) { if (StringUtils.isBlank(searchString)) { - SwingUtilities.invokeLater { + ApplicationManager.getApplication().invokeLater { component.fileList.model = DefaultListModel() defaultDoc?.let { (component as FuzzyFinderComponent).previewPane.updateFile(it) } } @@ -44,7 +42,7 @@ class FuzzierVCS : Fuzzier() { listModel = fuzzierUtil.sortAndLimit(listModel) - SwingUtilities.invokeLater { + ApplicationManager.getApplication().invokeLater { component.fileList.model = listModel component.fileList.cellRenderer = getCellRenderer() component.fileList.setPaintBusy(false) diff --git a/src/main/kotlin/com/mituuz/fuzzier/FuzzyMover.kt b/src/main/kotlin/com/mituuz/fuzzier/FuzzyMover.kt index 917f7d9..17fcb82 100644 --- a/src/main/kotlin/com/mituuz/fuzzier/FuzzyMover.kt +++ b/src/main/kotlin/com/mituuz/fuzzier/FuzzyMover.kt @@ -33,7 +33,7 @@ class FuzzyMover : FuzzyAction() { override fun actionPerformed(actionEvent: AnActionEvent) { setCustomHandlers() - SwingUtilities.invokeLater { + ApplicationManager.getApplication().invokeLater { actionEvent.project?.let { project -> component = SimpleFinderComponent() val projectBasePath = project.basePath @@ -117,7 +117,7 @@ class FuzzyMover : FuzzyAction() { } } } - SwingUtilities.invokeLater { + ApplicationManager.getApplication().invokeLater { component.isDirSelector = true component.searchField.text = "" component.fileList.setEmptyText("Select target folder") @@ -164,7 +164,7 @@ class FuzzyMover : FuzzyAction() { override fun updateListContents(project: Project, searchString: String) { if (StringUtils.isBlank(searchString)) { - SwingUtilities.invokeLater { + ApplicationManager.getApplication().invokeLater { component.fileList.model = DefaultListModel() } return @@ -194,7 +194,7 @@ class FuzzyMover : FuzzyAction() { listModel = fuzzierUtil.sortAndLimit(listModel) - SwingUtilities.invokeLater { + ApplicationManager.getApplication().invokeLater { component.fileList.model = listModel component.fileList.cellRenderer = getCellRenderer() component.fileList.setPaintBusy(false) diff --git a/src/main/kotlin/com/mituuz/fuzzier/components/TestBenchComponent.kt b/src/main/kotlin/com/mituuz/fuzzier/components/TestBenchComponent.kt index ffca967..c7fbc22 100644 --- a/src/main/kotlin/com/mituuz/fuzzier/components/TestBenchComponent.kt +++ b/src/main/kotlin/com/mituuz/fuzzier/components/TestBenchComponent.kt @@ -93,7 +93,7 @@ class TestBenchComponent : JPanel() { fun updateListContents(project: Project, searchString: String) { if (StringUtils.isBlank(searchString)) { - SwingUtilities.invokeLater { + ApplicationManager.getApplication().invokeLater { table.model = DefaultTableModel() } return @@ -136,7 +136,7 @@ class TestBenchComponent : JPanel() { val tableModel = DefaultTableModel(data, columnNames) - SwingUtilities.invokeLater { + ApplicationManager.getApplication().invokeLater { table.model = tableModel table.setPaintBusy(false) }