Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Wrapping of text in Column Header
Wrapping of text in Column Header [message #1738720] Fri, 22 July 2016 15:11 Go to next message
Sreeram R is currently offline Sreeram RFriend
Messages: 7
Registered: July 2009
Junior Member
Hi,

I want to know how to introduce Wrapping of text in Column headers, so that entire header is visible in limited column width. I did not find anything in examples.

Can anyone help me?

Thanks,
Sreeram
Re: Wrapping of text in Column Header [message #1738722 is a reply to message #1738720] Fri, 22 July 2016 15:20 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2624
Registered: July 2012
Senior Member
Register a TextPainter that is configured for wrapping. IIRC there is a TextPainter example in the NatTable examples that shows exactly this.

The column header is nothing different than the body or any other region. You only need to use different labels on registering the styles.
Re: Wrapping of text in Column Header [message #1738841 is a reply to message #1738722] Mon, 25 July 2016 12:06 Go to previous messageGo to next message
Sreeram R is currently offline Sreeram RFriend
Messages: 7
Registered: July 2009
Junior Member
I have gone through those examples but none of them wrap a text on Column Header (though it does for cells in Body region). I also tried following the examples to get wrap functionality in body region, but was unsuccessful.

Tried below code as mentioned in examples for wrapping text in cells of body region:

natTable.addConfiguration(new DefaultNatTableStyleConfiguration() {
{
vAlign = VerticalAlignmentEnum.TOP;
hAlign = HorizontalAlignmentEnum.LEFT;
cellPainter = new LineBorderDecorator(new TextPainter(true, true, true));
}
});

Anything missing here?

Thanks,
Sreeram

Re: Wrapping of text in Column Header [message #1738843 is a reply to message #1738841] Mon, 25 July 2016 12:13 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2624
Registered: July 2012
Senior Member
Probably that for the column header a painter is registered for label COLUMN_HEADER and you are only specifying a general setting without a label. Therefore the more specific painter wins over the general one.
Previous Topic:NatTable version 1.1.0 and Glazelist version 1.8.0 compatibility
Next Topic:How to config NatTable to select entire row not single?
Goto Forum:
  


Current Time: Sun Nov 18 06:42:49 GMT 2018

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

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

Back to the top