[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] setSelectionProvider event firing order

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