use of com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters in project intellij-plugins by JetBrains.
the class ConversionHelper method serialize.
//public static ModifiableFlexBuildConfiguration createConfigInstance(String name) {
// FlexBuildConfigurationImpl c = new FlexBuildConfigurationImpl();
// c.setName(name);
// return c;
//}
//
public static Element serialize(PersistentStateComponent c) {
Element element = XmlSerializer.serialize(c.getState(), new SkipDefaultValuesSerializationFilters());
collapsePaths(element);
return element;
}
use of com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters in project intellij-community by JetBrains.
the class NamedScopeManager method getState.
@Override
public Element getState() {
Element state = super.getState();
XmlSerializer.serializeInto(myOrderState, state, new SkipDefaultValuesSerializationFilters());
return state;
}
use of com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters in project intellij-community by JetBrains.
the class MultilanguageDuplocatorSettings method getState.
@Override
public Element getState() {
synchronized (mySettingsMap) {
Element state = new Element("state");
if (mySettingsMap.isEmpty()) {
return state;
}
SkipDefaultValuesSerializationFilters filter = new SkipDefaultValuesSerializationFilters();
for (String name : mySettingsMap.keySet()) {
Element child = XmlSerializer.serializeIfNotDefault(mySettingsMap.get(name), filter);
if (child != null) {
child.setName("object");
child.setAttribute("language", name);
state.addContent(child);
}
}
return state;
}
}
use of com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters in project intellij-community by JetBrains.
the class JpsFacetSerializer method saveFacets.
public static void saveFacets(JpsModule module, @NotNull Element facetManagerElement) {
FacetManagerState managerState = new FacetManagerState();
for (JpsModelSerializerExtension extension : JpsModelSerializerExtension.getExtensions()) {
for (JpsFacetConfigurationSerializer<?> serializer : extension.getFacetConfigurationSerializers()) {
if (serializer.hasExtension(module)) {
serializer.saveExtension(module, managerState.getFacets());
}
}
}
XmlSerializer.serializeInto(managerState, facetManagerElement, new SkipDefaultValuesSerializationFilters());
}
use of com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters in project intellij-community by JetBrains.
the class WebBrowserManager method getState.
@Override
public Element getState() {
Element state = new Element("state");
if (defaultBrowserPolicy != DefaultBrowserPolicy.SYSTEM) {
state.setAttribute("default", defaultBrowserPolicy.name().toLowerCase(Locale.ENGLISH));
}
if (!myShowBrowserHover) {
state.setAttribute("showHover", "false");
}
if (!browsers.equals(PREDEFINED_BROWSERS)) {
for (ConfigurableWebBrowser browser : browsers) {
Element entry = new Element("browser");
entry.setAttribute("id", browser.getId().toString());
entry.setAttribute("name", browser.getName());
entry.setAttribute("family", browser.getFamily().name());
String path = browser.getPath();
if (path != null && !path.equals(browser.getFamily().getExecutionPath())) {
entry.setAttribute("path", path);
}
if (!browser.isActive()) {
entry.setAttribute("active", "false");
}
BrowserSpecificSettings specificSettings = browser.getSpecificSettings();
if (specificSettings != null) {
Element settingsElement = new Element("settings");
XmlSerializer.serializeInto(specificSettings, settingsElement, new SkipDefaultValuesSerializationFilters());
if (!JDOMUtil.isEmpty(settingsElement)) {
entry.addContent(settingsElement);
}
}
state.addContent(entry);
}
}
return state;
}
Aggregations