1
0
mirror of https://github.com/chylex/IntelliJ-Rainbow-Brackets.git synced 2025-04-10 18:15:50 +02:00

Refactoring: move from ProjectComponent to StartupActivity

This commit is contained in:
张志豪 2019-04-18 19:16:10 +08:00
parent c1714dc4cf
commit 5017904725
2 changed files with 7 additions and 10 deletions
src/main
kotlin/com/github/izhangzhihao/rainbow/brackets/activity
resources/META-INF

View File

@ -1,16 +1,17 @@
package com.github.izhangzhihao.rainbow.brackets.component
package com.github.izhangzhihao.rainbow.brackets.activity
import com.github.izhangzhihao.rainbow.brackets.component.RainbowComponent
import com.github.izhangzhihao.rainbow.brackets.settings.RainbowSettings
import com.github.izhangzhihao.rainbow.brackets.show
import com.intellij.notification.NotificationListener
import com.intellij.notification.NotificationType
import com.intellij.openapi.components.ProjectComponent
class RainbowUpdateComponent : ProjectComponent {
import com.intellij.openapi.project.Project
import com.intellij.openapi.startup.StartupActivity
class RainbowUpdateActivity : StartupActivity {
private val applicationComponent = RainbowComponent.instance
override fun projectOpened() {
override fun runActivity(project: Project) {
if (applicationComponent.updated) {
showUpdate()
applicationComponent.updated = false

View File

@ -357,6 +357,7 @@
<additionalTextAttributes scheme="Default" file="colorSchemes/rainbow-color-defuault.xml"/>
<additionalTextAttributes scheme="Darcula" file="colorSchemes/rainbow-color-defuault-darcula.xml"/>
<postStartupActivity implementation="com.github.izhangzhihao.rainbow.brackets.activity.RainbowUpdateActivity"/>
</extensions>
<application-components>
@ -368,11 +369,6 @@
</application-components>
<project-components>
<!-- Add your project components here -->
<component>
<implementation-class>com.github.izhangzhihao.rainbow.brackets.component.RainbowUpdateComponent
</implementation-class>
</component>
</project-components>
<actions>