mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 02:07:50 +08:00
disposers.md: Add plugin disposable service example
This commit is contained in:
parent
b64f31a09c
commit
6eb90c49ed
@ -47,7 +47,7 @@ One of the parent `Disposables` provided by the IntelliJ Platform can be chosen,
|
||||
|
||||
Use the following guidelines to choose the correct parent:
|
||||
|
||||
* For resources required for a plugin's entire lifetime, use an application or project level [service](plugin_services.md).
|
||||
* For resources required for a plugin's entire lifetime, use an application or project level [service](plugin_services.md). Example: [`PythonPluginDisposable`](%gh-ic%/python/openapi/src/com/jetbrains/python/PythonPluginDisposable.java).
|
||||
* For resources required while a [dialog](dialog_wrapper.md) is displayed, use `DialogWrapper.getDisposable()`.
|
||||
* For resources required while a [tool window](tool_windows.md) tab is displayed, pass your instance implementing `Disposable` to `Content.setDisposer()`.
|
||||
* For resources with a shorter lifetime, create a disposable using `Disposer.newDisposable()` and dispose it manually using `Disposable.dispose()`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user