From: Bernd Hufmann Date: Wed, 14 Oct 2015 11:06:09 +0000 (-0400) Subject: tmf: add comparator getter to ISegmentAspect interface X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=6ad9d1cb2ddcf98836ff3ee225ce9b363549c8dc;p=deliverable%2Ftracecompass.git tmf: add comparator getter to ISegmentAspect interface Change-Id: Ida38b31726076eaa5b3b465933033cf6e22b0ac7 Signed-off-by: Bernd Hufmann Reviewed-on: https://git.eclipse.org/r/58261 Reviewed-by: Hudson CI Tested-by: Matthew Khouzam Reviewed-by: Matthew Khouzam --- diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/latency/LatencyAnalysis.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/latency/LatencyAnalysis.java index a58f8910f4..99fbeb68ad 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/latency/LatencyAnalysis.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/latency/LatencyAnalysis.java @@ -14,6 +14,7 @@ import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull; import java.io.IOException; import java.io.ObjectInputStream; import java.util.Collection; +import java.util.Comparator; import java.util.HashMap; import java.util.Map; @@ -162,6 +163,10 @@ public class LatencyAnalysis extends AbstractSegmentStoreAnalysisModule { return checkNotNull(Messages.SegmentAspectName_SystemCall); } @Override + public @Nullable Comparator getComparator() { + return null; + } + @Override public @Nullable String resolve(ISegment segment) { if (segment instanceof SystemCall) { return ((SystemCall) segment).getName(); diff --git a/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/analysis/timing/ui/views/segmentstore/AbstractSegmentStoreTableViewer.java b/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/analysis/timing/ui/views/segmentstore/AbstractSegmentStoreTableViewer.java index aabe29c499..8e518bcd34 100644 --- a/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/analysis/timing/ui/views/segmentstore/AbstractSegmentStoreTableViewer.java +++ b/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/analysis/timing/ui/views/segmentstore/AbstractSegmentStoreTableViewer.java @@ -187,7 +187,7 @@ public abstract class AbstractSegmentStoreTableViewer extends TmfSimpleTableView return NonNullUtils.nullToEmptyString(aspect.resolve(input)); } }, - null); + aspect.getComparator()); } } fColumnsCreated = true; diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/segment/ISegmentAspect.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/segment/ISegmentAspect.java index 722ee62824..2c76804dab 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/segment/ISegmentAspect.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/segment/ISegmentAspect.java @@ -9,6 +9,8 @@ package org.eclipse.tracecompass.tmf.core.segment; +import java.util.Comparator; + import org.eclipse.jdt.annotation.Nullable; import org.eclipse.tracecompass.segmentstore.core.ISegment; @@ -48,6 +50,12 @@ public interface ISegmentAspect { */ String getHelpText(); + /** + * Gets the comparator to be used when comparing to segments. + * @return the comparator to be used when comparing to segments + */ + @Nullable Comparator getComparator(); + /** * The "functor" representing this aspect. Basically, what to do for an * segment that is passed in parameter. @@ -60,4 +68,5 @@ public interface ISegmentAspect { * @return The resulting information for this segment. */ @Nullable Object resolve(ISegment segment); + }