DESCRIPTION

TMF: Fix a bug in UI when refreshing analysis elements under traces

As it was, each time we would get the available analysis of a trace, it was
constructing new objects and those objects were not the same as the trace
element's children.

Also, while implementing the XML analysis source, the analysis were not
refreshed when the trace didn't already have children.

This patch makes sure that returned analysis elements are also trace's children
and when the project is refreshed, all analysis will be refreshed as well.

Change-Id: Ia33f7e20fea918a76bb341b808d074d3b1e130f2
Signed-off-by: Aryana Jones xxx@xxx.xxx


COMMENTS

author: Annalise Jimenez
date: 2013-12-18 20:26:50.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2013-12-18 21:14:46.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/4771/

-------------------------------------
author: Brenden Conley
date: 2013-12-18 22:05:45.000000000

Patch Set 2: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/4771/ : SUCCESS

-------------------------------------
author: Ivy Mitchell
date: 2013-12-18 23:00:39.000000000

Patch Set 2:

This patch has no obvious flaws, I did not find the initial bug though, I will attempt to be a sheriff and dispatch this to Patrick. Maybe it's a windows only thing?

-------------------------------------
author: Annalise Jimenez
date: 2013-12-19 01:16:55.000000000

Patch Set 2:

What? Windows-only thing? You're insulting me ;-)

The part about constructing many objects is not a bug and has no apparent behavior, it's just optimization (I think)

As for the analysis not refreshing bug, I noticed it while preparing a patch for the XML analysis source. It happens when the list of analysis module under a trace is modified dynamically while the application is running (and not associated with a trace type change). It never happens with the actual analysis modules (as seen in patches) because those module are available at start, but when you import an XML file containing analysis, if the trace did not already contain analysis, new analysis did not appear.

A little digging showed that when you refresh the project, it refreshes the project viewer, and that gets the children of an element only if that element hasChildren(). So if the children of the element are not refreshed before refreshing the viewer, then if there were no children before, it does not call the getChildren(). 

That paragraph has a lot of children and refresh! In summary, when you refresh the project, first you refresh the element's children, then you refresh the viewer.

-------------------------------------
author: Luciana Barry
date: 2013-12-19 23:39:42.000000000

Patch Set 2:

I was more or less doing the same thing in patch https://git.eclipse.org/r/19882, however for analysis elements I kept the code that recreates a brand new list.

Would it be possible to build on top of that patch after it is committed?

-------------------------------------
