Commit
663b59dc27800d39b8500807eeaa06450c95b564
by Patrick Tassetmf: Improve stability of AbstractTmfTreeViewer on model update
Use a fixed root element per trace as tree viewer input. When the tree
viewer input is not changed and refresh() is called, the tree updates
itself and maintains the tree items states as much as possible.
This is done by checking the equality of the tree viewer's elements. Use
an ElementComparer that considers element with the same model id to be
equal.
Add method getRoot() to allow sub-classes access to the trace's root
element.
Create the root element when the trace is first loaded, and discard it
when the trace is closed.
Update method updateTreeUI() to be able to be used whether the new input
is the same object or not. If it is not, update the tree with
setInput(), but if it is the same object, simply refresh the tree.
Pack the tree columns only when a new input object is used. This will
prevent the user's manual adjustment of column width to be unaffected by
an update of the tree model or sorting order.
Because method modelToTree() in AbstractSelectTreeViewer/2 does not have
access to the trace instance and to avoid changing API, get its returned
tree model's root children and reassign them to the proper trace's root
element.
Change-Id: Icf65b8d624f43988bb44bb120b72eb275fb0a291
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/c/tracecompass/org.eclipse.tracecompass/+/169994
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>