Search in sources :

Example 11 with ClipboardContent

use of javafx.scene.input.ClipboardContent in project trex-stateless-gui by cisco-system-traffic-generator.

the class LogsView method copyToClipboard.

/**
     * Copy logs to clipboard
     */
public void copyToClipboard() {
    final Clipboard clipboard = Clipboard.getSystemClipboard();
    final ClipboardContent content = new ClipboardContent();
    content.putString(sb.toString());
    clipboard.setContent(content);
}
Also used : ClipboardContent(javafx.scene.input.ClipboardContent) Clipboard(javafx.scene.input.Clipboard)

Example 12 with ClipboardContent

use of javafx.scene.input.ClipboardContent in project jgnash by ccavanaugh.

the class ConsoleDialogController method handleCopyToClipboard.

@FXML
private void handleCopyToClipboard() {
    final ClipboardContent content = new ClipboardContent();
    content.putString(consoleArea.getText());
    Clipboard.getSystemClipboard().setContent(content);
}
Also used : ClipboardContent(javafx.scene.input.ClipboardContent) InjectFXML(jgnash.uifx.util.InjectFXML) FXML(javafx.fxml.FXML)

Aggregations

ClipboardContent (javafx.scene.input.ClipboardContent)12 Clipboard (javafx.scene.input.Clipboard)6 FXML (javafx.fxml.FXML)5 Dragboard (javafx.scene.input.Dragboard)3 Collectors (java.util.stream.Collectors)2 ObservableList (javafx.collections.ObservableList)2 ContextMenu (javafx.scene.control.ContextMenu)2 MenuItem (javafx.scene.control.MenuItem)2 SelectionMode (javafx.scene.control.SelectionMode)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Objects (java.util.Objects)1 Optional (java.util.Optional)1 Properties (java.util.Properties)1 ResourceBundle (java.util.ResourceBundle)1 Consumer (java.util.function.Consumer)1 Platform (javafx.application.Platform)1 ObjectProperty (javafx.beans.property.ObjectProperty)1