package com.marvinelsen.willow.ui.util

import com.marvinelsen.willow.ui.DictionaryEntryFx
import javafx.scene.input.Clipboard
import javafx.scene.input.ClipboardContent

object ClipboardHelper {
    private val systemClipboard = Clipboard.getSystemClipboard()

    fun copyHeadword(entry: DictionaryEntryFx) {
        val clipboardContent = ClipboardContent()
        clipboardContent.putString(entry.traditionalProperty.value)
        systemClipboard.setContent(clipboardContent)
    }

    fun copyPronunciation(entry: DictionaryEntryFx) {
        val clipboardContent = ClipboardContent()
        clipboardContent.putString(entry.pinyinWithToneMarksProperty.value)
        systemClipboard.setContent(clipboardContent)
    }
}
