use of com.intellij.openapi.fileEditor.FileEditorState in project intellij-community by JetBrains.
the class HistoryEntry method writeExternal.
/**
* @return element that was added to the {@code element}.
* Returned element has tag {@link #TAG}. Never null.
*/
public Element writeExternal(Element element, Project project) {
Element e = new Element(TAG);
element.addContent(e);
e.setAttribute(FILE_ATTR, myFilePointer.getUrl());
for (final Map.Entry<FileEditorProvider, FileEditorState> entry : myProvider2State.entrySet()) {
FileEditorProvider provider = entry.getKey();
Element providerElement = new Element(PROVIDER_ELEMENT);
if (provider.equals(mySelectedProvider)) {
providerElement.setAttribute(SELECTED_ATTR_VALUE, Boolean.TRUE.toString());
}
providerElement.setAttribute(EDITOR_TYPE_ID_ATTR, provider.getEditorTypeId());
Element stateElement = new Element(STATE_ELEMENT);
providerElement.addContent(stateElement);
provider.writeState(entry.getValue(), project, stateElement);
e.addContent(providerElement);
}
return e;
}
Aggregations