}
private void exportToClipboard(int type) throws IOException {
Toolkit toolkit = Toolkit.getDefaultToolkit();
Clipboard clipboard = toolkit.getSystemClipboard();
StringSelection stringSelection = null;
switch (type) {
case TYPE_HTMLCLIPBOARD:
stringSelection = new StringSelection(getHTML(null));
break;
case TYPE_MEDIAWIKI:
stringSelection = new StringSelection(getMediaWiki());
break;
case TYPE_GOOGLEGADGET:
stringSelection = new StringSelection(getGoogleGadget());
break;
}
clipboard.setContents(stringSelection, null);