public void addImportedScheme(@NotNull final EditorColorsScheme imported) { MyColorScheme newScheme = new MyColorScheme(imported); initScheme(newScheme); mySchemes.put(imported.getName(), newScheme); selectScheme(newScheme.getName()); resetSchemesCombo(null); }
public void removeScheme(String name) { if (mySelectedScheme.getName().equals(name)) { //noinspection HardCodedStringLiteral selectScheme("Default"); } boolean deletedNewlyCreated = false; MyColorScheme toDelete = mySchemes.get(name); if (toDelete != null) { deletedNewlyCreated = toDelete.isNew(); } mySchemes.remove(name); resetSchemesCombo(null); mySomeSchemesDeleted = mySomeSchemesDeleted || !deletedNewlyCreated; }
public void saveSchemeAs(String name) { MyColorScheme scheme = mySelectedScheme; if (scheme == null) return; EditorColorsScheme clone = (EditorColorsScheme) scheme.getOriginalScheme().clone(); scheme.apply(clone); clone.setName(name); MyColorScheme newScheme = new MyColorScheme(clone); initScheme(newScheme); newScheme.setIsNew(); mySchemes.put(name, newScheme); selectScheme(newScheme.getName()); resetSchemesCombo(null); }