mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
JavaScript libraries: misc. UI changes
This commit is contained in:
+14
-5
@@ -91,18 +91,27 @@ public class ScriptingLibraryMappings extends LanguagePerFileMappings<ScriptingL
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ScriptingLibraryTable.LibraryModel chosenToStored(VirtualFile file, ScriptingLibraryTable.LibraryModel value) {
|
||||
if (value instanceof CompoundLibrary) return value;
|
||||
CompoundLibrary compoundLib = file == null ? myProjectLibs : myCompoundLibMap.get(file);
|
||||
if (compoundLib == null) {
|
||||
compoundLib = new CompoundLibrary();
|
||||
myCompoundLibMap.put(file, compoundLib);
|
||||
}
|
||||
if (value == null) {
|
||||
compoundLib.clearLibraries();
|
||||
if (compoundLib != null) {
|
||||
compoundLib.clearLibraries();
|
||||
myCompoundLibMap.remove(file);
|
||||
compoundLib = null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (compoundLib == null) {
|
||||
compoundLib = new CompoundLibrary();
|
||||
myCompoundLibMap.put(file, compoundLib);
|
||||
}
|
||||
compoundLib.toggleLibrary(value);
|
||||
if (compoundLib.isEmpty()) {
|
||||
myCompoundLibMap.remove(file);
|
||||
compoundLib = null;
|
||||
}
|
||||
}
|
||||
return compoundLib;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user