本文整理匯總了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);
}
示例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;
}
示例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);
}