Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » RichTextPainter and Alignment question
RichTextPainter and Alignment question [message #1760371] Wed, 26 April 2017 12:53 Go to next message
Mike Rumpf is currently offline Mike RumpfFriend
Messages: 47
Registered: July 2009
Member
Hallo,

at the moment I am introducing the RichTextPainter to our nattable to be able to use html contents. This works fine. However the original cell alignment (e.g. center) seems to get lost after registering the RichTextCellPainter.

Am I missing something in constructing the configuration?

final Style style = new Style();
		style.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
				HorizontalAlignmentEnum.CENTER);
		configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
				style, DisplayMode.NORMAL);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,
				new BackgroundPainter(new RichTextCellPainter()),
				DisplayMode.NORMAL);


Best regards,
Mike
Re: RichTextPainter and Alignment question [message #1760373 is a reply to message #1760371] Wed, 26 April 2017 13:27 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
When using the RichTextPainter the styling information needs to be provided by the HTML content. Some basic styling information is applied like font, foreground and background color in case nothing is provided by the HTML content. But there is no inspection of the alignment NatTable styles by the RichTextCellPainter. That needs to be provided by the content.

I'm unsure what would happen if we inspect these styles and wrap the content with a p tag with according style information. That could override the style settings done in the HTML, e.g. if the cell content is edited and styled via RichTextCellEditor.
Re: RichTextPainter and Alignment question [message #1760389 is a reply to message #1760373] Wed, 26 April 2017 14:51 Go to previous messageGo to next message
Mike Rumpf is currently offline Mike RumpfFriend
Messages: 47
Registered: July 2009
Member
Fair enough.

This maybe a stupid question: But what would be a simple column content to change the text color and use center-alignment? Simple html code does not work in my application.

I was trying to figure it out with the RichTextEditor in the NebulaRichTextIntegrationExample. But that has some serious resizing issues on my machine.

Best regards,
Mike
Re: RichTextPainter and Alignment question [message #1760391 is a reply to message #1760389] Wed, 26 April 2017 14:59 Go to previous message
Mike Rumpf is currently offline Mike RumpfFriend
Messages: 47
Registered: July 2009
Member
I got it to work now. I had some silly syntax error in my xtend text.
Previous Topic:Suggestion related to ComboboxFilter
Next Topic:IColumnAccessor.setDataValue is called twice
Goto Forum:
  


Current Time: Sat Apr 20 01:43:52 GMT 2024

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

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

Back to the top