@Override
public void actionPerformed(ActionEvent e) {
Tableur sheet = SpreadSheets.getInstance().getActiveSheet();
if (sheet == null)
throw new NullPointerException("Pas de tableur");
JDialogClipboard jdc = new JDialogClipboard(null, JDialogClipboard.JDialogClipboardType.TOCLIPBOARD, sheet.toCSV());
jdc.setVisible(true);
if (jdc.isOk()) {
String text = jdc.getText();
StringSelection stringSelection = new StringSelection(text);
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(stringSelection, null);
}
jdc.dispose();
}