| «« Is a Hashtable of <String, Vector> Threadsafe? | 1 of 1531 »» |
|
About
I'm Ryan Lowe, a Software Engineering graduate living in Ottawa, Canada. I like agile software development and Ruby on Rails.
I write this blog in Canadian English and don't use a spell checker. Typos happen.
Projects
» Full-time Ruby on Rails freelancer
» Full-time with Rails since May 2005 » Former committer for RadRails (now Aptana) » I also have a few Rails side-projects in development: 1. wheretogoinTO.com Toronto nightlife 2. Hey Heads Up! TODO list and sharing 3. Layered Genealogy family history research 4. foos for foosball scoring 5. fanconcert for music fans (on hold) Hiring Rails developers? I can telecommute by the hour from Ottawa, Canada »» Email: rails AT ryanlowe DOT ca
BulletBlog
Now hosted on Hey! Heads Up -- check it out!
Syndication
Pings
Recent
Derek Lowe's (Ryan's older brother) words at Ryan's funeral
blog@ryanlowe.ca no more Forging Email Headers: Good, Bad or Ugly? Sarcastic Dictionary (Part 1 of Many) Tags Hierarchies Twisting Rails is Risky Business Risky Business? My Take on Early Alphas Whoa, it's August 2007 Closing Comments A Postscript to "Growth at the grassroots" »» All Blog Posts
Linkage
del.icio.us/ryanlowe
technorati/ryanlowe.ca/blog Aurora Roy Jim Andrew Trasker Travis Kibbee Karen Dr. Unk Ayana Van Bloggers Joel Spolsky Robert Scoble Tim Bray Dave Winer Raymond Chen James Robertson Ruby/Rails Bloggers rubyonrails.org weblog David Heinemeier Hansson Dave Thomas James Duncan Davidson Mike Clark Jamis Buck Signal vs. Noise Tobias Luetke Amy Hoy: (24)slash7 Jeremy Voorhis Eclipse Bloggers Planet Eclipse EclipseZone Luis de la Rosa Eclipse Foundation Kim Horne Billy Biggs Ian Skerrett Mike Milinkovich Bjorn Freeman-Benson Denis Roy
Archives
|
Selecting with SWT Table and JFace TableViewer
A few nasty bugs were coming up in my GUI code and they were hard to recognize as GUI errors. I'm using the model-view-controller pattern for the three views so far in AudioMan, which use JFace TableViewers. TableViewers are an abstraction around an SWT Table that allow a programmer to use an SWT Table more conveniently. The problems I ran into dealt with having a selection on an SWT TableViewer. If an item was selected in a TableViewer and I called a method to add to or remove from the model (which would then notify the TableViewer's content provider via a listener), I would get a duplicate of the selected item which would linger around and never go away. The solution was to deselect all of the elements in the TableViewer before doing additions or removals but that has to be done against the interior Table like: tableViewer.getTable().deselectAll(); So after the operation was finished I wanted to select an item again. If I selected it with the TableViewer's select methods I would fire the selection listener attached to the TableViewer (and cause a stack overflow because of recursion because of the way I called my methods). To get around that I went back down to the interior SWT Table again to select the item, which doesn't fire the TableViewer's selection listener: tableViewer.getTable().select(0); It's one of those things that is a "duh!" moment once you figure it out. By the way, I'm just finishing up the unit testing on the AudioMan stuff I have so far and I should release the first developer build tomorrow afternoon. Posted at February 12, 2004 at 03:39 AM ESTLast updated February 12, 2004 at 03:39 AM EST Comments
Interesting, this page was the first result of my search on google for: Jface tableviewer Congrats! » Posted by: Ali Echihabi at July 5, 2004 03:15 PMHow to add a check box(SWT.CHECK property) in the last column of a SWT Table?. pls help me ASAP » Posted by: venkat at February 2, 2005 12:22 AMThis is some very useful stuff. Thanks for sharing your experience. » Posted by: Ashish Joy at March 3, 2005 11:33 AMfirst result on google for "swt table"... » Posted by: kevin w at April 15, 2005 06:00 PM |