Search in sources :

Example 1 with ClipboardContent

use of javafx.scene.input.ClipboardContent in project cryptomator by cryptomator.

the class UnlockedController method didClickCopyUrl.

@FXML
private void didClickCopyUrl(ActionEvent event) {
    ClipboardContent clipboardContent = new ClipboardContent();
    clipboardContent.putUrl(vault.get().getWebDavUrl());
    clipboardContent.putString(vault.get().getWebDavUrl());
    Clipboard.getSystemClipboard().setContent(clipboardContent);
}
Also used : ClipboardContent(javafx.scene.input.ClipboardContent) FXML(javafx.fxml.FXML)

Example 2 with ClipboardContent

use of javafx.scene.input.ClipboardContent in project cryptomator by cryptomator.

the class DraggableListCell method onDragDetected.

private void onDragDetected(MouseEvent event) {
    if (getItem() == null) {
        return;
    }
    final ClipboardContent content = new ClipboardContent();
    content.putString(Integer.toString(getIndex()));
    final Image snapshot = this.snapshot(new SnapshotParameters(), null);
    final Dragboard dragboard = startDragAndDrop(TransferMode.MOVE);
    dragboard.setDragView(snapshot);
    dragboard.setContent(content);
    event.consume();
}
Also used : SnapshotParameters(javafx.scene.SnapshotParameters) ClipboardContent(javafx.scene.input.ClipboardContent) BorderImage(javafx.scene.layout.BorderImage) Image(javafx.scene.image.Image) Dragboard(javafx.scene.input.Dragboard)

Example 3 with ClipboardContent

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

the class AboutDialogController method dumpPropertiesToClipboard.

private void dumpPropertiesToClipboard(final TableView<SystemProperty> tableView) {
    final StringBuilder buffer = new StringBuilder();
    tableView.getSelectionModel().getSelectedItems().stream().filter(systemProperty -> systemProperty.keyProperty().get() != null).forEach(systemProperty -> {
        buffer.append(systemProperty.keyProperty().get());
        buffer.append("\t");
        if (systemProperty.valueProperty().get() != null) {
            buffer.append(systemProperty.valueProperty().get());
        }
        buffer.append("\n");
    });
    final ClipboardContent content = new ClipboardContent();
    content.putString(buffer.toString());
    Clipboard.getSystemClipboard().setContent(content);
}
Also used : SimpleStringProperty(javafx.beans.property.SimpleStringProperty) ResourceUtils(jgnash.util.ResourceUtils) FXCollections(javafx.collections.FXCollections) TableColumn(javafx.scene.control.TableColumn) TabPane(javafx.scene.control.TabPane) ResourceBundle(java.util.ResourceBundle) ContextMenu(javafx.scene.control.ContextMenu) Pair(jgnash.uifx.util.FXMLUtils.Pair) TableView(javafx.scene.control.TableView) WebView(javafx.scene.web.WebView) Properties(java.util.Properties) MenuItem(javafx.scene.control.MenuItem) NotNull(jgnash.util.NotNull) FXMLUtils(jgnash.uifx.util.FXMLUtils) MainView(jgnash.uifx.views.main.MainView) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) Platform(javafx.application.Platform) FXML(javafx.fxml.FXML) SelectionMode(javafx.scene.control.SelectionMode) Clipboard(javafx.scene.input.Clipboard) Stage(javafx.stage.Stage) Tab(javafx.scene.control.Tab) HTMLResource(jgnash.util.HTMLResource) ObservableList(javafx.collections.ObservableList) ClipboardContent(javafx.scene.input.ClipboardContent) StringProperty(javafx.beans.property.StringProperty) ClipboardContent(javafx.scene.input.ClipboardContent)

Example 4 with ClipboardContent

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

the class ChartUtilities method copyToClipboard.

static void copyToClipboard(final Pane pane) {
    final Clipboard clipboard = Clipboard.getSystemClipboard();
    final ClipboardContent content = new ClipboardContent();
    content.putImage(takeSnapshot(pane));
    clipboard.setContent(content);
}
Also used : ClipboardContent(javafx.scene.input.ClipboardContent) Clipboard(javafx.scene.input.Clipboard)

Example 5 with ClipboardContent

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

the class ConsoleLogView method copyToClipboard.

/**
     * Copy console log to clipboard
     */
public void copyToClipboard() {
    // select all text
    logsContent.selectAll();
    final Clipboard clipboard = Clipboard.getSystemClipboard();
    final ClipboardContent content = new ClipboardContent();
    content.putString(logsContent.getText());
    clipboard.setContent(content);
}
Also used : ClipboardContent(javafx.scene.input.ClipboardContent) Clipboard(javafx.scene.input.Clipboard)

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