mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
persisting_state_of_components.md: Remove getInstance() from code snippets
It is a part of Services topic and is redundant noise on this page. Also, getInstance() helper is not required.
This commit is contained in:
parent
b4edb4a2a7
commit
20aef24c84
@ -34,10 +34,6 @@ In the former case, the state class instance is typically stored as a field in t
|
||||
@State(...)
|
||||
class MyService implements PersistentStateComponent<MyService.State> {
|
||||
|
||||
public static MyService getInstance() {
|
||||
// implementation according to Application/Project level service
|
||||
}
|
||||
|
||||
static class State {
|
||||
public String value;
|
||||
}
|
||||
@ -60,10 +56,6 @@ In the latter case, you can use the following pattern to implement `getState()`
|
||||
@State(...)
|
||||
class MyService implements PersistentStateComponent<MyService> {
|
||||
|
||||
public static MyService getInstance() {
|
||||
// implementation according to Application/Project level service
|
||||
}
|
||||
|
||||
public String stateValue;
|
||||
|
||||
public MyService getState() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user