mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Reimplement component as a service
This commit is contained in:
+3
-4
@@ -2,9 +2,8 @@
|
||||
package com.intellij.xdebugger.memory.component;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.components.ApplicationComponent;
|
||||
import com.intellij.openapi.components.PersistentStateComponent;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.components.State;
|
||||
import com.intellij.openapi.components.Storage;
|
||||
import com.intellij.util.EventDispatcher;
|
||||
@@ -12,7 +11,7 @@ import com.intellij.xdebugger.memory.event.MemoryViewManagerListener;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@State(name = "MemoryViewSettings", storages = @Storage("memory.view.xml"))
|
||||
public class MemoryViewManager implements ApplicationComponent, PersistentStateComponent<MemoryViewManagerState> {
|
||||
public class MemoryViewManager implements PersistentStateComponent<MemoryViewManagerState> {
|
||||
public static final String MEMORY_VIEW_CONTENT = "MemoryView";
|
||||
|
||||
private final EventDispatcher<MemoryViewManagerListener> myDispatcher =
|
||||
@@ -20,7 +19,7 @@ public class MemoryViewManager implements ApplicationComponent, PersistentStateC
|
||||
private MemoryViewManagerState myState = new MemoryViewManagerState();
|
||||
|
||||
public static MemoryViewManager getInstance() {
|
||||
return ApplicationManager.getApplication().getComponent(MemoryViewManager.class);
|
||||
return ServiceManager.getService(MemoryViewManager.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
<idea-plugin>
|
||||
<application-components>
|
||||
<component>
|
||||
<implementation-class>com.intellij.xdebugger.memory.component.MemoryViewManager</implementation-class>
|
||||
</component>
|
||||
</application-components>
|
||||
|
||||
<project-components>
|
||||
<component>
|
||||
<interface-class>com.intellij.debugger.ui.DebuggerPanelsManager</interface-class>
|
||||
@@ -31,6 +25,10 @@
|
||||
</component>
|
||||
</project-components>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<applicationService serviceImplementation="com.intellij.xdebugger.memory.component.MemoryViewManager"/>
|
||||
</extensions>
|
||||
|
||||
<!--
|
||||
<actions>
|
||||
<group id="CommonViews">
|
||||
|
||||
Reference in New Issue
Block a user