generated from JetBrains/intellij-platform-plugin-template
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(statusbar): add AutoDev status bar widget and action
- Added `AutoDevStatusService` class to handle the status bar widget. - Added `AutoDevStatusItemAction` class to handle the action performed when the status bar widget is clicked. - Modified `AutoDevStatusBarWidgetFactory` class to make the status bar widget available. -
- Loading branch information
Showing
10 changed files
with
97 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/kotlin/cc/unitmesh/devti/statusbar/AutoDevStatusItemAction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package cc.unitmesh.devti.statusbar | ||
|
||
import com.intellij.openapi.actionSystem.ActionUpdateThread | ||
import com.intellij.openapi.actionSystem.AnAction | ||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.project.DumbAware | ||
|
||
class AutoDevStatusItemAction : AnAction(), DumbAware { | ||
override fun update(e: AnActionEvent) { | ||
val presentation = e.presentation | ||
presentation.isEnabled = false | ||
presentation.text = "AutoDev" | ||
} | ||
|
||
override fun actionPerformed(e: AnActionEvent) {} | ||
|
||
override fun getActionUpdateThread(): ActionUpdateThread { | ||
return ActionUpdateThread.EDT | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/kotlin/cc/unitmesh/devti/statusbar/AutoDevStatusService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package cc.unitmesh.devti.statusbar | ||
|
||
import com.intellij.openapi.Disposable | ||
import com.intellij.openapi.application.ApplicationManager | ||
import com.intellij.util.messages.Topic | ||
|
||
class AutoDevStatusService: Disposable { | ||
init { | ||
ApplicationManager.getApplication().messageBus | ||
.connect(this) | ||
.subscribe(TOPIC, this) | ||
} | ||
|
||
override fun dispose() { | ||
|
||
} | ||
|
||
companion object { | ||
val TOPIC = Topic.create("autodev.status", AutoDevStatusService::class.java) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters