mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -94,7 +94,7 @@ public interface SchemesManager <T extends Scheme, E extends ExternalizableSchem
|
||||
|
||||
void save();
|
||||
|
||||
void setCurrentSchemeName(final String schemeName);
|
||||
void setCurrentSchemeName(@Nullable String schemeName);
|
||||
|
||||
@Nullable
|
||||
T getCurrentScheme();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -55,15 +55,16 @@ public abstract class AbstractSchemesManager<T extends Scheme, E extends Externa
|
||||
checkCurrentScheme(scheme);
|
||||
}
|
||||
|
||||
protected void checkCurrentScheme(final Scheme scheme) {
|
||||
if (myCurrentScheme == null && myCurrentSchemeName != null && myCurrentSchemeName.equals(scheme.getName())) {
|
||||
protected void checkCurrentScheme(@NotNull Scheme scheme) {
|
||||
if (myCurrentScheme == null && scheme.getName().equals(myCurrentSchemeName)) {
|
||||
//noinspection unchecked
|
||||
myCurrentScheme = (T)scheme;
|
||||
}
|
||||
}
|
||||
|
||||
private Collection<String> collectExistingNames(final Collection<T> schemes) {
|
||||
Set<String> result = new THashSet<String>();
|
||||
@NotNull
|
||||
private Collection<String> collectExistingNames(@NotNull Collection<T> schemes) {
|
||||
Set<String> result = new THashSet<String>(schemes.size());
|
||||
for (T scheme : schemes) {
|
||||
result.add(scheme.getName());
|
||||
}
|
||||
@@ -96,7 +97,7 @@ public abstract class AbstractSchemesManager<T extends Scheme, E extends Externa
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCurrentSchemeName(final String schemeName) {
|
||||
public void setCurrentSchemeName(@Nullable String schemeName) {
|
||||
myCurrentSchemeName = schemeName;
|
||||
myCurrentScheme = schemeName == null ? null : findSchemeByName(schemeName);
|
||||
}
|
||||
|
||||
+2
-2
@@ -69,6 +69,7 @@ public class EditorColorsManagerImpl extends EditorColorsManager implements Name
|
||||
private final SchemesManager<EditorColorsScheme, EditorColorsSchemeImpl> mySchemesManager;
|
||||
@NonNls private static final String NAME_ATTR = "name";
|
||||
private static final String FILE_SPEC = StoragePathMacros.ROOT_CONFIG + "/colors";
|
||||
@NonNls
|
||||
private static final String FILE_EXT = ".icls";
|
||||
|
||||
public EditorColorsManagerImpl(DefaultColorSchemesManager defaultColorSchemesManager, SchemesManagerFactory schemesManagerFactory) {
|
||||
@@ -237,8 +238,7 @@ public class EditorColorsManagerImpl extends EditorColorsManager implements Name
|
||||
}
|
||||
|
||||
private void setGlobalSchemeInner(@Nullable EditorColorsScheme scheme) {
|
||||
String newValue = scheme == null ? getDefaultScheme().getName() : scheme.getName();
|
||||
mySchemesManager.setCurrentSchemeName(newValue);
|
||||
mySchemesManager.setCurrentSchemeName(scheme == null ? getDefaultScheme().getName() : scheme.getName());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user