+ @Override
+ protected @Nullable ITmfTreeViewerEntry updateElements(long start, long end, boolean isSelection) {
+ if (isSelection || (start == end)) {
+ return null;
+ }
+
+ TmfAbstractAnalysisModule analysisModule = getStatisticsAnalysisModule();
+
+ if (getTrace() == null || !(analysisModule instanceof AbstractSegmentStatisticsAnalysis)) {
+ return null;
+ }
+
+ AbstractSegmentStatisticsAnalysis module = (AbstractSegmentStatisticsAnalysis) analysisModule;
+
+ module.waitForCompletion();
+
+ TmfTreeViewerEntry root = new TmfTreeViewerEntry(""); //$NON-NLS-1$
+ final SegmentStoreStatistics entry = module.getTotalStats();
+ if (entry != null) {
+
+ List<ITmfTreeViewerEntry> entryList = root.getChildren();
+
+ TmfTreeViewerEntry aggregateEntry = new SegmentStoreStatisticsEntry(getTotalLabel(), entry);
+ entryList.add(aggregateEntry);
+ HiddenTreeViewerEntry category = new HiddenTreeViewerEntry(getTypeLabel());
+ aggregateEntry.addChild(category);
+
+ Map<String, SegmentStoreStatistics> perSegmentStats = module.getPerSegmentTypeStats();
+ if (perSegmentStats != null) {
+ for (Entry<String, SegmentStoreStatistics> statsEntry : perSegmentStats.entrySet()) {
+ category.addChild(new SegmentStoreStatisticsEntry(statsEntry.getKey(), statsEntry.getValue()));
+ }
+ }
+ }
+ return root;
+ }
+
+ /**
+ * Get the type label
+ *
+ * @return the label
+ * @since 1.2
+ */
+ protected String getTypeLabel() {
+ return checkNotNull(Messages.AbstractSegmentStoreStatisticsViewer_types);
+ }
+
+ /**
+ * Get the total column label
+ *
+ * @return the totals column label
+ * @since 1.2
+ */
+ protected String getTotalLabel() {
+ return checkNotNull(Messages.AbstractSegmentStoreStatisticsViewer_total);
+ }
+