use of com.intellij.openapi.util.WriteExternalException in project intellij-community by JetBrains.
the class MavenProjectsNavigator method getState.
@Override
public MavenProjectsNavigatorState getState() {
ApplicationManager.getApplication().assertIsDispatchThread();
if (myStructure != null) {
try {
myState.treeState = new Element("root");
TreeState.createOn(myTree).writeExternal(myState.treeState);
} catch (WriteExternalException e) {
MavenLog.LOG.warn(e);
}
}
return myState;
}
use of com.intellij.openapi.util.WriteExternalException in project intellij-community by JetBrains.
the class WorkingContextManager method saveContext.
public void saveContext(Element toElement) {
for (WorkingContextProvider provider : Extensions.getExtensions(WorkingContextProvider.EP_NAME, myProject)) {
try {
Element child = new Element(provider.getId());
provider.saveContext(child);
toElement.addContent(child);
} catch (WriteExternalException e) {
LOG.error(e);
}
}
}
use of com.intellij.openapi.util.WriteExternalException in project intellij-community by JetBrains.
the class ClientPropertiesManager method writeExternal.
public void writeExternal(Element element) throws WriteExternalException {
if (equals(getDefaultManager())) {
throw new WriteExternalException();
}
for (Map.Entry<String, List<ClientProperty>> entry : myPropertyMap.entrySet()) {
Element propertiesElement = new Element(ELEMENT_PROPERTIES);
propertiesElement.setAttribute(ATTRIBUTE_CLASS, entry.getKey());
for (ClientProperty prop : entry.getValue()) {
Element propertyElement = new Element(ELEMENT_PROPERTY);
propertyElement.setAttribute(ATTRIBUTE_NAME, prop.getName());
propertyElement.setAttribute(ATTRIBUTE_CLASS, prop.getValueClass());
propertiesElement.addContent(propertyElement);
}
element.addContent(propertiesElement);
}
}
use of com.intellij.openapi.util.WriteExternalException in project intellij-community by JetBrains.
the class AntWorkspaceConfiguration method getState.
public Element getState() {
try {
final Element e = new Element("state");
writeExternal(e);
return e;
} catch (WriteExternalException e1) {
LOG.error(e1);
return null;
}
}
use of com.intellij.openapi.util.WriteExternalException in project intellij-community by JetBrains.
the class ProjectLevelVcsManagerImpl method writeDirectoryMappings.
void writeDirectoryMappings(@NotNull Element element) {
if (myProject.isDefault()) {
element.setAttribute(ATTRIBUTE_DEFAULT_PROJECT, Boolean.TRUE.toString());
}
for (VcsDirectoryMapping mapping : getDirectoryMappings()) {
VcsRootSettings rootSettings = mapping.getRootSettings();
if (rootSettings == null && StringUtil.isEmpty(mapping.getDirectory()) && StringUtil.isEmpty(mapping.getVcs())) {
continue;
}
Element child = new Element(ELEMENT_MAPPING);
child.setAttribute(ATTRIBUTE_DIRECTORY, mapping.getDirectory());
child.setAttribute(ATTRIBUTE_VCS, mapping.getVcs());
if (rootSettings != null) {
Element rootSettingsElement = new Element(ELEMENT_ROOT_SETTINGS);
rootSettingsElement.setAttribute(ATTRIBUTE_CLASS, rootSettings.getClass().getName());
try {
rootSettings.writeExternal(rootSettingsElement);
child.addContent(rootSettingsElement);
} catch (WriteExternalException e) {
// don't add element
}
}
element.addContent(child);
}
}
Aggregations