mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
load editor color schemes from themes if bundled
This commit is contained in:
+19
@@ -8,6 +8,8 @@ import com.intellij.configurationStore.SchemeDataHolder;
|
||||
import com.intellij.configurationStore.SchemeExtensionProvider;
|
||||
import com.intellij.ide.WelcomeWizardUtil;
|
||||
import com.intellij.ide.ui.LafManager;
|
||||
import com.intellij.ide.ui.UITheme;
|
||||
import com.intellij.ide.ui.laf.UIThemeBasedLookAndFeelInfo;
|
||||
import com.intellij.notification.Notification;
|
||||
import com.intellij.notification.NotificationType;
|
||||
import com.intellij.notification.Notifications;
|
||||
@@ -41,6 +43,7 @@ import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -127,6 +130,7 @@ public class EditorColorsManagerImpl extends EditorColorsManager implements Pers
|
||||
public void reloaded(@NotNull SchemeManager<EditorColorsScheme> schemeManager,
|
||||
@NotNull Collection<? extends EditorColorsScheme> schemes) {
|
||||
loadBundledSchemes();
|
||||
loadSchemesFromThemes();
|
||||
initEditableDefaultSchemesCopies();
|
||||
initEditableBundledSchemesCopies();
|
||||
}
|
||||
@@ -135,6 +139,7 @@ public class EditorColorsManagerImpl extends EditorColorsManager implements Pers
|
||||
|
||||
initDefaultSchemes();
|
||||
loadBundledSchemes();
|
||||
loadSchemesFromThemes();
|
||||
mySchemeManager.loadSchemes();
|
||||
|
||||
String wizardEditorScheme = WelcomeWizardUtil.getWizardEditorScheme();
|
||||
@@ -172,6 +177,20 @@ public class EditorColorsManagerImpl extends EditorColorsManager implements Pers
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void loadSchemesFromThemes() {
|
||||
if (!isUnitTestOrHeadlessMode()) {
|
||||
for (UIManager.LookAndFeelInfo laf : LafManager.getInstance().getInstalledLookAndFeels()) {
|
||||
if (laf instanceof UIThemeBasedLookAndFeelInfo) {
|
||||
UITheme theme = ((UIThemeBasedLookAndFeelInfo)laf).getTheme();
|
||||
String path = theme.getEditorScheme();
|
||||
if (path != null) {
|
||||
mySchemeManager.loadBundledScheme(path, theme.getProviderClass());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initEditableBundledSchemesCopies() {
|
||||
for (EditorColorsScheme scheme : mySchemeManager.getAllSchemes()) {
|
||||
|
||||
Reference in New Issue
Block a user