copy.setAccelerator(new KeyCodeCombination(KeyCode.C, KeyCombination.SHORTCUT_DOWN));
copy.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
final Clipboard clipboard = Clipboard.getSystemClipboard();
final ClipboardContent content = new ClipboardContent();
content.putString(treeView.getSelectionModel().getSelectedItem().getValue().displayname);
clipboard.setContent(content);
}
});
copy.disableProperty().bind(treeView.getSelectionModel().selectedItemProperty().isNull());
contextMenu.getItems().add(copy);