mirror of
https://github.com/JetBrains/intellij-platform-plugin-template.git
synced 2026-03-02 03:39:24 +00:00
Example code - registered project service changed into a lightweight one
This commit is contained in:
committed by
Jakub Chrzanowski
parent
59ec0d6096
commit
b8ad6a9a5e
@@ -1,12 +1,15 @@
|
||||
package org.jetbrains.plugins.template.services
|
||||
|
||||
import com.intellij.openapi.components.Service
|
||||
import com.intellij.openapi.diagnostic.thisLogger
|
||||
import com.intellij.openapi.project.Project
|
||||
import org.jetbrains.plugins.template.MyBundle
|
||||
|
||||
@Service(Service.Level.PROJECT)
|
||||
class MyProjectService(project: Project) {
|
||||
|
||||
init {
|
||||
println(MyBundle.message("projectService", project.name))
|
||||
thisLogger().info(MyBundle.message("projectService", project.name))
|
||||
|
||||
System.getenv("CI")
|
||||
?: TODO("Don't forget to remove all non-needed sample code files with their corresponding registration entries in `plugin.xml`.")
|
||||
|
||||
@@ -7,10 +7,6 @@
|
||||
<depends>com.intellij.modules.platform</depends>
|
||||
|
||||
<resource-bundle>messages.MyBundle</resource-bundle>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<projectService serviceImplementation="org.jetbrains.plugins.template.services.MyProjectService"/>
|
||||
</extensions>
|
||||
|
||||
<applicationListeners>
|
||||
<listener class="org.jetbrains.plugins.template.listeners.MyFrameStateListener"
|
||||
|
||||
Reference in New Issue
Block a user