Hi Bill,
Except for the model deltas, there currently is no public
API for setting selection in the Debug view from the
outside. The technical problem is that the Debug view is
lazy loading, which means that if try to call setSelection()
with an element or even a TreePath, the viewer will not be
able to select this element if it has not been revealed yet.
One alternative is to use the
ITreeModelViewer.updateViewer() method with a selection
delta. This is equivalent to posting the delta from your
model and it means that you need to know all the indexes and
child counts in the model. But at least you wouldn't have
to have a bogus IModelProxy in order to post this delta. Is
this a viable solution for you?
If you don't know the debug view layout. You could create a
VirtualTreeModelViewer with debug view presentation context
ID, and force it to expand all elements. This could get
complicated and expensive performance-wise, so it's worth
looking at other options first.
Cheers,
Pawel
On 01/11/2012 08:34 AM, Bill Swanson wrote:
As part of the Multicore Visualizer work,
I need a mechanism for setting the selection
in the Debug View (e.g. when the user
selects threads in the visualizer, the corresponding
Debug View lines if any want to be
highlighted).
In the original Grid View, I did this via
the hacky method of constructing a Model Delta tree
with appropriate flags and passing it to
TreeModelViewer.updateViewer().
However, in redoing this for the
multicore visualizer I found there is a method on the
viewer,
ITreeModelViewer.trySelection(), that
takes a list of the model objects to be selected
and appears to handle setting the
selection appropriately.
Is this usage of trySelection() as
intended, and are there are any potential issues,
for example is there a planned reorg of
the code that might deprecate
or remove this method?
--- WRS
_______________________________________________
platform-debug-dev mailing list
platform-debug-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-debug-dev