mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
cleanup
GitOrigin-RevId: 7c9b1a96ce4cabe632ec111b13fb80c2ad8d1fc9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
87ea2badce
commit
e56e42568c
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.jps.model.serialization;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
@@ -73,7 +73,7 @@ public final class JpsGlobalLoader extends JpsLoaderBase {
|
||||
loadComponents(optionsDir, defaultConfigFile.getParent(), serializer, myGlobal);
|
||||
}
|
||||
|
||||
public static class PathVariablesSerializer extends JpsGlobalExtensionSerializer {
|
||||
public static final class PathVariablesSerializer extends JpsGlobalExtensionSerializer {
|
||||
public static final String MACRO_TAG = "macro";
|
||||
public static final String NAME_ATTRIBUTE = "name";
|
||||
public static final String VALUE_ATTRIBUTE = "value";
|
||||
@@ -96,7 +96,7 @@ public final class JpsGlobalLoader extends JpsLoaderBase {
|
||||
}
|
||||
}
|
||||
|
||||
public static class GlobalLibrariesSerializer extends JpsGlobalExtensionSerializer {
|
||||
public static final class GlobalLibrariesSerializer extends JpsGlobalExtensionSerializer {
|
||||
public GlobalLibrariesSerializer() {
|
||||
super("applicationLibraries.xml", "libraryTable");
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public final class JpsGlobalLoader extends JpsLoaderBase {
|
||||
}
|
||||
}
|
||||
|
||||
public static class SdkTableSerializer extends JpsGlobalExtensionSerializer {
|
||||
public static final class SdkTableSerializer extends JpsGlobalExtensionSerializer {
|
||||
public SdkTableSerializer() {
|
||||
super("jdk.table.xml", SDK_TABLE_COMPONENT_NAME);
|
||||
}
|
||||
|
||||
@@ -441,10 +441,6 @@ public final class EditorColorsManagerImpl extends EditorColorsManager implement
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAllSchemes() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EditorColorsScheme @NotNull [] getAllSchemes() {
|
||||
EditorColorsScheme[] result = getAllVisibleSchemes(mySchemeManager.getAllSchemes());
|
||||
@@ -476,8 +472,7 @@ public final class EditorColorsManagerImpl extends EditorColorsManager implement
|
||||
mySchemeManager.setCurrent(scheme == null ? getDefaultScheme() : scheme, false);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private EditorColorsScheme getDefaultScheme() {
|
||||
private @NotNull EditorColorsScheme getDefaultScheme() {
|
||||
DefaultColorsScheme defaultScheme = DefaultColorSchemesManager.getInstance().getFirstScheme();
|
||||
String editableCopyName = defaultScheme.getEditableCopyName();
|
||||
EditorColorsScheme editableCopy = getScheme(editableCopyName);
|
||||
@@ -485,17 +480,15 @@ public final class EditorColorsManagerImpl extends EditorColorsManager implement
|
||||
return editableCopy;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EditorColorsScheme getGlobalScheme() {
|
||||
public @NotNull EditorColorsScheme getGlobalScheme() {
|
||||
EditorColorsScheme scheme = mySchemeManager.getActiveScheme();
|
||||
EditorColorsScheme editableCopy = getEditableCopy(scheme);
|
||||
if (editableCopy != null) return editableCopy;
|
||||
return scheme == null ? getDefaultScheme() : scheme;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private EditorColorsScheme getEditableCopy(EditorColorsScheme scheme) {
|
||||
private @Nullable EditorColorsScheme getEditableCopy(EditorColorsScheme scheme) {
|
||||
if (isTempScheme(scheme)) return scheme;
|
||||
String editableCopyName = getEditableCopyName(scheme);
|
||||
if (editableCopyName != null) {
|
||||
@@ -505,8 +498,7 @@ public final class EditorColorsManagerImpl extends EditorColorsManager implement
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static String getEditableCopyName(EditorColorsScheme scheme) {
|
||||
private static @Nullable String getEditableCopyName(EditorColorsScheme scheme) {
|
||||
String editableCopyName = null;
|
||||
if (scheme instanceof DefaultColorsScheme && ((DefaultColorsScheme)scheme).hasEditableCopy()) {
|
||||
editableCopyName = ((DefaultColorsScheme)scheme).getEditableCopyName();
|
||||
@@ -532,9 +524,8 @@ public final class EditorColorsManagerImpl extends EditorColorsManager implement
|
||||
return myState.USE_ONLY_MONOSPACED_FONTS;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public State getState() {
|
||||
public @Nullable State getState() {
|
||||
String currentSchemeName = mySchemeManager.getCurrentSchemeName();
|
||||
if (currentSchemeName != null && !isTempScheme(mySchemeManager.getActiveScheme())) {
|
||||
myState.colorScheme = currentSchemeName;
|
||||
@@ -560,9 +551,8 @@ public final class EditorColorsManagerImpl extends EditorColorsManager implement
|
||||
return scheme instanceof DefaultColorsScheme;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EditorColorsScheme getSchemeForCurrentUITheme() {
|
||||
public @NotNull EditorColorsScheme getSchemeForCurrentUITheme() {
|
||||
LookAndFeelInfo lookAndFeelInfo = LafManager.getInstance().getCurrentLookAndFeel();
|
||||
EditorColorsScheme scheme = null;
|
||||
if (lookAndFeelInfo instanceof TempUIThemeBasedLookAndFeelInfo) {
|
||||
@@ -591,21 +581,19 @@ public final class EditorColorsManagerImpl extends EditorColorsManager implement
|
||||
return editableCopy != null ? editableCopy : scheme;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public SchemeManager<EditorColorsScheme> getSchemeManager() {
|
||||
public @NotNull SchemeManager<EditorColorsScheme> getSchemeManager() {
|
||||
return mySchemeManager;
|
||||
}
|
||||
|
||||
@NonNls private static final String TEMP_SCHEME_KEY = "TEMP_SCHEME_KEY";
|
||||
@NonNls private static final String TEMP_SCHEME_FILE_KEY = "TEMP_SCHEME_FILE_KEY";
|
||||
private static final @NonNls String TEMP_SCHEME_KEY = "TEMP_SCHEME_KEY";
|
||||
private static final @NonNls String TEMP_SCHEME_FILE_KEY = "TEMP_SCHEME_FILE_KEY";
|
||||
public static boolean isTempScheme(EditorColorsScheme scheme) {
|
||||
if (scheme == null) return false;
|
||||
|
||||
return StringUtil.equals(scheme.getMetaProperties().getProperty(TEMP_SCHEME_KEY), Boolean.TRUE.toString());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Path getTempSchemeOriginalFilePath(EditorColorsScheme scheme) {
|
||||
public static @Nullable Path getTempSchemeOriginalFilePath(EditorColorsScheme scheme) {
|
||||
if (isTempScheme(scheme)) {
|
||||
String path = scheme.getMetaProperties().getProperty(TEMP_SCHEME_FILE_KEY);
|
||||
if (path != null) {
|
||||
|
||||
Reference in New Issue
Block a user