DESCRIPTION

TMF: Add an abstract tree viewer class

Provides default functionalities for all tree viewers, like how to set the
column information, basic classes to manage the content of the tree. It
provides abstract method to get the data to fill the tree, without worrying
about what must run in the UI thread.

This abstract tree viewer automatically synchronizes with the application's
time ranges.

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


COMMENTS

author: Brenden Conley
date: 2014-02-18 20:04:14.000000000

Patch Set 1:

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

-------------------------------------
author: Annalise Jimenez
date: 2014-02-18 20:07:34.000000000

Patch Set 1:

I developed this class from 2 use cases: 

1- the state system explorer (which actually displays a tree): https://git.eclipse.org/r/#/c/22185/

2- The CPU usage view's tree viewer (displays only a list, but shows percentages, sortable/movable columns, selection listeners, etc). This view also depends on the series of patches for the analysis output, so I can't push them yet.

-------------------------------------
author: Brenden Conley
date: 2014-02-18 21:00:15.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Ricky Reeves
date: 2014-02-24 20:48:35.000000000

Patch Set 1: Code-Review-1

(11 comments)

Hi Genevieve

I like your effort to simplify the creation of tree viewers for displaying trace data that supports the TMF time range and selection synchronization. I created one simple viewer with hardcoded data and it was straight forward.

However, I see a lot of overlap of this with the packages  org.eclipse.linuxtools.tmf.ui.viewers.statistics.model, org.eclipse.linuxtools.tmf.ui.viewers.statistics. 
The classes TmfBaseColumnData, TmfBaseColumnDataProvider and ITmfColumnDataProvider could be re-used here. 

Would it be possible to extract the common parts from the statistics packages and use it with the abstract tree viewer?

Line:44, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/tree/ITmfTreeViewerEntry.java -> remove the since annotation

Line:20, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/tree/TmfTreeColumnData.java -> This class is an updated version of TmfBaseColumnData.

Line:23, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/tree/TmfTreeColumnData.java -> typo width

Line:51, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/tree/AbstractTmfTreeViewer.java -> typo: viewer instead of viewer's.

Line:66, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/tree/AbstractTmfTreeViewer.java -> Maybe change to: 
The elements of the tree  viewer are of type ITmfTreeViewerEntry.

Line:215, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/tree/AbstractTmfTreeViewer.java -> Is there an advantage of using TreeColumn directly instead of using TreeViewerColumn as it was done in TmfStatisticsViewer?

Line:377, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/tree/AbstractTmfTreeViewer.java -> should be ITmfTreeViewerEntry. Users might decide to implement the interface themselves.

Line:411, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/tree/AbstractTmfTreeViewer.java -> change first sentence to "... in a given time range or selection time range". 
The second/third sentence is not clear. Maybe write it similar than in method below.

Line:421, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/tree/AbstractTmfTreeViewer.java -> rename to isSelection

Line:455, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/tree/AbstractTmfTreeViewer.java -> unless the user overwrites updateContent() and executes it in the UI thread.

Line:461, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/tree/AbstractTmfTreeViewer.java -> change to isSelection

-------------------------------------
author: Annalise Jimenez
date: 2014-02-24 20:59:57.000000000

Patch Set 1:

(1 comment)

Hi Meredith Scott,

Indeed, I took some inspiration from the statistics. And as I was talking with Alex, the statistics is unncessarily complicated, and with the analysis framework, the statistics framework is not as useful as it used to be.

So once this is accepted, the statistics will be rewritten to make use of this simpler version and a lot of code will go! So I preferred to start from the minimal requirements, if it means adding new methods eventually, than try to remove from the existing code.

Line:20, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/tree/TmfTreeColumnData.java -> Indeed I should mention it.

-------------------------------------
author: Ricky Reeves
date: 2014-02-25 11:54:11.000000000

Patch Set 1:

Well the statistic framework has some features which are currently not used and that's why it seems complicated for what it is used for. Unfortunately, it's only be used for event counts and it's not possible to see the potential of it. It could have been used for many other statistics. BTW, I didn't write the code but the design was based on my proposal to the student who did it during his internship. 

Please update the code according to the comments. Also, give credit to the original author of code that was migrated.

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