當前位置: 首頁>>代碼示例>>Java>>正文


Java ClipboardContent.putHtml方法代碼示例

本文整理匯總了Java中javafx.scene.input.ClipboardContent.putHtml方法的典型用法代碼示例。如果您正苦於以下問題:Java ClipboardContent.putHtml方法的具體用法?Java ClipboardContent.putHtml怎麽用?Java ClipboardContent.putHtml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.input.ClipboardContent的用法示例。


在下文中一共展示了ClipboardContent.putHtml方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: copyAddress

import javafx.scene.input.ClipboardContent; //導入方法依賴的package包/類
@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);
}
 
開發者ID:creativechain,項目名稱:creacoinj,代碼行數:10,代碼來源:ClickableBitcoinAddress.java

示例2: prepareClipboardContent

import javafx.scene.input.ClipboardContent; //導入方法依賴的package包/類
private ClipboardContent prepareClipboardContent() {
    ClipboardContent content = new ClipboardContent();
    if (sourceFormats.contains(DataFormat.PLAIN_TEXT)) {
        log("Source is putting string on dragboard");
        content.putString(CONTENT_PLAIN_TEXT);
    }
    if (sourceFormats.contains(DataFormat.URL)) {
        log("Source is putting URL on dragboard");
        content.putUrl(CONTENT_URL);
    }
    if (sourceFormats.contains(DataFormat.IMAGE)) {
        log("Source is putting image on dragboard");
        content.putImage(CONTENT_IMAGE);
    }
    if (sourceFormats.contains(DataFormat.HTML)) {
        log("Source is putting HTML on dragboard");
        content.putHtml(CONTENT_HTML);
    }
    if (sourceFormats.contains(DataFormat.RTF)) {
        log("Source is putting RTF on dragboard");
        content.putRtf(CONTENT_RTF);
    }
    if (sourceFormats.contains(DF_CUSTOM_BYTES)) {
        log("Source is putting custom four bytes on dragboard");
        content.put(DF_CUSTOM_BYTES, CONTENT_CUSTOM_BYTES);
    }
    if (sourceFormats.contains(DF_CUSTOM_STRING)) {
        log("Source is putting custom four bytes on dragboard");
        content.put(DF_CUSTOM_STRING, CONTENT_CUSTOM_STRING);
    }
    if (sourceFormats.contains(DF_CUSTOM_CLASS)) {
        log("Source is putting custom class on dragboard");
        content.put(DF_CUSTOM_CLASS, CONTENT_CUSTOM_CLASS);
    }
    if (sourceFormats.contains(DataFormat.FILES)) {
        log("Source is putting two files on dragboard");
        content.putFiles(CONTENT_FILES);
    }
    return content;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:41,代碼來源:DragDropWithControls.java

示例3: copyAddress

import javafx.scene.input.ClipboardContent; //導入方法依賴的package包/類
@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);
}
 
開發者ID:HashEngineering,項目名稱:megacoinj,代碼行數:10,代碼來源:ClickableBitcoinAddress.java


注:本文中的javafx.scene.input.ClipboardContent.putHtml方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。