Package javafx.scene.input

Examples of javafx.scene.input.ClipboardContent


                                    statusField.appendText(outPath + "\n");
                                }else {
                                    String fullHTMLString = "";
                                    try {
                                    final Clipboard clipboard = Clipboard.getSystemClipboard();
                                    final ClipboardContent content = new ClipboardContent();
                                    // br fix required because html output-method seems to be affected by xhtml namespace
                                    fullHTMLString = HTMLRender.getFileContent("file:///" + outPath).replace("<br></br>", "<br />");
                                    fullHTMLString = fullHTMLString.replace("<body>", "<body style=\"background-color:#454545;\">");
                                    int initStart = fullHTMLString.indexOf("style=") + 1;
                                    int start = fullHTMLString.indexOf("style=", initStart) + 7;
                                    int end = fullHTMLString.lastIndexOf("</pre>") + 6;
                                    String divString = "<pre style=\"white-space: nowrap; ";
                                    String preString = divString + fullHTMLString.substring(start, end);
                                    content.putString(preString);
                                    clipboard.setContent(content);
                                    } catch (Exception e){}
                                    eng.loadContent(fullHTMLString);
                                    //eng.load("file:///" + outPath);
                                }
View Full Code Here


        Button b = AwesomeDude.createIconButton(icon, text, "2em", "0.8em", ContentDisplay.TOP);
        b.setTooltip(tooltip);
        b.setPrefWidth(180.0);
        b.setOnAction((ActionEvent t) -> {
            Clipboard clipboard = Clipboard.getSystemClipboard();
            final ClipboardContent content = new ClipboardContent();
            content.putString(icon.name());
            clipboard.setContent(content);
        });
        return b;
    }
View Full Code Here

    @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);
    }
View Full Code Here

        });

    }

    public void cutCopy(String data) {
        ClipboardContent clipboardContent = new ClipboardContent();
        clipboardContent.putString(data);
        clipboard.setContent(clipboardContent);
    }
View Full Code Here

        });

    }

    public void copyFile(Path path) {
        ClipboardContent clipboardContent = new ClipboardContent();
        clipboardContent.putFiles(Arrays.asList(path.toFile()));
        clipboard.setContent(clipboardContent);
    }
View Full Code Here

    {
      @Override
      public void handle(ActionEvent e)
      {
        final Clipboard clipboard = Clipboard.getSystemClipboard();
        final ClipboardContent content = new ClipboardContent();

        ObservableList<Node> items = vBoxRows.getChildren();

        content.putString(transformNodeItemsToTextUsing(items));

        clipboard.setContent(content);
      }
    });
  }
View Full Code Here

     * leaving the current selection.
     */
    default void copy() {
        String selectedText = getSelectedText();
        if (selectedText.length() > 0) {
            ClipboardContent content = new ClipboardContent();
            content.putString(selectedText);
            Clipboard.getSystemClipboard().setContent(content);
        }
    }
View Full Code Here

    @FXML
    protected void copyAddress(ActionEvent event) {
        // User clicked icon or menu item.
        Clipboard clipboard = Clipboard.getSystemClipboard();
        ClipboardContent content = new ClipboardContent();
        content.putString(addressStr.get());
        content.putHtml(String.format("<a href='%s'>%s</a>", uri(), addressStr.get()));
        clipboard.setContent(content);
    }
View Full Code Here

      public void handle(MouseEvent event) {
        /* allow any transfer mode */
        Dragboard db = treeCell.startDragAndDrop(TransferMode.ANY);

        /* put a string on dummy content dragboard */
        ClipboardContent content = new ClipboardContent();
        content.putString("dummy content");
        db.setContent(content);

        MultipleSelectionModel<?> selectionModel = getSelectionModel(treeCell);
        ObservableList<?> selectedItems = selectionModel.getSelectedItems();

View Full Code Here

TOP

Related Classes of javafx.scene.input.ClipboardContent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.