Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Cell Text Formatting in Nattable
Cell Text Formatting in Nattable [message #1709254] Fri, 25 September 2015 11:19 Go to next message
Rashmi Tr is currently offline Rashmi TrFriend
Messages: 22
Registered: November 2011
Junior Member
Hi,
I am using CustomLineBorderDecorator with Textpainter for Cells of some Columns to draw line either to left side or top of the Cell in Nattable,

configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, new CustomLineBorderDecorator(new TextPainter(), new BorderStyle(1, GUIHelper.COLOR_BLUE,
                        LineStyleEnum.SOLID)),DisplayMode.NORMAL);


Now the text of cells of one of these Columns whose rows are spanned i have to format like below :

First Line Of Cell
Second Line of Cell
Third Line of Cell

How it can be done ??

I found RichTextCellPainter from latest Nattable SNAPSHOT.

But When I applied it I got two Problems:
- spanned cell border is appearing, and
-after mouse click text of the cell is disappearing

What should I do to fix this and How RichTextCellPainter be used to get above Format???
Re: Cell Text Formatting in Nattable [message #1709260 is a reply to message #1709254] Fri, 25 September 2015 12:07 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Quote:
spanned cell border is appearing


I don't understand what you mean with that. What border? Where? How does your labels look like?

Quote:
after mouse click text of the cell is disappearing


Is there an editor involved? Otherwise I don't understand why text should vanish on click. It doesn't in the examples.

Quote:
How RichTextCellPainter be used to get above Format???


The RichTextCellPainter is able to format HTML markup code. So you need to add the necessary tags. This can for example be done via MarkupDisplayConverter.

I think you need to checkout the sources to get the details and have a look at the example in _424_NebulaRichTextIntegrationExample.
Re: Cell Text Formatting in Nattable [message #1709412 is a reply to message #1709260] Mon, 28 September 2015 09:48 Go to previous messageGo to next message
Rashmi Tr is currently offline Rashmi TrFriend
Messages: 22
Registered: November 2011
Junior Member
Hi,
I have attached image showing above Problems

        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,
                new CustomLineBorderDecorator(new TextPainter(), new BorderStyle(1, GUIHelper.COLOR_BLUE,
                        LineStyleEnum.SOLID)),
                DisplayMode.NORMAL);
(First Column has Labels LEFT_LINE_BORDER_LABEL and TOP_LINE_BORDER_LABEL as well to get Borders)
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,
                new CustomLineBorderDecorator(new RichTextCellPainter(true), new BorderStyle(1, GUIHelper.COLOR_BLUE,
                        LineStyleEnum.SOLID)),
                DisplayMode.NORMAL, firstColumn);


where do I find This " _424_NebulaRichTextIntegrationExample" ??
  • Attachment: totest.png
    (Size: 10.69KB, Downloaded 246 times)
Re: Cell Text Formatting in Nattable [message #1709422 is a reply to message #1709412] Mon, 28 September 2015 11:05 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
I suppose you are talking about the gray lines? You should wrap the RichTextCellPainter in a BackgroundPainter. The current implementation of TextCellPainter is itself a BackgroundPainter (which is IMHO not the best design regarding the painters and might be changed in the future).
Re: Cell Text Formatting in Nattable [message #1709431 is a reply to message #1709422] Mon, 28 September 2015 11:49 Go to previous message
Rashmi Tr is currently offline Rashmi TrFriend
Messages: 22
Registered: November 2011
Junior Member
Thank you very much... after wraping with BackgroundPainter everything is working fine.
Previous Topic:Quick Search feature in the Excel like filters
Next Topic:Automated Testing Recorder for NatTable?
Goto Forum:
  


Current Time: Wed Apr 24 19:37:05 GMT 2024

Powered by FUDForum. Page generated in 0.03774 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top