This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SWT tables - check boxes on all columns  RSS feed

 
Nigel Hoath
Greenhorn
Posts: 19
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. From what I can determine check boxes are applied in SWT to the first column only of a table.

However I require check boxes on all cells. I tried creating a table for each column (which gives me my check boxes) but as the number of enries are often numerous and thus require vertical scroll the tables become out of sync (and to the user that sync is important).

Before I knock up some code to try and synchronise the tables I just wanted to check if anyone could suggest any alternative approaches.

The project is SWT based. Any thoughts very welcome as while the synchroniser might be fun to develop I have a lot more useful code to develop before deadline. Cheers Nigel


 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nigel, I've moved this to a section where you're more likely to get a response. Do note that there aren't many SWT users here, so you might want to ask on the Eclipse forums.
 
Nigel Hoath
Greenhorn
Posts: 19
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke wrote:Hi Nigel, I've moved this to a section where you're more likely to get a response. Do note that there aren't many SWT users here, so you might want to ask on the Eclipse forums.


Many thanks Darryl. I took your advice and posted on eclipse and received a link that showed how to embed objects (buttons with checkboxes in my case) into a table.

Here for anyone interested is my code. Do remember to take the SWT_CHECK off the table definition if you have one. If not you get odd results.

 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for keeping us informed, and for posting the solution here. Have a cow!
 
Nigel Hoath
Greenhorn
Posts: 19
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ust to wrap this up.

While embedding real checkboxes in more than the first column of a table using TableEditor seemed a good idea a lot of reading and playing has led me to the conclusion that it is not a good idea.

I can quite happily display a table full of check boxes (as coded above) but try as I might cannot read their state from code. Now I expect there is a way around this but it has the potential to create performance overheads (use of OS resources) and hits display problems.

I've now prototyped a JFace/table solution using two images : one of a checkbox checked and one unchecked. Doesn't feel the way to go but the code is simpler, easier to maintain and works. So life is too short. Enjoy.

ps Darryl maybe you should take the cow back and replace it with a rabbit?

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!