in CopyDataToClipboardSerializer I need to override copiedCells variable.
I do use NatTableFactory.class where I create table, register new CopyDataCommandHandler, override table style and so on. But I do not know how to override CopyDataToClipboardSerializer. Or should I register new one and create own class?
I don't know your NatTableFactory class. So I am not sure what you are doing inside that class.
If you need a custom serializer to for example replace line breaks in a text to a space to avoid breaking the table structure, you need to create a custom implementation and use that.
Then register the custom
MyCopyDataCommandHandlerlike this if the headers should be exported too: