Skip to main content



      Home
Home » Newcomers » Newcomers » setSelectionProvider event firing order
setSelectionProvider event firing order [message #71158] Sat, 28 May 2005 01:08 Go to next message
Eclipse UserFriend
Originally posted by: dangallery.seanet.com

hello all,
I have a CheckboxTreeViewer which registers itself with
getSite().setSelectionProvider(..). The view also has a
ICheckStateListener inner class listening for checkStateChanged(). It also
holds a model object which is a composite containing the biz data shown in
the tree. The model is updated in the checkStateChanged() method.

Another view, and input form, has registered itself as a selection
listener (with getViewSite().getPage().addSelectionListener(this)). Its
selectionChanged() method fires when items are checked in the
CheckboxTreeViewer. Best I can tell, the selectionChanged method in the
input form (the listener) fires BEFORE the checkStateChanged() method in
the CheckboxTreeViewer is fired. This seems backwards to me.

The selectionChanged method in the input form retrieves the model object
from the CheckboxTreeViewer. But the model is always one selection out of
date because apparently the checkStateChanged() method in the treeViewer
hasn't fired yet (and therefore hasnt updated the model object). How can
I make sure I am retrieving the most current selections, short of moving
my tree model object update code into the input form, which would be weird.

Hope this is not too confusing. thanks much for any help.

dan
Re: setSelectionProvider event firing order [message #71238 is a reply to message #71158] Sat, 28 May 2005 15:05 Go to previous message
Eclipse UserFriend
Originally posted by: jtrentlyon.comptrak.com

i've gotten clearer on my problem. my question now is:

can a check-box tree view - CheckboxTreeViewer - register changes to its
checked state like it can with its selection changes?

registering selection changes (
getSite().setSelectionProvider(checkBoxView) ) works fine. is there an
equivalent for changes made to the check boxes in the tree? something
like getSite().setCheckedProvider(checkBoxView)?

what i would really prefer to do is have a master controller (ala MVC)
object holding all view instances, and have event notification transmitted
to it. it could then update the model objects and transmit updates back
to any views. i am probably missing something fundamental
architecturally.

any help from anyone would be much appreciated.

dan
Previous Topic:Eclipse 3.1M7: Plugin org.eclipse.contribution.junit was unable to load class ... error
Next Topic:Eclipse on XP64 ?
Goto Forum:
  


Current Time: Sun May 11 00:13:12 EDT 2025

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

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

Back to the top