DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page TableViewer Text formatting help
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jun 2009
Post TableViewer Text formatting help - 06-27-2009, 08:56 PM

Hello,

I am developing an Eclipse RCP application and am trying to format the text in my tableviewer view.

Here is a mockup of what I want:


I want the bold text to be the title of the item and be in a bigger font. Then I want the description below that in a smaller font and in italics.

The closest I've been able to come so far is using a tableviewer and tableviewlabelprovider:


But that only gives me a getColumnText method that returns a string with no formatting. Any pointers on how I could achieve the mockup?

Thanks,
-Michael
Reply With Quote
  (#2 (permalink)) Old
Active Contributor
 
Posts: 62
Thanks: 0
Thanked 6 Times in 6 Posts
Join Date: Jun 2009
Default 06-30-2009, 04:01 AM

As the tableviewer use the labelprovider to set the string, there’s no method provided for the font change.
For this case, I suggest you use TableItem instead, which provides the setFont(int index, Font font) method.
You could also use the composite to achieve.
As below, many kinds of effect could be generated freely.


www.eclaxy.com
let's perfect the eclipse!
Reply With Quote
  (#3 (permalink)) Old
Active Contributor
 
Posts: 62
Thanks: 0
Thanked 6 Times in 6 Posts
Join Date: Jun 2009
Default 06-30-2009, 04:17 AM

As the tableviewer use the labelprovider to set the string, there’s no method provided for the font change.
For this case, I suggest you use TableItem instead, which provides the setFont(int index, Font font) method.
You could also use the composite to achieve.
As below, many kinds of effect could be generated freely.

p1.png


www.eclaxy.com
let's perfect the eclipse!
Reply With Quote
Reply

Tags
eclipse, labelprovider, rcp, tableviewer

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
jface binding wih TableViewer dkandalov Eclipse 1 03-24-2009 05:03 AM
Skip logger statements while formatting akjain84 Eclipse 0 01-21-2009 04:57 AM
New file formatting mkjackson Eclipse 1 11-07-2008 08:13 PM
TableViewer and ViewerFilter matt.blye@gmail.com Eclipse 0 08-08-2008 03:01 PM
ComboBoxCellEditor in TableViewer CBMMelb Eclipse 2 05-16-2008 02:22 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com