mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 18:27:49 +08:00
plugin_services.md: Wrap Java/Kotlin service examples in a single tab
This commit is contained in:
parent
f4f3d07989
commit
1e9b2dab0a
@ -52,12 +52,14 @@ Restrictions:
|
||||
|
||||
### Examples
|
||||
|
||||
Application-level light service:
|
||||
|
||||
<tabs group="languages">
|
||||
|
||||
|
||||
<tab title="Java" group-key="java">
|
||||
|
||||
Application-level light service:
|
||||
|
||||
```java
|
||||
@Service
|
||||
public final class MyAppService {
|
||||
@ -67,28 +69,8 @@ public final class MyAppService {
|
||||
}
|
||||
```
|
||||
|
||||
</tab>
|
||||
|
||||
<tab title="Kotlin" group-key="kotlin">
|
||||
|
||||
```kotlin
|
||||
@Service
|
||||
class MyAppService {
|
||||
fun doSomething(param: String) {
|
||||
// ...
|
||||
}
|
||||
}
|
||||
```
|
||||
</tab>
|
||||
|
||||
</tabs>
|
||||
|
||||
Project-level light service example:
|
||||
|
||||
<tabs group="languages">
|
||||
|
||||
<tab title="Java" group-key="java">
|
||||
|
||||
```java
|
||||
@Service(Service.Level.PROJECT)
|
||||
public final class MyProjectService {
|
||||
@ -109,6 +91,19 @@ public final class MyProjectService {
|
||||
|
||||
<tab title="Kotlin" group-key="kotlin">
|
||||
|
||||
Application-level light service:
|
||||
|
||||
```kotlin
|
||||
@Service
|
||||
class MyAppService {
|
||||
fun doSomething(param: String) {
|
||||
// ...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Project-level light service example:
|
||||
|
||||
```kotlin
|
||||
@Service(Service.Level.PROJECT)
|
||||
class MyProjectService(private val project: Project) {
|
||||
@ -118,6 +113,7 @@ class MyProjectService(private val project: Project) {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</tab>
|
||||
|
||||
</tabs>
|
||||
|
Loading…
x
Reference in New Issue
Block a user