swt and checked tables

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

swt and checked tables

Wayne Miller
I am attempting to use the SWT Table with the SWT.CHECK style.

Two questions:

1. How do you default the checked value on the table for items in the list.
The only solution I was able to come up was to go through the table items
and programmatically set the check of the table items and then fire the
selection listeners on the table.  This seems very backwards and error prone
to me since the lists should be manipulating the GUI like the glazed code
does.  There are set methods in the checktablefilter but that attribute is
private and we as programmers do not have access to it.
(This thought also holds true for programmatic selections on the table...)

2. When I sort a checked table all the checks disappear and I have to go
back and reset them.

Maybe my approach to how I envision it should work needs a tweek.  My
thoughts are this:
1. The data model contains an event list
2. The EventTableViewer is passed a sorted list whose origin is the data
model event list.
3. When the data model is loaded or changed it should fire a listChanged
event listener in the viewer with a hook to programmatically set the checked
value in the corresponding table item.

Or maybe I am just missing something...

BTW, I really like the glazed lists event driven architecture.  I am
relatively new to Glazed Lists, Java, and Eclipse, but am very impressed
with the design approach.  I have written GUI frameworks in 8 other
languages and this in IMHO is the best I have worked with yet.

Keep up the good work.

Thanx...

-Wayne



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: swt and checked tables

James Lemieux
Wayner,

    Currently it sounds like you're using TableFormat, but CheckableTableFormat is more appropriate for your use case. Assuming the objects that your list elements have some sort of boolean property you can use to record whether they are checked or not, CheckableTableFormat guides glazed lists to toggle said property. Implement that guy and you should be glazing again in no time flat.

Thanks!

Jesse James

On 8/16/05, Wayne Miller <[hidden email]> wrote:
I am attempting to use the SWT Table with the SWT.CHECK style.

Two questions:

1. How do you default the checked value on the table for items in the list.
The only solution I was able to come up was to go through the table items
and programmatically set the check of the table items and then fire the
selection listeners on the table.  This seems very backwards and error prone
to me since the lists should be manipulating the GUI like the glazed code
does.  There are set methods in the checktablefilter but that attribute is
private and we as programmers do not have access to it.
(This thought also holds true for programmatic selections on the table...)

2. When I sort a checked table all the checks disappear and I have to go
back and reset them.

Maybe my approach to how I envision it should work needs a tweek.  My
thoughts are this:
1. The data model contains an event list
2. The EventTableViewer is passed a sorted list whose origin is the data
model event list.
3. When the data model is loaded or changed it should fire a listChanged
event listener in the viewer with a hook to programmatically set the checked
value in the corresponding table item.

Or maybe I am just missing something...

BTW, I really like the glazed lists event driven architecture.  I am
relatively new to Glazed Lists, Java, and Eclipse, but am very impressed
with the design approach.  I have written GUI frameworks in 8 other
languages and this in IMHO is the best I have worked with yet.

Keep up the good work.

Thanx...

-Wayne



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]