use of org.jdom.output.XMLOutputter in project intellij-community by JetBrains.
the class CommonEditActionsProvider method doCopy.
private boolean doCopy(DataContext dataContext) {
try {
Element root = new Element("designer");
root.setAttribute("target", myDesigner.getPlatformTarget());
List<RadComponent> components = RadComponent.getPureSelection(getArea(dataContext).getSelection());
RadComponent rootComponent = myDesigner.getRootComponent();
if (rootComponent instanceof IComponentCopyProvider) {
IComponentCopyProvider copyProvider = (IComponentCopyProvider) rootComponent;
copyProvider.copyTo(root, components);
} else {
for (RadComponent component : components) {
component.copyTo(root);
}
}
SerializedComponentData data = new SerializedComponentData(new XMLOutputter().outputString(root));
CopyPasteManager.getInstance().setContents(new SimpleTransferable(data, DATA_FLAVOR));
return true;
} catch (Throwable e) {
myDesigner.showError("Copy error", e);
return false;
}
}
use of org.jdom.output.XMLOutputter in project maven-plugins by apache.
the class MavenJDOMWriter method write.
// -- void updateSite(Site, String, Counter, Element)
/**
* Method write
*
* @param project
* @param stream
* @param document
* @deprecated
*/
public void write(Model project, Document document, OutputStream stream) throws java.io.IOException {
updateModel(project, "project", new Counter(0), document.getRootElement());
XMLOutputter outputter = new XMLOutputter();
Format format = Format.getPrettyFormat();
format.setIndent(" ").setLineSeparator(System.getProperty("line.separator"));
outputter.setFormat(format);
outputter.output(document, stream);
}
use of org.jdom.output.XMLOutputter in project maven-plugins by apache.
the class MavenJDOMWriter method write.
// -- void write(Model, Document, OutputStreamWriter)
/**
* Method write
*
* @param project
* @param jdomFormat
* @param writer
* @param document
*/
public void write(Model project, Document document, Writer writer, Format jdomFormat) throws java.io.IOException {
updateModel(project, "project", new Counter(0), document.getRootElement());
XMLOutputter outputter = new XMLOutputter();
outputter.setFormat(jdomFormat);
outputter.output(document, writer);
}
use of org.jdom.output.XMLOutputter in project intellij-community by JetBrains.
the class ArrangementSettingsSerializationTest method assertXmlOutputEquals.
private static void assertXmlOutputEquals(String expected, Element root) throws IOException {
StringWriter writer = new StringWriter();
Format format = Format.getPrettyFormat();
format.setLineSeparator("\n");
new XMLOutputter(format).output(root, writer);
String actual = writer.toString();
assertEquals(expected, actual);
}
use of org.jdom.output.XMLOutputter in project intellij-community by JetBrains.
the class SerializableSchemeExporter method writeToStream.
private static void writeToStream(@NotNull OutputStream outputStream, @NotNull Element element) throws IOException {
OutputStreamWriter writer = new OutputStreamWriter(outputStream);
Format format = Format.getPrettyFormat();
format.setLineSeparator("\n");
new XMLOutputter(format).output(element, writer);
}
Aggregations