tmf: Fix time graph combo freezing when expanding parent of many items
authorPatrick Tasse <patrick.tasse@gmail.com>
Mon, 24 Mar 2014 17:34:10 +0000 (13:34 -0400)
committerPatrick Tasse <patrick.tasse@gmail.com>
Thu, 27 Mar 2014 15:59:11 +0000 (11:59 -0400)
commit70e10acc5374164f0c3bff160f05d9cc30c74193
treecd0e049fcd32998107d5162d0c2af8f67f1d6942
parent588dff10a1c000de0fbc473ad00aff43060010fe
tmf: Fix time graph combo freezing when expanding parent of many items

When expanding an item in the time graph combo, the expanded state of
every child item needs to be synched between the tree and the time
graph, due to inconsistent behavior between platforms. When the parent
has hundreds of child items, this can take several seconds due to the
inefficient searching for the item corresponding to a time graph entry
in both the tree and the time graph, for getting and setting the
expanded state.

For the tree, instead of gettting the expanded state of each item from
the tree viewer using the model element, the set of expanded elements
is retrieved once and the expanded state can be deduced by the presence
or absence of a model element in this set. Furthermore the synching of
expanded state is only performed for child items that have children
themselves.

For the time graph, the item model is changed to use a map from time
graph entry to time graph item, which greatly reduced the time necessary
to find the item corresponding to an entry. The expanded item index is
also stored directly in the item which avoids the need to iterate to
find an expanded time graph entry's index.

Change-Id: Icefc393be8a5e2ee1a98b98a2c6b126da7490035
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/23817
Tested-by: Hudson CI
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphCombo.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java
This page took 0.026408 seconds and 5 git commands to generate.