DESCRIPTION

tmf: Use tabs in statistics view for each traces

When an experiment/trace is selected, the statistics view creates a
global viewer and a specific viewer for each trace contained in the
experiment. These viewers are placed in tabs and shown in the
statistics view. Also, a factory is now used to create a viewer based
on his definition in the plug-in.xml from the trace type. An
extension point element has been added to the trace type extension
point to provide custom statistics viewer.

Signed-off-by: Simeon Moses xxx@xxx.xxx

Change-Id: I8d380e8c28cba855b5361069200e50ab0cbca7f3


COMMENTS

author: Simeon Moses
date: 2012-08-10 20:33:55.000000000

Uploaded patch set 5.

-------------------------------------
author: Braxton Mccarthy
date: 2012-08-12 02:48:53.000000000

Patch Set 5: I would prefer that you didn't submit this; IP review completed

(20 inline comments)

Preliminary review, I haven't run it yet (will wait until we merge the first part).

But it's slowly coming together, good work!

There are still a couple things we need to work on here first:
- Should TmfViewerFolder use a generic type
- Making TmfStatisticsView.fStatsViewers final if possible
- Check if message.properties's should be per plugin or per package.

Line:254, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> list of traces

Line:51, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> corresponds

Line:188, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> This cast here isn't very pretty...

As we discussed, perhaps a generic type for TmfViewerFolder would be worth it, it'd ensure the type-safety.

Or at worse/in the meantime, do an instanceof check before casting.

Line:196, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> same here

Line:280, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> I see this check in many places. Can fStatsViewers actually be null?

Would it be possible to make it final, and initialize it in the constructor?

Line:301, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> Each viewer is placed in a different tab, and the first one is selected automatically.

Line:305, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> depending on the trace type ?

If no viewer is defined,...

Line:307, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> , a global statistics viewer will still be created.

(active form usually > passive ;) )

Line:330, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> This! These types of inline comments are very good! :)

Line:31, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/TmfViewerFactory.java -> \n

Line:47, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/TmfViewerFactory.java -> Is it me or this method seems weird...

It doesn't seem to do what the Javadoc implies. Why is it called getTraceTypeElement()...

Line:61, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/TmfViewerFactory.java -> ...and why is a TmfTraceType returned here?

Merge artifact maybe?

Line:84, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/TmfViewerFactory.java -> Each viewer type method shouldn't need its own method... that's the point of a factory.

Line:43, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/TmfViewer.java -> "Default constructor" refers to a constructor that takes no arguments. Or at least that's how I understand it.

Line:28, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/tabsview/TmfViewerFolder.java -> each tab

Line:123, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/tabsview/TmfViewerFolder.java -> Hmm what? ;)

"Returns the folder that is used as the parent of all tabs" maybe?

Line:154, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/tabsview/TmfViewerFolder.java -> Why do you return a Collection here? Wouldn't a Map be more appropriate? (especially if you mention the order won't be necessarily the same)

Line:28, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/ITmfViewer.java -> \n

Line:149, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/TmfStatisticsViewer.java -> "number of wait" ?

Line:660, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/TmfStatisticsViewer.java -> if a statistics update is ongoing. If it is ongoing, the new time...

-------------------------------------
author: Simeon Moses
date: 2012-08-12 05:53:34.000000000

Patch Set 5: (20 inline comments)



Line:254, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> Done

Line:51, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> Done

Line:188, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> I create the statistics viewers four lines above and this may not be a TmfStatisticsViewer here? Of course, createStatisticsViewers may be overloaded, but in this case, the developper should really get an exception, since he inserted something in the folderViewer that isn't a TmfStatisticsViewer...

We'll see if a generic would be OK for the ViewerFolder

Line:196, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> see other comment :)

Line:280, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> Initializing is not easy from the constructor, because you don't have access to the parent yet - Done

Line:301, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> Done

Line:305, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> Done

Line:307, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> Done

Line:330, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> Really?

Line:31, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/TmfViewerFactory.java -> Done

Line:47, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/TmfViewerFactory.java -> maybe getTraceTypeViewer would be a better name?

Line:61, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/TmfViewerFactory.java -> It creates an Object based on the trace type element, i.e. the TmfTraceType.STATISTICS_VIEWER_ELEM. Check the javadoc of createExec...

Line:84, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/TmfViewerFactory.java -> You're right - Done

Line:43, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/TmfViewer.java -> Done

Line:28, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/tabsview/TmfViewerFolder.java -> Done

Line:123, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/tabsview/TmfViewerFolder.java -> Done

Line:154, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/tabsview/TmfViewerFolder.java -> Because there is no need for a map! You get all the viewers only to process something on each one of them the same way. Otherwise, you still can get the viewer by his name from the method getViewer(String)

Line:28, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/ITmfViewer.java -> Done

Line:149, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/TmfStatisticsViewer.java -> what don't you understand?

Line:660, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/TmfStatisticsViewer.java -> Done

-------------------------------------
author: Braxton Mccarthy
date: 2012-08-13 14:50:59.000000000

Patch Set 5: (1 inline comment)



Line:154, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/tabsview/TmfViewerFolder.java -> My bad, I didn't notice it returns the .values(), not the hashmap itself. HashMap.values() indeed returns a Collection.

-------------------------------------
author: Simeon Moses
date: 2012-08-14 19:10:05.000000000

Patch Set 5: (3 inline comments)



Line:188, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> Done - I use instanceOf and I log an error using the default Activator if the instance is not a statistics viewer

Line:280, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java -> Done

Line:149, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/TmfStatisticsViewer.java -> Done

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