</message_arguments>
</filter>
</resource>
+ <resource path="src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/model/IMarkerEventSource.java" type="org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.IMarkerEventSource">
+ <filter comment="API preference INTERFACE_ELEMENT_TYPE_ADDED_DEFAULT_METHOD=Ignore is not properly supported (Bug 507246)" id="404000815">
+ <message_arguments>
+ <message_argument value="org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.IMarkerEventSource"/>
+ <message_argument value="getMarkerList(long, long, long, IProgressMonitor)"/>
+ </message_arguments>
+ </filter>
+ </resource>
</component>
long resolution, @NonNull IProgressMonitor monitor) {
List<IMarkerEvent> markers = new ArrayList<>();
for (IMarkerEventSource markerEventSource : getMarkerEventSources(fTrace)) {
- for (String category : markerEventSource.getMarkerCategories()) {
- if (monitor.isCanceled()) {
- break;
- }
- markers.addAll(markerEventSource.getMarkerList(category, startTime, endTime, resolution, monitor));
- }
+ markers.addAll(markerEventSource.getMarkerList(startTime, endTime, resolution, monitor));
}
return markers;
}
/*******************************************************************************
- * Copyright (c) 2015, 2016 Ericsson
+ * Copyright (c) 2015, 2017 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
package org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
*/
@NonNull List<@NonNull IMarkerEvent> getMarkerList(@NonNull String category, long startTime, long endTime, long resolution, @NonNull IProgressMonitor monitor);
+ /**
+ * Gets the list of marker events of all categories that intersect the given
+ * time range (inclusively).
+ * <p>
+ * The list should include, for each category, the nearest previous and next
+ * markers that do not intersect the time range.
+ *
+ * @param startTime
+ * Start of the time range
+ * @param endTime
+ * End of the time range
+ * @param resolution
+ * The resolution
+ * @param monitor
+ * The progress monitor object
+ * @return The list of marker events
+ * @since 2.3
+ */
+ default @NonNull List<@NonNull IMarkerEvent> getMarkerList(long startTime, long endTime, long resolution, @NonNull IProgressMonitor monitor) {
+ List<@NonNull IMarkerEvent> markers = new ArrayList<>();
+ for (String category : getMarkerCategories()) {
+ if (monitor.isCanceled()) {
+ break;
+ }
+ markers.addAll(getMarkerList(category, startTime, endTime, resolution, monitor));
+ }
+ return markers;
+ }
}