[522372] Introduce timeout for auto expansion and expand all behavior

For a very large tree, expanding the whole tree can take a minute or
more. This makes expand all lock the UI thread for quite a long time.
The same is true for the auto expansion. Both should limit the amount of
time spent on expansion.  Ideally this limit is user configurable as a
preference.

When doing expand all, given the whole tree might not be expanded within
the time limit, we focus on the part of the tree in which the user is
most likely interested, i.e., the selection, or failing that, the top
item visible in the tree. Expansion should focus on deeply expanding
those interesting items, and if it gets beyond that point, on the items
closest after and before that item.

When doing auto expand to level, it's best to expand the tree breadth
first so that as many items are expanded as possible within the time
limit and only then as deeply as possible.

Moreover, this change moves the invocation of expand all to the group
provider change listener so that auto expansion also happens after the
group provider is changed.

Bug: 522372
Change-Id: I7ce82fcaf5aa87ce81f3434a85b24c684e9a55f4
Signed-off-by: Philip Langer <planger@eclipsesource.com>
6 files changed