Skip to content

Commit 7b7aa04

Browse files
authored
Use ActivityTracker.getInstance().inc() to force update of ui (#27)
1 parent cef0e90 commit 7b7aa04

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package no.spk.fiskeoye.plugin.actions.window
22

3-
import com.intellij.openapi.actionSystem.ActionUpdateThread
43
import com.intellij.openapi.actionSystem.AnActionEvent
54
import com.intellij.ui.table.JBTable
65
import no.spk.fiskeoye.plugin.actions.FiskeoyeAction
@@ -13,11 +12,7 @@ internal abstract class TableAction(
1312
) : FiskeoyeAction(toolTip, icon) {
1413

1514
override fun update(e: AnActionEvent) {
16-
super.update(e)
17-
if (e.project == null) return
1815
e.presentation.isEnabled = table.rowCount > 0
1916
}
2017

21-
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.EDT
22-
2318
}

src/main/kotlin/no/spk/fiskeoye/plugin/listeners/button/FileContentSearchListener.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package no.spk.fiskeoye.plugin.listeners.button
22

3+
import com.intellij.ide.ActivityTracker
34
import com.intellij.openapi.diagnostic.Logger
45
import com.intellij.openapi.progress.ProgressIndicator
56
import com.intellij.openapi.progress.Task
@@ -91,7 +92,7 @@ internal class FileContentSearchListener(private val fileContentPanel: FileConte
9192
mainTable.model = model
9293
mainTable.hideColumns()
9394
urlLabel.text = requestUrl
94-
updateUI()
95+
ActivityTracker.getInstance().inc()
9596
}
9697
}
9798
}

src/main/kotlin/no/spk/fiskeoye/plugin/listeners/button/FilenameSearchListener.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package no.spk.fiskeoye.plugin.listeners.button
22

3+
import com.intellij.ide.ActivityTracker
34
import com.intellij.openapi.progress.ProgressIndicator
45
import com.intellij.openapi.progress.Task
56
import no.spk.fiskeoye.plugin.service.FiskeoyeService.getFilename
@@ -83,7 +84,7 @@ internal class FilenameSearchListener(private val filenamePanel: FilenamePanel)
8384
mainTable.model = model
8485
mainTable.hideColumns()
8586
urlLabel.text = requestUrl
86-
updateUI()
87+
ActivityTracker.getInstance().inc()
8788
}
8889
}
8990
}

0 commit comments

Comments
 (0)