Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsStyledText in TextPainter
https://www.eclipse.org/forums/index.php/mv/msg/1081408/1744066/#msg_1744066
we wondered, why there is a Text in the TextPainter and not a StyledText. Are there any reasons for that?
Thanks
Nico Linder]]>Nico Linder2016-09-22T07:13:38-00:00Re: StyledText in TextPainter
https://www.eclipse.org/forums/index.php/mv/msg/1081408/1744071/#msg_1744071
Dirk Fauth2016-09-22T07:53:06-00:00Re: StyledText in TextPainter
https://www.eclipse.org/forums/index.php/mv/msg/1081408/1744092/#msg_1744092
I meant the TextCellEditor.]]>Nico Linder2016-09-22T10:13:26-00:00Re: StyledText in TextPainter
https://www.eclipse.org/forums/index.php/mv/msg/1081408/1744101/#msg_1744101
On the other hand, if you want to use StyledText, feel free to implement a custom editor. Should be straight forward with the framework.
BTW, since 1.5 we have a RichTextPainter and RichTextCellEditor that operate via HTML for styling text. It can be found in the Nebula Extension.]]>Dirk Fauth2016-09-22T10:42:39-00:00Re: StyledText in TextPainter
https://www.eclipse.org/forums/index.php/mv/msg/1081408/1751631/#msg_1751631
I have the need for an editor and painter which support links (which the RichTextEditor/Painter does not). So I thought of a StyledText-like editor/painter, which is however also not yet supported.
When digging a bit deeper into the implementation to see what it would need to make links working, I think I understood the following:
to implement linking, somehow I have to remember the area that should be responsive to the mouse, and a link target ('href') associated with this area
during the painting process, I could compute these areas
I cannot store them in the painter, however, since painters are not associated with the cell
the cell is created on the fly, so I cannot store it there, eiter
I currently have two ideas how to do it:
store it somehow in the data associated with the cell, and therefore I would make the users via the data providers responsible for storing the data. For example, I could create a new interface ICellPainterData which gives access both to the 'real' data and to the painter data. It doesn't feel like the best way to do it (because it requires the users of the NatTable to store internal data), but that's the best (easiest) idea I had so far.
Probably however it is best to store the data in the painter itself, somehow in a data type which stores objects based on cell row/colum indices...
Would you have alternative suggestions?
Thank you!
Joachim
]]>Joachim Fox2017-01-12T05:58:11-00:00Re: StyledText in TextPainter
https://www.eclipse.org/forums/index.php/mv/msg/1081408/1751642/#msg_1751642
If there should be only a text shown as link, there should be easier ways to achieve this. If the link should be part of a longer text, I would suggest to try to extend the RichTextPainter instead of hacking in NatTable. AFAIK the Papyrus team is currently working on adding link support in Nebula RichText.]]>Dirk Fauth2017-01-12T07:46:39-00:00Re: StyledText in TextPainter
https://www.eclipse.org/forums/index.php/mv/msg/1081408/1751709/#msg_1751709
thank you for the Papyrus hint. The link should be part of a longer text, the text should be able to contain more than one hint, and potentially also support other features (e.g. mouse over/tooltips) based on the location of the mouse pointer over the cell. Therefore, the 'active regions' of the cell need to be stored to be accessible for the UI bindings.
I'll have a look at what Papyrus is doing and how the RichText feature could be extended.