}
public void actionPerformed(AnActionEvent anActionEvent) {
Object[] configurations = list.getSelectedValues();
try {
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
Element rootElement = new Element("connection-configurations");
for (Object o : configurations) {
ConnectionSettings configuration = (ConnectionSettings) o;
Element configElement = new Element("config");
configuration.writeConfiguration(configElement);
rootElement.addContent(configElement);
}
Document document = new Document(rootElement);
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
String xmlString = outputter.outputString(document);
clipboard.setContents(ClipboardUtil.createXmlContent(xmlString), null);
} catch (Exception e) {
LOGGER.error("Could not copy database configuration to clipboard", e);
}
}