mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use service instead of application component (IDEA-67767)
This commit is contained in:
+2
-17
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.intellij.openapi.editor.richcopy.settings;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.components.*;
|
||||
import com.intellij.openapi.editor.colors.EditorColorsManager;
|
||||
import com.intellij.openapi.editor.colors.EditorColorsScheme;
|
||||
@@ -31,7 +30,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
name = "EditorRichCopySettings",
|
||||
storages = {@Storage(file = StoragePathMacros.APP_CONFIG + "/editor.rich.copy.xml")}
|
||||
)
|
||||
public class RichCopySettings implements PersistentStateComponent<RichCopySettings>, ApplicationComponent {
|
||||
public class RichCopySettings implements PersistentStateComponent<RichCopySettings> {
|
||||
|
||||
@NotNull public static final String ACTIVE_GLOBAL_SCHEME_MARKER = "__ACTIVE_GLOBAL_SCHEME__";
|
||||
|
||||
@@ -39,7 +38,7 @@ public class RichCopySettings implements PersistentStateComponent<RichCopySettin
|
||||
|
||||
@NotNull
|
||||
public static RichCopySettings getInstance() {
|
||||
return ApplicationManager.getApplication().getComponent(RichCopySettings.class);
|
||||
return ServiceManager.getService(RichCopySettings.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -62,20 +61,6 @@ public class RichCopySettings implements PersistentStateComponent<RichCopySettin
|
||||
XmlSerializerUtil.copyBean(state, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initComponent() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeComponent() {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return getClass().getName();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getSchemeName() {
|
||||
return mySchemeName == null ? ACTIVE_GLOBAL_SCHEME_MARKER : mySchemeName;
|
||||
|
||||
@@ -881,6 +881,7 @@
|
||||
|
||||
<virtualFileSystem key="scratchpad" implementationClass="com.intellij.ide.scratch.ScratchpadFileSystem"/>
|
||||
|
||||
<applicationService serviceImplementation="com.intellij.openapi.editor.richcopy.settings.RichCopySettings"/>
|
||||
<copyPastePostProcessor implementation="com.intellij.openapi.editor.richcopy.TextWithMarkupProcessor"/>
|
||||
<copyPastePostProcessor implementation="com.intellij.openapi.editor.richcopy.RtfCopyPasteProcessor"/>
|
||||
<copyPastePostProcessor implementation="com.intellij.openapi.editor.richcopy.HtmlCopyPasteProcessor"/>
|
||||
|
||||
@@ -37,10 +37,6 @@
|
||||
<component>
|
||||
<implementation-class>com.intellij.codeInsight.preview.ImageOrColorPreviewManager</implementation-class>
|
||||
</component>
|
||||
|
||||
<component>
|
||||
<implementation-class>com.intellij.openapi.editor.richcopy.settings.RichCopySettings</implementation-class>
|
||||
</component>
|
||||
</application-components>
|
||||
|
||||
<project-components>
|
||||
|
||||
Reference in New Issue
Block a user