use of javafx.scene.input.Clipboard in project jgnash by ccavanaugh.
the class TableViewEx method handleCopyToClipboard.
public void handleCopyToClipboard() {
final List<S> items = getSelectionModel().getSelectedItems();
if (items.size() > 0 && getClipBoardStringFunction() != null) {
final Clipboard clipboard = Clipboard.getSystemClipboard();
final ClipboardContent content = new ClipboardContent();
final StringBuilder builder = new StringBuilder();
for (final S item : items) {
builder.append(getClipBoardStringFunction().apply(item));
builder.append('\n');
}
content.putString(builder.toString());
clipboard.setContent(content);
}
}
use of javafx.scene.input.Clipboard in project tokentool by RPTools.
the class TokenTool_Controller method editCopyImageMenu_OnAction.
@FXML
void editCopyImageMenu_OnAction(ActionEvent event) {
Clipboard clipboard = Clipboard.getSystemClipboard();
ClipboardContent content = new ClipboardContent();
// for paste as file, e.g. in Windows Explorer
try {
File tempTokenFile = fileSaveUtil.getTempFileName(false, useFileNumberingCheckbox.isSelected(), fileNameTextField.getText(), fileNameSuffixTextField);
writeTokenImage(tempTokenFile);
content.putFiles(java.util.Collections.singletonList(tempTokenFile));
tempTokenFile.deleteOnExit();
} catch (Exception e) {
log.error(e);
}
// for paste as image, e.g. in GIMP
content.putImage(tokenImageView.getImage());
// Finally, put contents on clip board
clipboard.setContent(content);
}
use of javafx.scene.input.Clipboard in project PayFile by mikehearn.
the class ClickableBitcoinAddress method copyAddress.
@FXML
protected void copyAddress(ActionEvent event) {
// User clicked icon or menu item.
Clipboard clipboard = Clipboard.getSystemClipboard();
ClipboardContent content = new ClipboardContent();
content.putString(getAddress());
content.putHtml(String.format("<a href='%s'>%s</a>", uri(), getAddress()));
clipboard.setContent(content);
}
use of javafx.scene.input.Clipboard in project bitsquare by bitsquare.
the class Utilities method copyToClipboard.
public static void copyToClipboard(String content) {
try {
if (content != null && content.length() > 0) {
Clipboard clipboard = Clipboard.getSystemClipboard();
ClipboardContent clipboardContent = new ClipboardContent();
clipboardContent.putString(content);
clipboard.setContent(clipboardContent);
}
} catch (Throwable e) {
log.error("copyToClipboard failed " + e.getMessage());
e.printStackTrace();
}
}
use of javafx.scene.input.Clipboard in project certmgr by hdecarne.
the class StoreController method onCmdCopyEntryDN.
@SuppressWarnings("unused")
@FXML
void onCmdCopyEntryDN(ActionEvent evt) {
TreeItem<StoreEntryModel> selectedItem = this.ctlStoreEntryView.getSelectionModel().getSelectedItem();
if (selectedItem != null) {
Clipboard clipboard = Clipboard.getSystemClipboard();
ClipboardContent content = new ClipboardContent();
content.putString(selectedItem.getValue().getName());
clipboard.setContent(content);
}
}
Aggregations